mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 11:35:07 +00:00
LibGUI: Share code for text painting in GAbstractButton.
This gives all the GAbstractButton a consistent disabled appearance.
This commit is contained in:
parent
149b7f92a7
commit
c62be7bb2b
5 changed files with 31 additions and 30 deletions
|
@ -66,14 +66,7 @@ void GCheckBox::paint_event(GPaintEvent& event)
|
|||
painter.draw_bitmap(box_rect.shrunken(4, 4).location(), *s_checked_bitmap, foreground_color());
|
||||
}
|
||||
|
||||
if (!text().is_empty()) {
|
||||
painter.draw_text(text_rect, text(), TextAlignment::TopLeft, foreground_color());
|
||||
if (is_focused()) {
|
||||
Rect focus_rect = text_rect;
|
||||
focus_rect.inflate(6, 4);
|
||||
painter.draw_rect(focus_rect, Color(140, 140, 140));
|
||||
}
|
||||
}
|
||||
paint_text(painter, text_rect, font(), TextAlignment::TopLeft);
|
||||
}
|
||||
|
||||
void GCheckBox::click()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue