diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-12-17 07:58:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-17 07:58:21 +0100 |
commit | 01a62232264eae3beea6fd6afceae8a45328985f (patch) | |
tree | 080ab671472ad74e5f2f735af45ae8cec2e840e8 /editor/plugins | |
parent | 8fdbfe0aa8479fe08cabfd627c33f0141561acf5 (diff) | |
parent | dc0199989d01d6f6eb260f13a1e1305e93f36c35 (diff) |
Merge pull request #34364 from Chaosus/toggle_scripts_panel
Moves switch for show scripts panel from File menu to status bar
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 14 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.h | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 54bf8ce5a2..2f84574d25 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -987,6 +987,15 @@ Array ScriptEditor::_get_open_scripts() const { return ret; } +bool ScriptEditor::toggle_scripts_panel() { + list_split->set_visible(!list_split->is_visible()); + return list_split->is_visible(); +} + +bool ScriptEditor::is_scripts_panel_toggled() { + return list_split->is_visible(); +} + void ScriptEditor::_menu_option(int p_option) { switch (p_option) { @@ -1127,7 +1136,7 @@ void ScriptEditor::_menu_option(int p_option) { debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR), debug_with_external_editor); } break; case TOGGLE_SCRIPTS_PANEL: { - list_split->set_visible(!list_split->is_visible()); + toggle_scripts_panel(); } } @@ -3306,9 +3315,6 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { file_menu->get_popup()->add_separator(); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/run_file", TTR("Run"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_X), FILE_RUN); - - file_menu->get_popup()->add_separator(); - file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_scripts_panel", TTR("Toggle Scripts Panel"), KEY_MASK_CMD | KEY_BACKSLASH), TOGGLE_SCRIPTS_PANEL); file_menu->get_popup()->connect("id_pressed", this, "_menu_option"); script_search_menu = memnew(MenuButton); diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 294294fc56..e2fd67676b 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -419,6 +419,8 @@ protected: public: static ScriptEditor *get_singleton() { return script_editor; } + bool toggle_scripts_panel(); + bool is_scripts_panel_toggled(); void ensure_focus_current(); void apply_scripts() const; void open_script_create_dialog(const String &p_base_name, const String &p_base_path); |