mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 22:52:22 +02: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:
committed by
Andreas Kling
parent
caa08938e5
commit
0f18a16e2c
Notes:
sideshowbarker
2024-07-19 10:13:34 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/0f18a16e2c8 Pull-request: https://github.com/SerenityOS/serenity/pull/1050
@@ -383,9 +383,7 @@ void GAbstractColumnView::keydown_event(GKeyEvent& event)
|
||||
return;
|
||||
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_Up) {
|
||||
@@ -457,13 +455,10 @@ void GAbstractColumnView::doubleclick_event(GMouseEvent& event)
|
||||
if (event.y() < header_height())
|
||||
return;
|
||||
if (!selection().is_empty()) {
|
||||
if (is_editable()) {
|
||||
if (is_editable())
|
||||
begin_editing(selection().first());
|
||||
} else {
|
||||
selection().for_each_index([this](auto& index) {
|
||||
activate(index);
|
||||
});
|
||||
}
|
||||
else
|
||||
activate_selected();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user