mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
Add a CheckBox widget.
This commit is contained in:
parent
c7463aad11
commit
16576112b0
13 changed files with 177 additions and 36 deletions
|
@ -22,9 +22,9 @@ void Button::setCaption(String&& caption)
|
|||
void Button::onPaint(PaintEvent&)
|
||||
{
|
||||
Painter painter(*this);
|
||||
painter.fillRect({ 0, 0, width(), height() }, backgroundColor());
|
||||
painter.fillRect(rect(), backgroundColor());
|
||||
if (!caption().isEmpty()) {
|
||||
painter.drawText({ 0, 0, width(), height() }, caption(), Painter::TextAlignment::Center, Color(0, 0, 0));
|
||||
painter.drawText(rect(), caption(), Painter::TextAlignment::Center, Color(0, 0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue