From 24d7260169c793154c6297e44ecf65b657ecd42f Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 3 Sep 2023 14:17:49 +0200 Subject: [PATCH] Replaced the text with an icon on the SpatialEditor's and the CanvasItemEditor's view button. --- editor/plugins/canvas_item_editor_plugin.cpp | 3 ++- editor/plugins/spatial_editor_plugin.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index bd12a2ca2..8eb6a49ce 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3812,6 +3812,7 @@ void CanvasItemEditor::_notification(int p_what) { grid_snap_button->set_icon(get_theme_icon("SnapGrid", "EditorIcons")); snap_config_menu->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons")); skeleton_menu->set_icon(get_theme_icon("Bone", "EditorIcons")); + view_menu->set_icon(get_theme_icon("GuiVisibilityVisible", "EditorIcons")); override_camera_button->set_icon(get_theme_icon("Camera2D", "EditorIcons")); pan_button->set_icon(get_theme_icon("ToolPan", "EditorIcons")); ruler_button->set_icon(get_theme_icon("Ruler", "EditorIcons")); @@ -5626,7 +5627,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { main_menu_hbox->add_child(memnew(VSeparator)); view_menu = memnew(MenuButton); - view_menu->set_text(TTR("View")); + view_menu->set_tooltip(TTR("View")); main_menu_hbox->add_child(view_menu); view_menu->get_popup()->connect("id_pressed", this, "_popup_callback"); view_menu->set_switch_on_hover(true); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 6847954fe..c73aab929 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -6730,6 +6730,7 @@ void SpatialEditor::_notification(int p_what) { tool_option_button[SpatialEditor::TOOL_OPT_OVERRIDE_CAMERA]->set_icon(get_theme_icon("Camera", "EditorIcons")); transform_menu->set_icon(get_theme_icon("3D", "EditorIcons")); + view_menu->set_icon(get_theme_icon("GuiVisibilityVisible", "EditorIcons")); view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_theme_icon("Panels1", "EditorIcons")); view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_theme_icon("Panels2", "EditorIcons")); @@ -7292,7 +7293,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p->connect("id_pressed", this, "_menu_item_pressed"); view_menu = memnew(MenuButton); - view_menu->set_text(TTR("View")); + view_menu->set_tooltip(TTR("View")); view_menu->set_switch_on_hover(true); main_menu_hbox->add_child(view_menu);