From 8ccd6a31dca975516457ac9107285c3fbcf4d3b5 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 12 Jan 2023 15:15:45 -0500 Subject: [PATCH] GamesSettings: Draw one of the previewed cards as "highlighted" And draw a valid "moving" card over it to indicate that it is highlighted for a reason. --- .../Applications/GamesSettings/CardSettingsWidget.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/GamesSettings/CardSettingsWidget.cpp b/Userland/Applications/GamesSettings/CardSettingsWidget.cpp index 80d23ad2b2f..7018af22884 100644 --- a/Userland/Applications/GamesSettings/CardSettingsWidget.cpp +++ b/Userland/Applications/GamesSettings/CardSettingsWidget.cpp @@ -26,7 +26,7 @@ public: { auto preview = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) Preview())); - Gfx::IntPoint point { 30, 30 }; + Gfx::IntPoint point { 25, 30 }; TRY(preview->add_stack(point, Cards::CardStack::Type::Stock)); point.translate_by(Cards::Card::width + 30, 0); @@ -35,12 +35,18 @@ public: point.translate_by(Cards::Card::width + 30, 0); TRY(preview->add_stack(point, Cards::CardStack::Type::Normal)); + point.translate_by(20, 10); + TRY(preview->add_stack(point, Cards::CardStack::Type::Normal)); + for (size_t i = 0; i < Cards::Card::card_count; ++i) preview->stack_at_location(0).push(TRY(Cards::Card::try_create(Cards::Suit::Diamonds, static_cast(i)))); preview->stack_at_location(1).push(TRY(Cards::Card::try_create(Cards::Suit::Spades, Cards::Rank::Ace))); preview->stack_at_location(2).push(TRY(Cards::Card::try_create(Cards::Suit::Hearts, Cards::Rank::Queen))); + preview->stack_at_location(3).push(TRY(Cards::Card::try_create(Cards::Suit::Clubs, Cards::Rank::Jack))); preview->stack_at_location(0).peek().set_upside_down(true); + preview->stack_at_location(2).set_highlighted(true); + return preview; }