Merge pull request #113954 from KoBeWi/EnsureDialog
Scroll to selected file on sorting change
This commit is contained in:
commit
890567325e
2 changed files with 6 additions and 0 deletions
|
|
@ -1563,6 +1563,10 @@ void FileDialog::_invalidate() {
|
|||
|
||||
update_file_list();
|
||||
|
||||
if (ensure_visible_after_invalidating) {
|
||||
file_list->ensure_current_is_visible();
|
||||
ensure_visible_after_invalidating = false;
|
||||
}
|
||||
is_invalidating = false;
|
||||
}
|
||||
|
||||
|
|
@ -1676,6 +1680,7 @@ void FileDialog::_sort_option_selected(int p_option) {
|
|||
file_sort_button->get_popup()->set_item_checked(i, (i == p_option));
|
||||
}
|
||||
file_sort = FileSortOption(p_option);
|
||||
ensure_visible_after_invalidating = true;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ private:
|
|||
String full_dir;
|
||||
|
||||
bool is_invalidating = false;
|
||||
bool ensure_visible_after_invalidating = false;
|
||||
|
||||
VBoxContainer *main_vbox = nullptr;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue