1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Merge pull request #102786 from Giganzo/top-toolbar-menu-button-styles

Fix MenuButton style in editor top menu bar
This commit is contained in:
Thaddeus Crews
2025-04-10 10:18:10 -05:00
8 changed files with 16 additions and 0 deletions

View File

@@ -569,6 +569,8 @@ MeshInstance3DEditor::MeshInstance3DEditor() {
options = memnew(MenuButton); options = memnew(MenuButton);
options->set_text(TTR("Mesh")); options->set_text(TTR("Mesh"));
options->set_switch_on_hover(true); options->set_switch_on_hover(true);
options->set_flat(false);
options->set_theme_type_variation("FlatMenuButton");
Node3DEditor::get_singleton()->add_control_to_menu_panel(options); Node3DEditor::get_singleton()->add_control_to_menu_panel(options);
options->get_popup()->add_item(TTR("Create Collision Shape..."), MENU_OPTION_CREATE_COLLISION_SHAPE); options->get_popup()->add_item(TTR("Create Collision Shape..."), MENU_OPTION_CREATE_COLLISION_SHAPE);

View File

@@ -278,6 +278,8 @@ MeshLibraryEditor::MeshLibraryEditor() {
menu->set_position(Point2(1, 1)); menu->set_position(Point2(1, 1));
menu->set_text(TTR("MeshLibrary")); menu->set_text(TTR("MeshLibrary"));
menu->set_button_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("MeshLibrary"), EditorStringName(EditorIcons))); menu->set_button_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("MeshLibrary"), EditorStringName(EditorIcons)));
menu->set_flat(false);
menu->set_theme_type_variation("FlatMenuButton");
menu->get_popup()->add_item(TTR("Add Item"), MENU_OPTION_ADD_ITEM); menu->get_popup()->add_item(TTR("Add Item"), MENU_OPTION_ADD_ITEM);
menu->get_popup()->add_item(TTR("Remove Selected Item"), MENU_OPTION_REMOVE_ITEM); menu->get_popup()->add_item(TTR("Remove Selected Item"), MENU_OPTION_REMOVE_ITEM);
menu->get_popup()->add_separator(); menu->get_popup()->add_separator();

View File

@@ -273,6 +273,8 @@ MultiMeshEditor::MultiMeshEditor() {
options->set_text("MultiMesh"); options->set_text("MultiMesh");
options->set_button_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("MultiMeshInstance3D"), EditorStringName(EditorIcons))); options->set_button_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("MultiMeshInstance3D"), EditorStringName(EditorIcons)));
options->set_flat(false);
options->set_theme_type_variation("FlatMenuButton");
options->get_popup()->add_item(TTR("Populate Surface")); options->get_popup()->add_item(TTR("Populate Surface"));
options->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &MultiMeshEditor::_menu_option)); options->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &MultiMeshEditor::_menu_option));

View File

@@ -133,5 +133,7 @@ ParallaxBackgroundEditorPlugin::ParallaxBackgroundEditorPlugin() {
menu->get_popup()->add_item(TTR("Convert to Parallax2D"), MENU_CONVERT_TO_PARALLAX_2D); menu->get_popup()->add_item(TTR("Convert to Parallax2D"), MENU_CONVERT_TO_PARALLAX_2D);
menu->set_text(TTR("ParallaxBackground")); menu->set_text(TTR("ParallaxBackground"));
menu->set_switch_on_hover(true); menu->set_switch_on_hover(true);
menu->set_flat(false);
menu->set_theme_type_variation("FlatMenuButton");
toolbar->add_child(menu); toolbar->add_child(menu);
} }

View File

@@ -118,6 +118,8 @@ ParticlesEditorPlugin::ParticlesEditorPlugin() {
menu = memnew(MenuButton); menu = memnew(MenuButton);
menu->set_switch_on_hover(true); menu->set_switch_on_hover(true);
menu->set_flat(false);
menu->set_theme_type_variation("FlatMenuButton");
toolbar->add_child(menu); toolbar->add_child(menu);
menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &ParticlesEditorPlugin::_menu_callback)); menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &ParticlesEditorPlugin::_menu_callback));
} }

View File

@@ -96,6 +96,8 @@ Skeleton2DEditor::Skeleton2DEditor() {
options->set_text(TTR("Skeleton2D")); options->set_text(TTR("Skeleton2D"));
options->set_button_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Skeleton2D"), EditorStringName(EditorIcons))); options->set_button_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Skeleton2D"), EditorStringName(EditorIcons)));
options->set_flat(false);
options->set_theme_type_variation("FlatMenuButton");
options->get_popup()->add_item(TTR("Reset to Rest Pose"), MENU_OPTION_SET_REST); options->get_popup()->add_item(TTR("Reset to Rest Pose"), MENU_OPTION_SET_REST);
options->get_popup()->add_separator(); options->get_popup()->add_separator();

View File

@@ -586,6 +586,8 @@ Sprite2DEditor::Sprite2DEditor() {
CanvasItemEditor::get_singleton()->add_control_to_menu_panel(options); CanvasItemEditor::get_singleton()->add_control_to_menu_panel(options);
options->set_text(TTR("Sprite2D")); options->set_text(TTR("Sprite2D"));
options->set_flat(false);
options->set_theme_type_variation("FlatMenuButton");
options->get_popup()->add_item(TTR("Convert to MeshInstance2D"), MENU_OPTION_CONVERT_TO_MESH_2D); options->get_popup()->add_item(TTR("Convert to MeshInstance2D"), MENU_OPTION_CONVERT_TO_MESH_2D);
options->get_popup()->add_item(TTR("Convert to Polygon2D"), MENU_OPTION_CONVERT_TO_POLYGON_2D); options->get_popup()->add_item(TTR("Convert to Polygon2D"), MENU_OPTION_CONVERT_TO_POLYGON_2D);

View File

@@ -154,6 +154,8 @@ CSGShapeEditor::CSGShapeEditor() {
options->hide(); options->hide();
options->set_text(TTR("CSG")); options->set_text(TTR("CSG"));
options->set_switch_on_hover(true); options->set_switch_on_hover(true);
options->set_flat(false);
options->set_theme_type_variation("FlatMenuButton");
Node3DEditor::get_singleton()->add_control_to_menu_panel(options); Node3DEditor::get_singleton()->add_control_to_menu_panel(options);
options->get_popup()->add_item(TTR("Bake Mesh Instance"), MENU_OPTION_BAKE_MESH_INSTANCE); options->get_popup()->add_item(TTR("Bake Mesh Instance"), MENU_OPTION_BAKE_MESH_INSTANCE);