summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2019-12-17 11:16:17 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2019-12-17 11:19:43 +0300
commitbb7b614da15ac0634f2e1895f8ee52433c9bd584 (patch)
treed972ad0b158bfa37a400d12b01c3a88047a8c26a
parent01a62232264eae3beea6fd6afceae8a45328985f (diff)
Prevent showing toggle scripts panel switch in shader editor
-rw-r--r--editor/code_editor.cpp9
-rw-r--r--editor/code_editor.h2
-rw-r--r--editor/plugins/script_text_editor.cpp1
3 files changed, 11 insertions, 1 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 11d5e1e786..06a425bab9 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1527,7 +1527,9 @@ void CodeTextEditor::_notification(int p_what) {
emit_signal("load_theme_settings");
} break;
case NOTIFICATION_THEME_CHANGED: {
- toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->is_scripts_panel_toggled() ? get_icon("Back", "EditorIcons") : get_icon("Forward", "EditorIcons"));
+ if (toggle_scripts_button->is_visible()) {
+ toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->is_scripts_panel_toggled() ? get_icon("Back", "EditorIcons") : get_icon("Forward", "EditorIcons"));
+ }
_update_font();
} break;
case NOTIFICATION_ENTER_TREE: {
@@ -1643,6 +1645,10 @@ void CodeTextEditor::set_code_complete_func(CodeTextEditorCodeCompleteFunc p_cod
code_complete_ud = p_ud;
}
+void CodeTextEditor::show_toggle_scripts_button() {
+ toggle_scripts_button->show();
+}
+
CodeTextEditor::CodeTextEditor() {
code_complete_func = NULL;
@@ -1688,6 +1694,7 @@ CodeTextEditor::CodeTextEditor() {
toggle_scripts_button->connect("pressed", this, "_toggle_scripts_pressed");
status_bar->add_child(toggle_scripts_button);
toggle_scripts_button->set_shortcut(ED_SHORTCUT("script_editor/toggle_scripts_panel", TTR("Toggle Scripts Panel"), KEY_MASK_CMD | KEY_BACKSLASH));
+ toggle_scripts_button->hide();
// Error
ScrollContainer *scroll = memnew(ScrollContainer);
diff --git a/editor/code_editor.h b/editor/code_editor.h
index edab7d56b2..6d85f353f9 100644
--- a/editor/code_editor.h
+++ b/editor/code_editor.h
@@ -255,6 +255,8 @@ public:
void validate_script();
+ void show_toggle_scripts_button();
+
CodeTextEditor();
};
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 2e41801637..9bda0f50e4 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1760,6 +1760,7 @@ ScriptTextEditor::ScriptTextEditor() {
code_editor->get_text_edit()->connect("symbol_lookup", this, "_lookup_symbol");
code_editor->get_text_edit()->connect("info_clicked", this, "_lookup_connections");
code_editor->set_v_size_flags(SIZE_EXPAND_FILL);
+ code_editor->show_toggle_scripts_button();
warnings_panel = memnew(RichTextLabel);
editor_box->add_child(warnings_panel);