diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_themes.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 22 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.h | 1 | ||||
-rw-r--r-- | editor/script_create_dialog.cpp | 21 | ||||
-rw-r--r-- | editor/script_create_dialog.h | 1 |
5 files changed, 32 insertions, 15 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index b8dd29cecc..f74e913208 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -585,7 +585,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("hover", "CheckButton", style_menu); theme->set_icon("on", "CheckButton", theme->get_icon("GuiToggleOn", "EditorIcons")); + theme->set_icon("on_disabled", "CheckButton", theme->get_icon("GuiToggleOnDisabled", "EditorIcons")); theme->set_icon("off", "CheckButton", theme->get_icon("GuiToggleOff", "EditorIcons")); + theme->set_icon("off_disabled", "CheckButton", theme->get_icon("GuiToggleOffDisabled", "EditorIcons")); theme->set_color("font_color", "CheckButton", font_color); theme->set_color("font_color_hover", "CheckButton", font_color_hl); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 0982da784f..92579e5cef 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -603,6 +603,8 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) { idx = history[history_pos].control->get_index(); } tab_container->set_current_tab(idx); + } else { + _update_selected_editor_menu(); } _update_history_arrows(); @@ -1002,6 +1004,9 @@ void ScriptEditor::_menu_option(int p_option) { save_all_scripts(); } break; + case SEARCH_IN_FILES: { + _on_find_in_files_requested(""); + } break; case SEARCH_HELP: { help_search_dialog->popup_dialog(); @@ -2694,10 +2699,22 @@ void ScriptEditor::_update_selected_editor_menu() { } EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_current_tab_control()); + script_search_menu->get_popup()->clear(); if (eh) { + + script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find..."), KEY_MASK_CMD | KEY_F), HELP_SEARCH_FIND); + script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_next", TTR("Find Next"), KEY_F3), HELP_SEARCH_FIND_NEXT); + script_search_menu->get_popup()->add_separator(); + script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_in_files", TTR("Find in Files"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F), SEARCH_IN_FILES); script_search_menu->show(); } else { - script_search_menu->hide(); + + if (tab_container->get_child_count() == 0) { + script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_in_files", TTR("Find in Files"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F), SEARCH_IN_FILES); + script_search_menu->show(); + } else { + script_search_menu->hide(); + } } } @@ -3109,10 +3126,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { script_search_menu->set_text(TTR("Search")); script_search_menu->set_switch_on_hover(true); script_search_menu->get_popup()->set_hide_on_window_lose_focus(true); - script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find..."), KEY_MASK_CMD | KEY_F), HELP_SEARCH_FIND); - script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_next", TTR("Find Next"), KEY_F3), HELP_SEARCH_FIND_NEXT); script_search_menu->get_popup()->connect("id_pressed", this, "_menu_option"); - script_search_menu->hide(); debug_menu = memnew(MenuButton); menu_hb->add_child(debug_menu); diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index a17fed1e06..683fa881f8 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -157,6 +157,7 @@ class ScriptEditor : public PanelContainer { DEBUG_SHOW, DEBUG_SHOW_KEEP_OPEN, DEBUG_WITH_EXTERNAL_EDITOR, + SEARCH_IN_FILES, SEARCH_HELP, SEARCH_WEBSITE, REQUEST_DOCS, diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index fac5bccd17..751ae4fcf7 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -567,23 +567,22 @@ void ScriptCreateDialog::_update_dialog() { } } - if (!_can_be_built_in()) - internal->set_pressed(false); - /* Is Script created or loaded from existing file */ if (is_built_in) { get_ok()->set_text(TTR("Create")); parent_name->set_editable(true); parent_browse_button->set_disabled(false); - internal->set_disabled(!_can_be_built_in()); + internal->set_visible(_can_be_built_in()); + internal_label->set_visible(_can_be_built_in()); _msg_path_valid(true, TTR("Built-in script (into scene file).")); } else if (is_new_script_created) { // New Script Created get_ok()->set_text(TTR("Create")); parent_name->set_editable(true); parent_browse_button->set_disabled(false); - internal->set_disabled(!_can_be_built_in()); + internal->set_visible(_can_be_built_in()); + internal_label->set_visible(_can_be_built_in()); if (is_path_valid) { _msg_path_valid(true, TTR("Will create a new script file.")); } @@ -753,13 +752,13 @@ ScriptCreateDialog::ScriptCreateDialog() { /* Built-in Script */ internal = memnew(CheckButton); + internal->set_h_size_flags(0); internal->connect("pressed", this, "_built_in_pressed"); - hb = memnew(HBoxContainer); - hb->add_child(internal); - l = memnew(Label(TTR("Built-in Script"))); - l->set_align(Label::ALIGN_RIGHT); - gc->add_child(l); - gc->add_child(hb); + internal_label = memnew(Label(TTR("Built-in Script"))); + internal_label->set_text(TTR("Built-in Script")); + internal_label->set_align(Label::ALIGN_RIGHT); + gc->add_child(internal_label); + gc->add_child(internal); /* Path */ diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index 1a3ba3d371..c6dba78f56 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -58,6 +58,7 @@ class ScriptCreateDialog : public ConfirmationDialog { Button *path_button; EditorFileDialog *file_browse; CheckButton *internal; + Label *internal_label; VBoxContainer *path_vb; AcceptDialog *alert; CreateDialog *select_class; |