Solitaire: Use dark green for empty stack outlines

Looks nicer than using dark gray. Derived from the background color.
This commit is contained in:
Tibor Nagy 2020-03-19 22:15:49 +01:00 committed by Andreas Kling
parent e0c16d1b43
commit 809490dcb6
Notes: sideshowbarker 2024-07-19 08:13:46 +09:00

View file

@ -61,25 +61,25 @@ void CardStack::draw(GUI::Painter& painter, const Gfx::Color& background_color)
if (is_empty()) {
painter.fill_rect(m_base.shrunken(Card::width / 4, Card::height / 4), background_color.lightened(1.5));
painter.fill_rect(m_base.shrunken(Card::width / 2, Card::height / 2), background_color);
painter.draw_rect(m_base, Color::Black);
painter.draw_rect(m_base, background_color.darkened(0.5));
}
break;
case Foundation:
if (is_empty() || (m_stack.size() == 1 && peek().is_moving())) {
painter.draw_rect(m_base, Color::DarkGray);
painter.draw_rect(m_base, background_color.darkened(0.5));
for (int y = 0; y < (m_base.height() - 4) / 8; ++y) {
for (int x = 0; x < (m_base.width() - 4) / 5; ++x) {
painter.draw_rect({ 4 + m_base.x() + x * 5, 4 + m_base.y() + y * 8, 1, 1 }, Color::DarkGray);
painter.draw_rect({ 4 + m_base.x() + x * 5, 4 + m_base.y() + y * 8, 1, 1 }, background_color.darkened(0.5));
}
}
}
break;
case Waste:
if (is_empty() || (m_stack.size() == 1 && peek().is_moving()))
painter.draw_rect(m_base, Color::DarkGray);
painter.draw_rect(m_base, background_color.darkened(0.5));
break;
case Normal:
painter.draw_rect(m_base, Color::DarkGray);
painter.draw_rect(m_base, background_color.darkened(0.5));
break;
default:
ASSERT_NOT_REACHED();