summaryrefslogtreecommitdiff
path: root/Applications/FileManager
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-30 03:27:25 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-30 03:27:25 +0100
commit2c6a597d7767d38fc5c8e743dd57f13733c1287f (patch)
tree81a62b8d43b7f8be8b580bd82605e8cefebbfc8f /Applications/FileManager
parentf10e0d054612eef415ce96a0e2383910d39668c0 (diff)
downloadserenity-2c6a597d7767d38fc5c8e743dd57f13733c1287f.zip
FileManager: Make the tree view follow the directory view navigations.
Diffstat (limited to 'Applications/FileManager')
-rw-r--r--Applications/FileManager/main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp
index 708a6c9aec..1b8ba22f1e 100644
--- a/Applications/FileManager/main.cpp
+++ b/Applications/FileManager/main.cpp
@@ -166,9 +166,12 @@ int main(int argc, char** argv)
main_toolbar->add_action(view_as_icons_action.copy_ref());
main_toolbar->add_action(view_as_table_action.copy_ref());
- directory_view->on_path_change = [window, location_textbox] (const String& new_path) {
+ directory_view->on_path_change = [window, location_textbox, &file_system_model, tree_view] (const String& new_path) {
window->set_title(String::format("FileManager: %s", new_path.characters()));
location_textbox->set_text(new_path);
+ file_system_model->set_selected_index(file_system_model->index(new_path));
+ tree_view->scroll_into_view(file_system_model->selected_index(), Orientation::Vertical);
+ tree_view->update();
};
directory_view->on_status_message = [statusbar] (String message) {