mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:37:46 +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
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