summaryrefslogtreecommitdiff
path: root/LibGUI
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-05-25 20:15:52 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-25 20:15:52 +0200
commitcca510162ed3c1f720f0d2ef11849ab755d25484 (patch)
treea01893799a23f50c5218a0ca06518926885a74de /LibGUI
parent75b0e5cce50b1cf126ea83f1de78fe1a03c5d425 (diff)
downloadserenity-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.cpp4
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()