diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-10-24 15:31:31 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-10-24 15:40:47 +0200 |
commit | c3b9319d78a92d028a73e49e1ebaf01b9fb45883 (patch) | |
tree | 5fc7a503d1c1cea713a31e40421c3f7446dd71d7 /scene/gui/file_dialog.cpp | |
parent | 79dae3a87e1c8a66897fc1816059f39c8f25cde4 (diff) | |
download | redot-engine-c3b9319d78a92d028a73e49e1ebaf01b9fb45883.tar.gz |
Scroll back to the top after opening a directory in FileDialog
This also changes the behavior in EditorFileDialog.
This closes #26041.
Diffstat (limited to 'scene/gui/file_dialog.cpp')
-rw-r--r-- | scene/gui/file_dialog.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 5cb4bcc64f..08e943fa8c 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -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(); |