mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:38:10 +00:00
Label should respect background/foreground color.
This commit is contained in:
parent
1df47d3ed5
commit
b5ff34174d
2 changed files with 21 additions and 15 deletions
|
@ -22,9 +22,9 @@ void Label::setText(String&& text)
|
|||
void Label::onPaint(PaintEvent&)
|
||||
{
|
||||
Painter painter(*this);
|
||||
painter.fillRect({ 0, 0, width(), height() }, Color(0x0, 0x0, 0x0));
|
||||
painter.fillRect({ 0, 0, width(), height() }, backgroundColor());
|
||||
if (!text().isEmpty())
|
||||
painter.drawText({ 4, 4, width(), height() }, text(), Painter::TextAlignment::TopLeft, Color(0xff, 0xff, 0xff));
|
||||
painter.drawText({ 4, 4, width(), height() }, text(), Painter::TextAlignment::TopLeft, foregroundColor());
|
||||
}
|
||||
|
||||
void Label::onMouseMove(MouseEvent& event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue