mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
LibGUI: Call on_segment_change handler from on_{click,focus_change}
The on_segment_change handler introduced in
a00fa793b3
was only getting called by
programmatically setting the segment, not by clicking a button or using
tab navigation.
This commit is contained in:
parent
c1c11df3b8
commit
2161f20aa6
Notes:
sideshowbarker
2024-07-17 08:02:26 +09:00
Author: https://github.com/networkException
Commit: 2161f20aa6
Pull-request: https://github.com/SerenityOS/serenity/pull/14983
1 changed files with 4 additions and 2 deletions
|
@ -84,10 +84,12 @@ void Breadcrumbbar::append_segment(String text, Gfx::Bitmap const* icon, String
|
|||
button.on_click = [this, index = m_segments.size()](auto) {
|
||||
if (on_segment_click)
|
||||
on_segment_click(index);
|
||||
if (on_segment_change && m_selected_segment != index)
|
||||
on_segment_change(index);
|
||||
};
|
||||
button.on_focus_change = [this, index = m_segments.size()](auto has_focus, auto) {
|
||||
if (has_focus && on_segment_click)
|
||||
on_segment_click(index);
|
||||
if (has_focus && on_segment_change && m_selected_segment != index)
|
||||
on_segment_change(index);
|
||||
};
|
||||
button.on_drop = [this, index = m_segments.size()](auto& drop_event) {
|
||||
if (on_segment_drop)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue