mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:37:34 +00:00
FileManager: Port to using GModelSelection
This commit is contained in:
parent
fb18613e8a
commit
9d97781e37
2 changed files with 24 additions and 2 deletions
|
@ -197,8 +197,11 @@ int main(int argc, char** argv)
|
|||
directory_view->on_path_change = [window, location_textbox, &file_system_model, tree_view, &go_forward_action, &go_back_action, directory_view](const String& new_path) {
|
||||
window->set_title(String::format("File Manager: %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);
|
||||
auto new_index = file_system_model->index(new_path);
|
||||
directory_view->for_each_view_implementation([&](auto& view) {
|
||||
view.selection().set(new_index);
|
||||
});
|
||||
tree_view->scroll_into_view(directory_view->current_view().selection().first(), Orientation::Vertical);
|
||||
tree_view->update();
|
||||
|
||||
go_forward_action->set_enabled(directory_view->path_history_position()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue