mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 10:05:10 +00:00
LibGUI+FileManager: Add GAbstractView::on_selection_change hook
This hook will be called whenever the view's selection changes somehow. Use this in the FileManager to keep the left and right views in sync.
This commit is contained in:
parent
9d97781e37
commit
6dec328af7
3 changed files with 6 additions and 2 deletions
|
@ -77,8 +77,8 @@ int main(int argc, char** argv)
|
|||
directory_view->open(location_textbox->text());
|
||||
};
|
||||
|
||||
file_system_model->on_selection_changed = [&](auto& index) {
|
||||
auto path = file_system_model->path(index);
|
||||
tree_view->on_selection_change = [&] {
|
||||
auto path = file_system_model->path(tree_view->selection().first());
|
||||
if (directory_view->path() == path)
|
||||
return;
|
||||
directory_view->open(path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue