mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
LibGUI: Add optional "tab key navigation" to AbstractView
If enabled, the view cursor will move right/left when pressing tab/shift+tab.
This commit is contained in:
parent
cd930e0f3d
commit
6316525d50
Notes:
sideshowbarker
2024-07-19 03:03:34 +09:00
Author: https://github.com/awesomekling
Commit: 6316525d50
2 changed files with 17 additions and 0 deletions
|
@ -378,6 +378,19 @@ void AbstractTableView::keydown_event(KeyEvent& event)
|
|||
selection_update = SelectionUpdate::Shift;
|
||||
}
|
||||
|
||||
if (is_tab_key_navigation_enabled()) {
|
||||
if (event.modifiers() == KeyModifier::Mod_Shift && event.key() == KeyCode::Key_Tab) {
|
||||
move_cursor(CursorMovement::Left, SelectionUpdate::Set);
|
||||
event.accept();
|
||||
return;
|
||||
}
|
||||
if (!event.modifiers() && event.key() == KeyCode::Key_Tab) {
|
||||
move_cursor(CursorMovement::Right, SelectionUpdate::Set);
|
||||
event.accept();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (event.key() == KeyCode::Key_Left) {
|
||||
move_cursor(CursorMovement::Left, selection_update);
|
||||
event.accept();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue