summaryrefslogtreecommitdiffstats
path: root/editor/gui
diff options
context:
space:
mode:
authorMatt Enad <m22mail@comcast.net>2024-03-06 22:00:10 -0500
committerMatt Enad <m22mail@comcast.net>2024-03-13 15:38:09 -0400
commitd4ac3fabac437ab194b5666392db97f34e1306a0 (patch)
tree2b99b90b0dc5196a8416d0a067d2de7376393ddf /editor/gui
parent006f5bc11c8538fe6c512db2f16ec5cbcd049709 (diff)
downloadredot-engine-d4ac3fabac437ab194b5666392db97f34e1306a0.tar.gz
Fix main button margins in custom themes
Defined more theme variations and styleboxes for those variations to work around an issue where external editor themes would apply incorrect margins to certain buttons. This should eliminate clipping/alignment issues while a custom theme is in use. Also simplified the step where margins are copied over thanks to @Rindbee 's suggestion
Diffstat (limited to 'editor/gui')
-rw-r--r--editor/gui/editor_bottom_panel.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/editor/gui/editor_bottom_panel.cpp b/editor/gui/editor_bottom_panel.cpp
index e567e42bdb..1c95b546f4 100644
--- a/editor/gui/editor_bottom_panel.cpp
+++ b/editor/gui/editor_bottom_panel.cpp
@@ -50,10 +50,6 @@ void EditorBottomPanel::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
expand_button->set_icon(get_editor_theme_icon(SNAME("ExpandBottomDock")));
- for (int i = 0; i < items.size(); i++) {
- items.write[i].button->add_theme_style_override("pressed", get_theme_stylebox(SNAME("MenuTransparent"), EditorStringName(EditorStyles)));
- items.write[i].button->add_theme_style_override("hover_pressed", get_theme_stylebox(SNAME("MenuHover"), EditorStringName(EditorStyles)));
- }
} break;
}
}
@@ -160,7 +156,7 @@ void EditorBottomPanel::load_layout_from_config(Ref<ConfigFile> p_config_file, c
Button *EditorBottomPanel::add_item(String p_text, Control *p_item, const Ref<Shortcut> &p_shortcut, bool p_at_front) {
Button *tb = memnew(Button);
- tb->set_theme_type_variation("FlatMenuButton");
+ tb->set_theme_type_variation("BottomPanelButton");
tb->connect("toggled", callable_mp(this, &EditorBottomPanel::_switch_by_control).bind(p_item));
tb->set_drag_forwarding(Callable(), callable_mp(this, &EditorBottomPanel::_button_drag_hover).bind(tb, p_item), Callable());
tb->set_text(p_text);