diff options
Diffstat (limited to 'modules/mono/editor')
-rw-r--r-- | modules/mono/editor/godotsharp_editor.cpp | 22 | ||||
-rw-r--r-- | modules/mono/editor/mono_bottom_panel.cpp | 7 | ||||
-rw-r--r-- | modules/mono/editor/mono_bottom_panel.h | 4 |
3 files changed, 20 insertions, 13 deletions
diff --git a/modules/mono/editor/godotsharp_editor.cpp b/modules/mono/editor/godotsharp_editor.cpp index c3c9175726..5b68810017 100644 --- a/modules/mono/editor/godotsharp_editor.cpp +++ b/modules/mono/editor/godotsharp_editor.cpp @@ -167,9 +167,6 @@ void GodotSharpEditor::_remove_create_sln_menu_option() { menu_popup->remove_item(menu_popup->get_item_index(MENU_CREATE_SLN)); - if (menu_popup->get_item_count() == 0) - menu_button->hide(); - bottom_panel_btn->show(); } @@ -413,9 +410,12 @@ GodotSharpEditor::GodotSharpEditor(EditorNode *p_editor) { editor->add_child(memnew(MonoReloadNode)); - menu_button = memnew(MenuButton); - menu_button->set_text(TTR("Mono")); - menu_popup = menu_button->get_popup(); + menu_popup = memnew(PopupMenu); + menu_popup->hide(); + menu_popup->set_as_toplevel(true); + menu_popup->set_pass_on_modal_close_click(false); + + editor->add_tool_submenu_item("Mono", menu_popup); // TODO: Remove or edit this info dialog once Mono support is no longer in alpha { @@ -478,10 +478,12 @@ GodotSharpEditor::GodotSharpEditor(EditorNode *p_editor) { menu_popup->connect("id_pressed", this, "_menu_option_pressed"); - if (menu_popup->get_item_count() == 0) - menu_button->hide(); - - editor->get_menu_hb()->add_child(menu_button); + ToolButton *build_button = memnew(ToolButton); + build_button->set_text("Build"); + build_button->set_tooltip("Build solution"); + build_button->set_focus_mode(Control::FOCUS_NONE); + build_button->connect("pressed", MonoBottomPanel::get_singleton(), "_build_project_pressed"); + editor->get_menu_hb()->add_child(build_button); // External editor settings EditorSettings *ed_settings = EditorSettings::get_singleton(); diff --git a/modules/mono/editor/mono_bottom_panel.cpp b/modules/mono/editor/mono_bottom_panel.cpp index cc9822e319..21ce9ca5c4 100644 --- a/modules/mono/editor/mono_bottom_panel.cpp +++ b/modules/mono/editor/mono_bottom_panel.cpp @@ -125,9 +125,14 @@ void MonoBottomPanel::_build_tabs_item_selected(int p_idx) { void MonoBottomPanel::_build_tabs_nothing_selected() { - if (build_tabs->get_tab_count() != 0) // just in case + if (build_tabs->get_tab_count() != 0) { // just in case build_tabs->set_visible(false); + // This callback is called when clicking on the empty space of the list. + // ItemList won't deselect the items automatically, so we must do it ourselves. + build_tabs_list->unselect_all(); + } + warnings_btn->set_visible(false); errors_btn->set_visible(false); view_log_btn->set_visible(false); diff --git a/modules/mono/editor/mono_bottom_panel.h b/modules/mono/editor/mono_bottom_panel.h index d3109592a9..406e46f7ce 100644 --- a/modules/mono/editor/mono_bottom_panel.h +++ b/modules/mono/editor/mono_bottom_panel.h @@ -51,8 +51,8 @@ class MonoBottomPanel : public VBoxContainer { ItemList *build_tabs_list; TabContainer *build_tabs; - Button *warnings_btn; - Button *errors_btn; + ToolButton *warnings_btn; + ToolButton *errors_btn; Button *view_log_btn; void _update_build_tabs_list(); |