mirror of
https://github.com/RGBCube/serenity
synced 2025-05-24 00:15:07 +00:00
Some color cleanup.
This commit is contained in:
parent
aceedaf957
commit
e16d145cb4
9 changed files with 27 additions and 22 deletions
|
@ -21,22 +21,21 @@ void Button::setCaption(String&& caption)
|
|||
|
||||
void Button::onPaint(PaintEvent&)
|
||||
{
|
||||
Color buttonColor(192, 192, 192);
|
||||
Color highlightColor(255, 255, 255);
|
||||
Color shadowColor(96, 96, 96);
|
||||
Color buttonColor = Color::LightGray;
|
||||
Color highlightColor = Color::White;
|
||||
Color shadowColor = Color(96, 96, 96);
|
||||
|
||||
Painter painter(*this);
|
||||
painter.fillRect(rect(), Color(255, 0, 255));
|
||||
|
||||
painter.drawPixel({ 0, 0 }, backgroundColor());
|
||||
painter.drawPixel({ width() - 1, 0 }, backgroundColor());
|
||||
painter.drawPixel({ 0, height() - 1 }, backgroundColor());
|
||||
painter.drawPixel({ width() - 1, height() - 1 }, backgroundColor());
|
||||
|
||||
painter.drawLine({ 1, 0 }, { width() - 2, 0 }, Color(0, 0, 0));
|
||||
painter.drawLine({ 1, height() - 1 }, { width() - 2, height() - 1}, Color(0, 0, 0));
|
||||
painter.drawLine({ 0, 1 }, { 0, height() - 2 }, Color(0, 0, 0));
|
||||
painter.drawLine({ width() - 1, 1 }, { width() - 1, height() - 2 }, Color(0, 0, 0));
|
||||
painter.drawLine({ 1, 0 }, { width() - 2, 0 }, Color::Black);
|
||||
painter.drawLine({ 1, height() - 1 }, { width() - 2, height() - 1}, Color::Black);
|
||||
painter.drawLine({ 0, 1 }, { 0, height() - 2 }, Color::Black);
|
||||
painter.drawLine({ width() - 1, 1 }, { width() - 1, height() - 2 }, Color::Black);
|
||||
|
||||
if (m_beingPressed) {
|
||||
// Base
|
||||
|
@ -66,7 +65,7 @@ void Button::onPaint(PaintEvent&)
|
|||
auto textRect = rect();
|
||||
if (m_beingPressed)
|
||||
textRect.moveBy(1, 1);
|
||||
painter.drawText(textRect, caption(), Painter::TextAlignment::Center, Color(0, 0, 0));
|
||||
painter.drawText(textRect, caption(), Painter::TextAlignment::Center, Color::Black);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue