summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@hardinfo.org>2021-04-19 23:50:31 -0700
committerAndreas Kling <kling@serenityos.org>2021-04-20 09:24:52 +0200
commit29fd75f22f0e717dc92518d50635e4d829856d71 (patch)
treefd0a66c2082099bc33499cb38f569cc4e4ebd131 /Userland/Libraries
parent8f6a5a1c3965e09c45e60ce8640a4a5d366c8dce (diff)
downloadserenity-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.cpp11
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