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>
| Changeset | 6bed763d4d38cca23cb7d8f19ccb353b656a669a |
|---|---|
| Author (claimed) | Timo Stolz <timo.stolz@nullachtvierzehn.de>, |
| Parents | dbcddca5f6c7 |
| Children | eb6ed136b458 |
| Pushlog | by timo via ssh by timo via ssh |
modified schach/app.py +6 −1
| @@ -76,6 +76,7 @@ DEFAULTS = { | ||
| 76 | 76 | "elo": 1200, "color": "white", "theme": "cburnett", "puzzle_difficulty": "normal", |
| 77 | 77 | "temperature": OPPONENT_TEMPERATURE, "scheme": "holz", "hint_helper": DEFAULT_HELPER, |
| 78 | 78 | "threat_source": "opponent", "notation": notation.DEFAULT, "time_control": "Ohne Uhr", |
| 79 | + "live_glyphs": True, | |
| 79 | 80 | } |
| 80 | 81 | |
| 81 | 82 | |
| @@ -562,7 +563,9 @@ class Window(OnlineMixin, PuzzleMixin, O | ||
| 562 | 563 | v.turn_marker = self.board.turn if self.mode == "duo" and not self._over() else None |
| 563 | 564 | if self.mode == "duo": |
| 564 | 565 | 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 | + ): | |
| 566 | 569 | if self.badge_ply < len(self.board.move_stack): |
| 567 | 570 | mv = self.board.move_stack[self.badge_ply] |
| 568 | 571 | piece = self.board.piece_at(mv.to_square) |
| @@ -1434,6 +1437,8 @@ class Window(OnlineMixin, PuzzleMixin, O | ||
| 1434 | 1437 | elif key == "notation": |
| 1435 | 1438 | self.movelist.notation = self._notation() |
| 1436 | 1439 | self._refresh() |
| 1440 | + elif key == "live_glyphs": | |
| 1441 | + self._refresh() | |
| 1437 | 1442 | |
| 1438 | 1443 | def _preferences_dialog(self, *_, page=None): |
| 1439 | 1444 | if self.prefs_dialog is not None: |
modified schach/prefs.py +11 −0
| @@ -77,6 +77,17 @@ class Preferences(Adw.PreferencesDialog) | ||
| 77 | 77 | spread.connect("notify::value", lambda row, _p: self._set("temperature", round(row.get_value(), 1))) |
| 78 | 78 | opponent.add(spread) |
| 79 | 79 | 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) | |
| 80 | 91 | return page |
| 81 | 92 | |
| 82 | 93 | # --- Darstellung ------------------------------------------------------- |