Browse Source

Ability to toggle script panel visibility

Jakub Grzesik 8 years ago
parent
commit
98897d0415
2 changed files with 6 additions and 0 deletions
  1. 5 0
      editor/plugins/script_editor_plugin.cpp
  2. 1 0
      editor/plugins/script_editor_plugin.h

+ 5 - 0
editor/plugins/script_editor_plugin.cpp

@@ -876,6 +876,9 @@ void ScriptEditor::_menu_option(int p_option) {
 			bool debug_with_external_editor = !debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR));
 			debugger->set_debug_with_external_editor(debug_with_external_editor);
 			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());
 		}
 	}
 
@@ -2235,6 +2238,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
 	file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS);
 	file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD | KEY_W), FILE_CLOSE);
 	file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_all", TTR("Close All")), CLOSE_ALL);
+	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);

+ 1 - 0
editor/plugins/script_editor_plugin.h

@@ -134,6 +134,7 @@ class ScriptEditor : public VBoxContainer {
 		FILE_CLOSE,
 		CLOSE_DOCS,
 		CLOSE_ALL,
+		TOGGLE_SCRIPTS_PANEL,
 		FILE_TOOL_RELOAD,
 		FILE_TOOL_RELOAD_SOFT,
 		DEBUG_NEXT,