1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-12 02:30:30 +09:00

LibGUI: Add GAbstractView::activate_selected()

This is a nice little utility to activate all the selected items,
which is what you usually want to do.
This commit is contained in:
Sergey Bugaev 2020-01-10 18:50:26 +03:00 committed by Andreas Kling
parent caa08938e5
commit 0f18a16e2c
Notes: sideshowbarker 2024-07-19 10:13:34 +09:00
5 changed files with 21 additions and 24 deletions

View file

@ -113,6 +113,16 @@ void GAbstractView::activate(const GModelIndex& index)
on_activation(index);
}
void GAbstractView::activate_selected()
{
if (!on_activation)
return;
selection().for_each_index([this](auto& index) {
on_activation(index);
});
}
void GAbstractView::notify_selection_changed(Badge<GModelSelection>)
{
did_update_selection();