diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-01-05 10:16:16 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-01-06 12:02:10 +0100 |
commit | 4cbdc747abbef74a3de8b05428fa5c0ca0dd09ba (patch) | |
tree | 47353fcaf7e5fc1bd8bd8d40b41cd480a503730a /Userland/Libraries/LibCards/Card.h | |
parent | 8d8fcd0d648d3b851283d1122f6294ca80181c92 (diff) | |
download | serenity-4cbdc747abbef74a3de8b05428fa5c0ca0dd09ba.zip |
LibCards+Solitaire: Elevate card highlight management to the card stack
Instead of indicating which individual cards should be highlighted, card
games now indicate which stack is highlighted. This lets the stack draw
empty stacks with a highlight (e.g. the Foundation stack in Solitaire).
If the stack is non-empty, the stack can delegate highlighting to the
top-most card.
Diffstat (limited to 'Userland/Libraries/LibCards/Card.h')
-rw-r--r-- | Userland/Libraries/LibCards/Card.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Userland/Libraries/LibCards/Card.h b/Userland/Libraries/LibCards/Card.h index 5cfd9d53cc..72101ff0af 100644 --- a/Userland/Libraries/LibCards/Card.h +++ b/Userland/Libraries/LibCards/Card.h @@ -104,13 +104,12 @@ public: void set_moving(bool moving) { m_moving = moving; } void set_upside_down(bool upside_down) { m_upside_down = upside_down; } void set_inverted(bool inverted) { m_inverted = inverted; } - void set_highlighted(bool highlighted) { m_highlighted = highlighted; } void save_old_position(); - void paint(GUI::Painter&) const; + void paint(GUI::Painter&, bool highlighted = false) const; void clear(GUI::Painter&, Color background_color) const; - void clear_and_paint(GUI::Painter& painter, Color background_color); + void clear_and_paint(GUI::Painter& painter, Color background_color, bool highlighted); private: Card(Suit, Rank); @@ -123,7 +122,6 @@ private: bool m_moving { false }; bool m_upside_down { false }; bool m_inverted { false }; - bool m_highlighted { false }; }; enum class Shuffle { |