mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibGUI: Move keyboard item activation up to AbstractView
All views want the same behavior, so move this to the base class. :^)
This commit is contained in:
parent
d8553a6406
commit
d3adbed231
Notes:
sideshowbarker
2024-07-19 02:15:11 +09:00
Author: https://github.com/awesomekling
Commit: d3adbed231
8 changed files with 9 additions and 40 deletions
|
@ -461,6 +461,12 @@ void AbstractView::keydown_event(KeyEvent& event)
|
|||
}
|
||||
}
|
||||
|
||||
if (event.key() == KeyCode::Key_Return) {
|
||||
activate_selected();
|
||||
event.accept();
|
||||
return;
|
||||
}
|
||||
|
||||
SelectionUpdate selection_update = SelectionUpdate::Set;
|
||||
if (event.modifiers() == KeyModifier::Mod_Shift) {
|
||||
selection_update = SelectionUpdate::Shift;
|
||||
|
@ -506,6 +512,8 @@ void AbstractView::keydown_event(KeyEvent& event)
|
|||
event.accept();
|
||||
return;
|
||||
}
|
||||
|
||||
Widget::keydown_event(event);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue