mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 04:08:08 +00:00
LibGUI: Elide the text in GCheckBox and GRadioButton when low on space.
This commit is contained in:
@@ -49,7 +49,11 @@ void GButton::paint_event(GPaintEvent& event)
|
||||
content_rect.set_width(content_rect.width() - m_icon->width() - 4);
|
||||
}
|
||||
|
||||
paint_text(painter, content_rect, font, text_alignment());
|
||||
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());
|
||||
}
|
||||
|
||||
void GButton::click()
|
||||
|
||||
Reference in New Issue
Block a user