Merge pull request #33032 from Calinou/filedialog-scroll-to-top

Scroll back to the top after opening a directory in FileDialog
This commit is contained in:
Rémi Verschelde 2019-10-27 10:06:34 +01:00 committed by GitHub
commit 9e572b5bac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -703,6 +703,9 @@ void EditorFileDialog::update_file_list() {
item_list->clear(); 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) { if (display_mode == DISPLAY_THUMBNAILS) {
item_list->set_max_columns(0); item_list->set_max_columns(0);

View file

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