Public repository: timo / schach

Reader

Ein aufgeräumtes Schach-Programm für GNOME

feat(prefs): switch to hide glyphs right after a move

public

feat(prefs): switch to hide glyphs right after a move

Florian got startled by a red ?? on the board. Off: glyphs stay in the
move list and analysis; puzzles keep their ? since it is the answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changeset6bed763d4d38cca23cb7d8f19ccb353b656a669a
Author (claimed)Timo Stolz <timo.stolz@nullachtvierzehn.de>,
Parentsdbcddca5f6c7
Childreneb6ed136b458
Pushlog
by timo via ssh
by timo via ssh

modified schach/app.py +6 −1

@@ -76,6 +76,7 @@ DEFAULTS = {
7676
     "elo": 1200, "color": "white", "theme": "cburnett", "puzzle_difficulty": "normal",
7777
     "temperature": OPPONENT_TEMPERATURE, "scheme": "holz", "hint_helper": DEFAULT_HELPER,
7878
     "threat_source": "opponent", "notation": notation.DEFAULT, "time_control": "Ohne Uhr",
79
+    "live_glyphs": True,
7980
 }
8081
 
8182
 
@@ -562,7 +563,9 @@ class Window(OnlineMixin, PuzzleMixin, O
562563
         v.turn_marker = self.board.turn if self.mode == "duo" and not self._over() else None
563564
         if self.mode == "duo":
564565
             v.badge = self._duo_badge()
565
-        elif self.badge_ply is not None and self.badge_ply in self.symbols:
566
+        elif self.badge_ply is not None and self.badge_ply in self.symbols and (
567
+            self.mode == "puzzle" or self.settings.get("live_glyphs", True)  # Rätsel: das ? ist die Antwort
568
+        ):
566569
             if self.badge_ply < len(self.board.move_stack):
567570
                 mv = self.board.move_stack[self.badge_ply]
568571
                 piece = self.board.piece_at(mv.to_square)
@@ -1434,6 +1437,8 @@ class Window(OnlineMixin, PuzzleMixin, O
14341437
         elif key == "notation":
14351438
             self.movelist.notation = self._notation()
14361439
             self._refresh()
1440
+        elif key == "live_glyphs":
1441
+            self._refresh()
14371442
 
14381443
     def _preferences_dialog(self, *_, page=None):
14391444
         if self.prefs_dialog is not None:

modified schach/prefs.py +11 −0

@@ -77,6 +77,17 @@ class Preferences(Adw.PreferencesDialog)
7777
         spread.connect("notify::value", lambda row, _p: self._set("temperature", round(row.get_value(), 1)))
7878
         opponent.add(spread)
7979
         page.add(opponent)
80
+
81
+        feedback = Adw.PreferencesGroup(title="Rückmeldung")
82
+        glyphs = Adw.SwitchRow(
83
+            title="Zugzeichen sofort zeigen",
84
+            subtitle="!, ? und ?? gleich nach dem Zug auf dem Brett. Ausgeschaltet stehen sie "
85
+                     "nur in der Zugliste und in der Analyse.",
86
+            active=bool(settings.get("live_glyphs", True)),
87
+        )
88
+        glyphs.connect("notify::active", lambda row, _p: self._set("live_glyphs", row.get_active()))
89
+        feedback.add(glyphs)
90
+        page.add(feedback)
8091
         return page
8192
 
8293
     # --- Darstellung -------------------------------------------------------