diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-05-25 20:15:52 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-25 20:15:52 +0200 |
commit | cca510162ed3c1f720f0d2ef11849ab755d25484 (patch) | |
tree | a01893799a23f50c5218a0ca06518926885a74de /LibGUI | |
parent | 75b0e5cce50b1cf126ea83f1de78fe1a03c5d425 (diff) | |
download | serenity-cca510162ed3c1f720f0d2ef11849ab755d25484.zip |
GButton: Align the button text according to text_alignment().
Added a Rect::align_within(other_rect, alignment) helper that seemed useful.
Diffstat (limited to 'LibGUI')
-rw-r--r-- | LibGUI/GButton.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/LibGUI/GButton.cpp b/LibGUI/GButton.cpp index 7cafa76f1a..62e521702d 100644 --- a/LibGUI/GButton.cpp +++ b/LibGUI/GButton.cpp @@ -52,8 +52,8 @@ void GButton::paint_event(GPaintEvent& event) Rect text_rect { 0, 0, font.width(text()), font.glyph_height() }; if (text_rect.width() > content_rect.width()) text_rect.set_width(content_rect.width()); - text_rect.center_within(content_rect); - paint_text(painter, text_rect, font, text_alignment()); + text_rect.align_within(content_rect, text_alignment()); + paint_text(painter, text_rect, font, TextAlignment::Center); } void GButton::click() |