diff options
author | Andreas Kling <kling@serenityos.org> | 2020-09-18 18:38:46 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-18 21:29:01 +0200 |
commit | eb24603da0fc9de3b2692f78f7229fd1eda470cc (patch) | |
tree | bb2c1447e35be8433dcffc481063e3fc1125eb61 /Applications/FileManager | |
parent | 3bccd99fe969ae0db3867cee0fb762d11171c5b8 (diff) | |
download | serenity-eb24603da0fc9de3b2692f78f7229fd1eda470cc.zip |
FileManager: Properly reveal newly opened directories in the treeview
Use the new TreeView::expand_all_parent_of() API to ensure that newly
opened directories are revealed and scrolled-into-view in the left-side
treeview. :^)
Diffstat (limited to 'Applications/FileManager')
-rw-r--r-- | Applications/FileManager/main.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index 7f09d0cb00..f2812d27ee 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -523,9 +523,8 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio location_textbox.set_text(new_path); auto new_index = directories_model->index(new_path, GUI::FileSystemModel::Column::Name); if (new_index.is_valid()) { - tree_view.selection().set(new_index); - tree_view.scroll_into_view(new_index, false, true); - tree_view.update(); + tree_view.expand_all_parents_of(new_index); + tree_view.set_cursor(new_index, GUI::AbstractView::SelectionUpdate::Set); } struct stat st; |