Replaced the text with an icon on the SpatialEditor's and the CanvasItemEditor's view button.

This commit is contained in:
Relintai 2023-09-03 14:17:49 +02:00
parent e0bafda416
commit 24d7260169
2 changed files with 4 additions and 2 deletions

View File

@ -3812,6 +3812,7 @@ void CanvasItemEditor::_notification(int p_what) {
grid_snap_button->set_icon(get_theme_icon("SnapGrid", "EditorIcons")); grid_snap_button->set_icon(get_theme_icon("SnapGrid", "EditorIcons"));
snap_config_menu->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons")); snap_config_menu->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons"));
skeleton_menu->set_icon(get_theme_icon("Bone", "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")); override_camera_button->set_icon(get_theme_icon("Camera2D", "EditorIcons"));
pan_button->set_icon(get_theme_icon("ToolPan", "EditorIcons")); pan_button->set_icon(get_theme_icon("ToolPan", "EditorIcons"));
ruler_button->set_icon(get_theme_icon("Ruler", "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)); main_menu_hbox->add_child(memnew(VSeparator));
view_menu = memnew(MenuButton); view_menu = memnew(MenuButton);
view_menu->set_text(TTR("View")); view_menu->set_tooltip(TTR("View"));
main_menu_hbox->add_child(view_menu); main_menu_hbox->add_child(view_menu);
view_menu->get_popup()->connect("id_pressed", this, "_popup_callback"); view_menu->get_popup()->connect("id_pressed", this, "_popup_callback");
view_menu->set_switch_on_hover(true); view_menu->set_switch_on_hover(true);

View File

@ -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")); tool_option_button[SpatialEditor::TOOL_OPT_OVERRIDE_CAMERA]->set_icon(get_theme_icon("Camera", "EditorIcons"));
transform_menu->set_icon(get_theme_icon("3D", "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_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")); 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"); p->connect("id_pressed", this, "_menu_item_pressed");
view_menu = memnew(MenuButton); view_menu = memnew(MenuButton);
view_menu->set_text(TTR("View")); view_menu->set_tooltip(TTR("View"));
view_menu->set_switch_on_hover(true); view_menu->set_switch_on_hover(true);
main_menu_hbox->add_child(view_menu); main_menu_hbox->add_child(view_menu);