diff options
author | Leandro Pereira <leandro@hardinfo.org> | 2021-04-19 23:50:31 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-20 09:24:52 +0200 |
commit | 29fd75f22f0e717dc92518d50635e4d829856d71 (patch) | |
tree | fd0a66c2082099bc33499cb38f569cc4e4ebd131 /Userland/Libraries | |
parent | 8f6a5a1c3965e09c45e60ce8640a4a5d366c8dce (diff) | |
download | serenity-29fd75f22f0e717dc92518d50635e4d829856d71.zip |
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).
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibGUI/Statusbar.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/Statusbar.cpp b/Userland/Libraries/LibGUI/Statusbar.cpp index 7164722b49..899bee92c1 100644 --- a/Userland/Libraries/LibGUI/Statusbar.cpp +++ b/Userland/Libraries/LibGUI/Statusbar.cpp @@ -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 |