mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
Chess: Automatically update and repaint when the config changes
This commit is contained in:
parent
05913b853a
commit
89d7d29d68
3 changed files with 34 additions and 1 deletions
|
@ -699,3 +699,28 @@ int ChessWidget::resign()
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ChessWidget::config_string_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value)
|
||||
{
|
||||
if (domain != "Games"sv && group != "Chess"sv)
|
||||
return;
|
||||
|
||||
if (key == "PieceSet"sv) {
|
||||
set_piece_set(value);
|
||||
update();
|
||||
} else if (key == "BoardTheme"sv) {
|
||||
set_board_theme(value);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void ChessWidget::config_bool_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, bool value)
|
||||
{
|
||||
if (domain != "Games"sv && group != "Chess"sv)
|
||||
return;
|
||||
|
||||
if (key == "ShowCoordinates"sv) {
|
||||
set_coordinates(value);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue