1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

LibGUI: Simulate a click on arrow key events for AbstractButtons

in exclusive, checkable groups. Instead of merely setting the
button checked, call click() so buttons with registered actions
can activate. Fixes ActionGroups like FileManager's view type
checkables not activating when cycled with the keyboard.
This commit is contained in:
thankyouverycool 2022-09-04 10:18:19 -04:00 committed by Linus Groh
parent ab29f8976d
commit 0fc1925cd7

View file

@ -213,7 +213,7 @@ void AbstractButton::keydown_event(KeyEvent& event)
new_checked_index = this_index == 0 ? exclusive_siblings.size() - 1 : this_index - 1;
else
new_checked_index = this_index == exclusive_siblings.size() - 1 ? 0 : this_index + 1;
exclusive_siblings[new_checked_index].set_checked(true);
exclusive_siblings[new_checked_index].click();
return;
}
Widget::keydown_event(event);