mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 11:45:07 +00: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:
parent
caa08938e5
commit
0f18a16e2c
5 changed files with 21 additions and 24 deletions
|
@ -258,9 +258,7 @@ void GItemView::doubleclick_event(GMouseEvent& event)
|
|||
return;
|
||||
if (event.button() == GMouseButton::Left) {
|
||||
mousedown_event(event);
|
||||
selection().for_each_index([this](auto& index) {
|
||||
activate(index);
|
||||
});
|
||||
activate_selected();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -352,9 +350,7 @@ void GItemView::keydown_event(GKeyEvent& event)
|
|||
|
||||
auto& model = *this->model();
|
||||
if (event.key() == KeyCode::Key_Return) {
|
||||
selection().for_each_index([this](auto& index) {
|
||||
activate(index);
|
||||
});
|
||||
activate_selected();
|
||||
return;
|
||||
}
|
||||
if (event.key() == KeyCode::Key_Home) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue