You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Merge pull request #88465 from AeioMuch/search_results_button
[Editor] Hide Search Results by default and show it on first search.
This commit is contained in:
@@ -566,6 +566,7 @@ void FindInFilesDialog::_bind_methods() {
|
||||
//-----------------------------------------------------------------------------
|
||||
const char *FindInFilesPanel::SIGNAL_RESULT_SELECTED = "result_selected";
|
||||
const char *FindInFilesPanel::SIGNAL_FILES_MODIFIED = "files_modified";
|
||||
const char *FindInFilesPanel::SIGNAL_CLOSE_BUTTON_CLICKED = "close_button_clicked";
|
||||
|
||||
FindInFilesPanel::FindInFilesPanel() {
|
||||
_finder = memnew(FindInFiles);
|
||||
@@ -611,6 +612,11 @@ FindInFilesPanel::FindInFilesPanel() {
|
||||
_cancel_button->hide();
|
||||
hbc->add_child(_cancel_button);
|
||||
|
||||
_close_button = memnew(Button);
|
||||
_close_button->set_text(TTR("Close"));
|
||||
_close_button->connect("pressed", callable_mp(this, &FindInFilesPanel::_on_close_button_clicked));
|
||||
hbc->add_child(_close_button);
|
||||
|
||||
vbc->add_child(hbc);
|
||||
}
|
||||
|
||||
@@ -843,6 +849,10 @@ void FindInFilesPanel::_on_cancel_button_clicked() {
|
||||
stop_search();
|
||||
}
|
||||
|
||||
void FindInFilesPanel::_on_close_button_clicked() {
|
||||
emit_signal(SNAME(SIGNAL_CLOSE_BUTTON_CLICKED));
|
||||
}
|
||||
|
||||
void FindInFilesPanel::_on_result_selected() {
|
||||
TreeItem *item = _results_display->get_selected();
|
||||
HashMap<TreeItem *, Result>::Iterator E = _result_items.find(item);
|
||||
@@ -1010,4 +1020,6 @@ void FindInFilesPanel::_bind_methods() {
|
||||
PropertyInfo(Variant::INT, "end")));
|
||||
|
||||
ADD_SIGNAL(MethodInfo(SIGNAL_FILES_MODIFIED, PropertyInfo(Variant::STRING, "paths")));
|
||||
|
||||
ADD_SIGNAL(MethodInfo(SIGNAL_CLOSE_BUTTON_CLICKED));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user