Skip to content

Commit

Permalink
Prevent showing toggle scripts panel switch in shader editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaosus authored and yaelatletl committed Dec 24, 2019
1 parent 0c584a7 commit 8b9bb80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions editor/code_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -1650,10 +1652,6 @@ void CodeTextEditor::show_toggle_scripts_button() {
toggle_scripts_button->show();
}

void CodeTextEditor::update_toggle_scripts_button() {
toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->is_scripts_panel_toggled() ? get_icon("Back", "EditorIcons") : get_icon("Forward", "EditorIcons"));
}

CodeTextEditor::CodeTextEditor() {

code_complete_func = NULL;
Expand Down Expand Up @@ -1699,6 +1697,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);
Expand Down
1 change: 0 additions & 1 deletion editor/code_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ class CodeTextEditor : public VBoxContainer {
void validate_script();

void show_toggle_scripts_button();
void update_toggle_scripts_button();

CodeTextEditor();
};
Expand Down

0 comments on commit 8b9bb80

Please sign in to comment.