1
Fork 0
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:
Andreas Kling 2018-10-12 14:15:14 +02:00
parent c7463aad11
commit 16576112b0
13 changed files with 177 additions and 36 deletions

View file

@ -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));
}
}