Scroll back to the top after opening a directory in FileDialog

This also changes the behavior in EditorFileDialog.

This closes #26041.
This commit is contained in:
Hugo Locurcio 2019-10-24 15:31:31 +02:00
parent 79dae3a87e
commit c3b9319d78
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
2 changed files with 7 additions and 0 deletions

View file

@ -703,6 +703,9 @@ void EditorFileDialog::update_file_list() {
item_list->clear();
// Scroll back to the top after opening a directory
item_list->get_v_scroll()->set_value(0);
if (display_mode == DISPLAY_THUMBNAILS) {
item_list->set_max_columns(0);

View file

@ -413,6 +413,10 @@ void FileDialog::update_file_name() {
void FileDialog::update_file_list() {
tree->clear();
// Scroll back to the top after opening a directory
tree->get_vscroll_bar()->set_value(0);
dir_access->list_dir_begin();
TreeItem *root = tree->create_item();