mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
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:
parent
8f6a5a1c39
commit
29fd75f22f
Notes:
sideshowbarker
2024-07-18 19:21:56 +09:00
Author: https://github.com/lpereira Commit: https://github.com/SerenityOS/serenity/commit/29fd75f22f0 Pull-request: https://github.com/SerenityOS/serenity/pull/6508
1 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue