You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
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
This commit is contained in:
@@ -517,9 +517,8 @@ void EditorNode::_update_theme(bool p_skip_creation) {
|
||||
|
||||
scene_root_parent->add_theme_style_override("panel", theme->get_stylebox(SNAME("Content"), EditorStringName(EditorStyles)));
|
||||
bottom_panel->add_theme_style_override("panel", theme->get_stylebox(SNAME("BottomPanel"), EditorStringName(EditorStyles)));
|
||||
main_menu->add_theme_style_override("pressed", theme->get_stylebox(SNAME("MenuTransparent"), EditorStringName(EditorStyles)));
|
||||
distraction_free->set_icon(theme->get_icon(SNAME("DistractionFree"), EditorStringName(EditorIcons)));
|
||||
distraction_free->add_theme_style_override("pressed", theme->get_stylebox(SNAME("MenuTransparent"), EditorStringName(EditorStyles)));
|
||||
distraction_free->add_theme_style_override("pressed", theme->get_stylebox("normal", "FlatMenuButton"));
|
||||
|
||||
help_menu->set_item_icon(help_menu->get_item_index(HELP_SEARCH), theme->get_icon(SNAME("HelpSearch"), EditorStringName(EditorIcons)));
|
||||
help_menu->set_item_icon(help_menu->get_item_index(HELP_COPY_SYSTEM_INFO), theme->get_icon(SNAME("ActionCopy"), EditorStringName(EditorIcons)));
|
||||
@@ -6638,7 +6637,7 @@ EditorNode::EditorNode() {
|
||||
|
||||
main_menu = memnew(MenuBar);
|
||||
title_bar->add_child(main_menu);
|
||||
main_menu->set_theme_type_variation("FlatMenuButton");
|
||||
main_menu->set_theme_type_variation("MainMenuBar");
|
||||
main_menu->set_start_index(0); // Main menu, add to the start of global menu.
|
||||
main_menu->set_prefer_global_menu(global_menu);
|
||||
main_menu->set_switch_on_hover(true);
|
||||
|
||||
Reference in New Issue
Block a user