1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:27:46 +00:00

Chess: Automatically update and repaint when the config changes

This commit is contained in:
Sam Atkins 2023-02-01 21:33:31 +00:00 committed by Andreas Kling
parent 05913b853a
commit 89d7d29d68
3 changed files with 34 additions and 1 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2020-2022, the SerenityOS developers.
* Copyright (c) 2023, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -11,10 +12,13 @@
#include <AK/NonnullRefPtr.h>
#include <AK/Optional.h>
#include <LibChess/Chess.h>
#include <LibConfig/Listener.h>
#include <LibGUI/Frame.h>
#include <LibGfx/Bitmap.h>
class ChessWidget final : public GUI::Frame {
class ChessWidget final
: public GUI::Frame
, public Config::Listener {
C_OBJECT(ChessWidget);
public:
@ -107,6 +111,9 @@ public:
private:
ChessWidget();
virtual void config_string_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value) override;
virtual void config_bool_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, bool value) override;
Chess::Board m_board;
Chess::Board m_board_playback;
bool m_playback { false };