summaryrefslogtreecommitdiffstats
path: root/editor/code_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r--editor/code_editor.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 180c25c34f..dd8aa523c4 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -755,13 +755,13 @@ FindReplaceBar::FindReplaceBar() {
hbc_option_search->add_child(case_sensitive);
case_sensitive->set_text(TTR("Match Case"));
case_sensitive->set_focus_mode(FOCUS_NONE);
- case_sensitive->connect("toggled", callable_mp(this, &FindReplaceBar::_search_options_changed));
+ case_sensitive->connect(SceneStringName(toggled), callable_mp(this, &FindReplaceBar::_search_options_changed));
whole_words = memnew(CheckBox);
hbc_option_search->add_child(whole_words);
whole_words->set_text(TTR("Whole Words"));
whole_words->set_focus_mode(FOCUS_NONE);
- whole_words->connect("toggled", callable_mp(this, &FindReplaceBar::_search_options_changed));
+ whole_words->connect(SceneStringName(toggled), callable_mp(this, &FindReplaceBar::_search_options_changed));
// Replace toolbar
replace_text = memnew(LineEdit);
@@ -786,7 +786,7 @@ FindReplaceBar::FindReplaceBar() {
hbc_option_replace->add_child(selection_only);
selection_only->set_text(TTR("Selection Only"));
selection_only->set_focus_mode(FOCUS_NONE);
- selection_only->connect("toggled", callable_mp(this, &FindReplaceBar::_search_options_changed));
+ selection_only->connect(SceneStringName(toggled), callable_mp(this, &FindReplaceBar::_search_options_changed));
hide_button = memnew(TextureButton);
add_child(hide_button);
@@ -1548,7 +1548,8 @@ void CodeTextEditor::_set_show_warnings_panel(bool p_show) {
}
void CodeTextEditor::_toggle_scripts_pressed() {
- ScriptEditor::get_singleton()->toggle_scripts_panel();
+ ERR_FAIL_NULL(toggle_scripts_list);
+ toggle_scripts_list->set_visible(!toggle_scripts_list->is_visible());
update_toggle_scripts_button();
}
@@ -1723,16 +1724,18 @@ void CodeTextEditor::set_code_complete_func(CodeTextEditorCodeCompleteFunc p_cod
code_complete_ud = p_ud;
}
+void CodeTextEditor::set_toggle_list_control(Control *p_control) {
+ toggle_scripts_list = p_control;
+}
+
void CodeTextEditor::show_toggle_scripts_button() {
toggle_scripts_button->show();
}
void CodeTextEditor::update_toggle_scripts_button() {
- if (is_layout_rtl()) {
- toggle_scripts_button->set_icon(get_editor_theme_icon(ScriptEditor::get_singleton()->is_scripts_panel_toggled() ? SNAME("Forward") : SNAME("Back")));
- } else {
- toggle_scripts_button->set_icon(get_editor_theme_icon(ScriptEditor::get_singleton()->is_scripts_panel_toggled() ? SNAME("Back") : SNAME("Forward")));
- }
+ ERR_FAIL_NULL(toggle_scripts_list);
+ bool forward = toggle_scripts_list->is_visible() == is_layout_rtl();
+ toggle_scripts_button->set_icon(get_editor_theme_icon(forward ? SNAME("Forward") : SNAME("Back")));
toggle_scripts_button->set_tooltip_text(vformat("%s (%s)", TTR("Toggle Scripts Panel"), ED_GET_SHORTCUT("script_editor/toggle_scripts_panel")->get_as_text()));
}