summaryrefslogtreecommitdiffstats
path: root/editor/plugins/script_editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-03-25 11:18:35 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-03-25 11:18:35 +0100
commitc4aa1078fbd0f6d5426d7aa4b9898a3378baaf71 (patch)
treef64902886077b231854b2d66e1479b16433e3349 /editor/plugins/script_editor_plugin.cpp
parent0e36df69f963fc965dcd781210778d3d0c3e829c (diff)
parent5cf6f3c77944e9ac953a331066755ea0c239fb1a (diff)
downloadredot-engine-c4aa1078fbd0f6d5426d7aa4b9898a3378baaf71.tar.gz
Merge pull request #88465 from AeioMuch/search_results_button
[Editor] Hide Search Results by default and show it on first search.
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
-rw-r--r--editor/plugins/script_editor_plugin.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 9121ca09b4..6f1eef62de 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1716,18 +1716,6 @@ void ScriptEditor::_notification(int p_what) {
_test_script_times_on_disk();
_update_modified_scripts_for_external_editor();
} break;
-
- case CanvasItem::NOTIFICATION_VISIBILITY_CHANGED: {
- if (is_visible()) {
- find_in_files_button->show();
- } else {
- if (find_in_files->is_visible_in_tree()) {
- EditorNode::get_bottom_panel()->hide_bottom_panel();
- }
- find_in_files_button->hide();
- }
-
- } break;
}
}
@@ -3776,6 +3764,7 @@ void ScriptEditor::_on_find_in_files_result_selected(const String &fpath, int li
ScriptTextEditor *ste = Object::cast_to<ScriptTextEditor>(_get_current_editor());
if (ste) {
+ EditorInterface::get_singleton()->set_main_screen_editor("Script");
ste->goto_line_selection(line_number, begin, end);
}
}
@@ -3790,6 +3779,7 @@ void ScriptEditor::_on_find_in_files_result_selected(const String &fpath, int li
ScriptTextEditor *ste = Object::cast_to<ScriptTextEditor>(_get_current_editor());
if (ste) {
+ EditorInterface::get_singleton()->set_main_screen_editor("Script");
ste->goto_line_selection(line_number - 1, begin, end);
}
return;
@@ -3823,6 +3813,13 @@ void ScriptEditor::_start_find_in_files(bool with_replace) {
find_in_files->set_replace_text(find_in_files_dialog->get_replace_text());
find_in_files->start_search();
+ if (find_in_files_button->get_index() != find_in_files_button->get_parent()->get_child_count()) {
+ find_in_files_button->get_parent()->move_child(find_in_files_button, -1);
+ }
+ if (!find_in_files_button->is_visible()) {
+ find_in_files_button->show();
+ }
+
EditorNode::get_bottom_panel()->make_item_visible(find_in_files);
}
@@ -3849,6 +3846,11 @@ void ScriptEditor::_set_zoom_factor(float p_zoom_factor) {
}
}
+void ScriptEditor::_on_find_in_files_close_button_clicked() {
+ EditorNode::get_bottom_panel()->hide_bottom_panel();
+ find_in_files_button->hide();
+}
+
void ScriptEditor::_window_changed(bool p_visible) {
make_floating->set_visible(!p_visible);
is_floating = p_visible;
@@ -4203,6 +4205,7 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
find_in_files->set_custom_minimum_size(Size2(0, 200) * EDSCALE);
find_in_files->connect(FindInFilesPanel::SIGNAL_RESULT_SELECTED, callable_mp(this, &ScriptEditor::_on_find_in_files_result_selected));
find_in_files->connect(FindInFilesPanel::SIGNAL_FILES_MODIFIED, callable_mp(this, &ScriptEditor::_on_find_in_files_modified_files));
+ find_in_files->connect(FindInFilesPanel::SIGNAL_CLOSE_BUTTON_CLICKED, callable_mp(this, &ScriptEditor::_on_find_in_files_close_button_clicked));
find_in_files->hide();
find_in_files_button->hide();