diff options
author | sin-ack <sin-ack@users.noreply.github.com> | 2021-07-29 20:06:46 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-07-29 22:33:34 +0100 |
commit | 667124dc22a0c81bf1718091b97c4231ff9be3d6 (patch) | |
tree | 9463db8713ba7a556309bef381ee87b7b10626f1 /Userland/Libraries/LibGUI/Label.h | |
parent | 1e44a0c2d99bfd63eb4cf46842b581c3ab14223c (diff) | |
download | serenity-667124dc22a0c81bf1718091b97c4231ff9be3d6.zip |
LibGUI: Do not wrap text in statusbar segments
This commit adds a new property to Label which allows one to enable or
disable text wrapping. Statusbar now uses this property to disable text
wrapping in its segments, since text wrapping in statusbars doesn't make
sense.
Diffstat (limited to 'Userland/Libraries/LibGUI/Label.h')
-rw-r--r-- | Userland/Libraries/LibGUI/Label.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/Label.h b/Userland/Libraries/LibGUI/Label.h index 6b2bc496e9..f0c2b8c1ab 100644 --- a/Userland/Libraries/LibGUI/Label.h +++ b/Userland/Libraries/LibGUI/Label.h @@ -8,6 +8,7 @@ #include <LibGUI/Frame.h> #include <LibGfx/TextAlignment.h> +#include <LibGfx/TextWrapping.h> namespace GUI { @@ -27,6 +28,9 @@ public: Gfx::TextAlignment text_alignment() const { return m_text_alignment; } void set_text_alignment(Gfx::TextAlignment text_alignment) { m_text_alignment = text_alignment; } + Gfx::TextWrapping text_wrapping() const { return m_text_wrapping; } + void set_text_wrapping(Gfx::TextWrapping text_wrapping) { m_text_wrapping = text_wrapping; } + bool should_stretch_icon() const { return m_should_stretch_icon; } void set_should_stretch_icon(bool b) { m_should_stretch_icon = b; } @@ -49,6 +53,7 @@ private: String m_text; RefPtr<Gfx::Bitmap> m_icon; Gfx::TextAlignment m_text_alignment { Gfx::TextAlignment::Center }; + Gfx::TextWrapping m_text_wrapping { Gfx::TextWrapping::Wrap }; bool m_should_stretch_icon { false }; bool m_autosize { false }; }; |