mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 17:19:13 +00:00
Add a CheckBox widget.
This commit is contained in:
parent
c7463aad11
commit
16576112b0
Notes:
sideshowbarker
2024-07-19 18:50:09 +09:00
Author: https://github.com/awesomekling
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