mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:38:11 +00:00
FileManager: Add on_selection event for DirectoryView
There needs to be a way to know when a user has selected a file. file_system_model->on_selection_changed only fires on directory change.
This commit is contained in:
parent
8920ece8f6
commit
b894803a30
2 changed files with 10 additions and 0 deletions
|
@ -92,6 +92,15 @@ DirectoryView::DirectoryView(GWidget* parent)
|
|||
handle_activation(filter_model.map_to_target(index));
|
||||
};
|
||||
|
||||
m_table_view->on_selection = [this](const GModelIndex&) {
|
||||
if (on_selection)
|
||||
on_selection(*m_table_view);
|
||||
};
|
||||
m_item_view->on_selection = [this](const GModelIndex&) {
|
||||
if (on_selection)
|
||||
on_selection(*m_item_view);
|
||||
};
|
||||
|
||||
set_view_mode(ViewMode::Icon);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue