LibGUI: Make statusbar label flat when displaying override_text

Changing the statusbar appearance when overriding text makes it less
confusing as it's supposed to be something temporary, e.g.  only when
hovering over a toolbar or menu item.

This behavior is present on old Windows systems, although things work
slightly differently there (where only the overridden text is displayed
rather than all the segments).
This commit is contained in:
Leandro Pereira 2021-04-19 23:50:31 -07:00 committed by Andreas Kling
parent 8f6a5a1c39
commit 29fd75f22f
Notes: sideshowbarker 2024-07-18 19:21:56 +09:00

View file

@ -93,7 +93,16 @@ void Statusbar::set_text(size_t index, String text)
void Statusbar::update_label(size_t index)
{
auto& segment = m_segments.at(index);
segment.label->set_text(segment.override_text.is_null() ? segment.text : segment.override_text);
if (segment.override_text.is_null()) {
segment.label->set_frame_shadow(Gfx::FrameShadow::Sunken);
segment.label->set_frame_shape(Gfx::FrameShape::Panel);
segment.label->set_text(segment.text);
} else {
segment.label->set_frame_shadow(Gfx::FrameShadow::Plain);
segment.label->set_frame_shape(Gfx::FrameShape::NoFrame);
segment.label->set_text(segment.override_text);
}
}
String Statusbar::text(size_t index) const