mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
LibGUI: Allow breadcrumbbar segment activation using the keyboard
We now interpret a breadcrumbbar segment gaining focus just as clicking on the segment, allowing keyboard navigation using the arrow keys.
This commit is contained in:
parent
daf2ebca3b
commit
4dc23c9b24
Notes:
sideshowbarker
2024-07-17 18:56:29 +09:00
Author: https://github.com/networkException
Commit: 4dc23c9b24
Pull-request: https://github.com/SerenityOS/serenity/pull/12480
1 changed files with 4 additions and 0 deletions
|
@ -87,6 +87,10 @@ void Breadcrumbbar::append_segment(String text, Gfx::Bitmap const* icon, String
|
||||||
if (on_segment_click)
|
if (on_segment_click)
|
||||||
on_segment_click(index);
|
on_segment_click(index);
|
||||||
};
|
};
|
||||||
|
button.on_focus_change = [this, index = m_segments.size()](auto has_focus, auto) {
|
||||||
|
if (has_focus && on_segment_click)
|
||||||
|
on_segment_click(index);
|
||||||
|
};
|
||||||
button.on_drop = [this, index = m_segments.size()](auto& drop_event) {
|
button.on_drop = [this, index = m_segments.size()](auto& drop_event) {
|
||||||
if (on_segment_drop)
|
if (on_segment_drop)
|
||||||
on_segment_drop(index, drop_event);
|
on_segment_drop(index, drop_event);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue