From c3b9319d78a92d028a73e49e1ebaf01b9fb45883 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 24 Oct 2019 15:31:31 +0200 Subject: Scroll back to the top after opening a directory in FileDialog This also changes the behavior in EditorFileDialog. This closes #26041. --- scene/gui/file_dialog.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scene/gui/file_dialog.cpp') 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(); -- cgit v1.2.3