summaryrefslogtreecommitdiff
path: root/Games/Chess/ChessWidget.h
diff options
context:
space:
mode:
authorPeter Elliott <pelliott@ualberta.ca>2020-08-11 18:59:32 -0600
committerAndreas Kling <kling@serenityos.org>2020-08-15 20:54:02 +0200
commite91542a3cf863d4f9dc1714e774cda52506aad41 (patch)
tree05cfd500f02410cb1d655c4a2f283e166fb1b858 /Games/Chess/ChessWidget.h
parent7b71f4759f94df15af9cd8cd1fc65f94076352c9 (diff)
downloadserenity-e91542a3cf863d4f9dc1714e774cda52506aad41.zip
Chess: Add menu options for setting board theme and piece set
Diffstat (limited to 'Games/Chess/ChessWidget.h')
-rw-r--r--Games/Chess/ChessWidget.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/Games/Chess/ChessWidget.h b/Games/Chess/ChessWidget.h
index e4e77c0991..51608d0061 100644
--- a/Games/Chess/ChessWidget.h
+++ b/Games/Chess/ChessWidget.h
@@ -60,10 +60,21 @@ public:
bool drag_enabled() const { return m_drag_enabled; }
void set_drag_enabled(bool e) { m_drag_enabled = e; }
+ void reset();
+
+ struct BoardTheme {
+ String name;
+ Color dark_square_color;
+ Color light_square_color;
+ };
+
+ const BoardTheme& board_theme() const { return m_board_theme; }
+ void set_board_theme(const BoardTheme& theme) { m_board_theme = theme; }
+ void set_board_theme(const StringView& name);
+
private:
Chess m_board;
- Color m_dark_square_color { Color::from_rgb(0xb58863) };
- Color m_light_square_color { Color::from_rgb(0xf0d9b5) };
+ BoardTheme m_board_theme { "Beige", Color::from_rgb(0xb58863), Color::from_rgb(0xf0d9b5) };
Color m_move_highlight_color { Color::from_rgba(0x66ccee00) };
Chess::Colour m_side { Chess::Colour::White };
HashMap<Chess::Piece, RefPtr<Gfx::Bitmap>> m_pieces;