Log
dca667fde2d1
refactor(ui): shortcuts back in Adw.ShortcutsDialog
public
refactor(ui): shortcuts back in Adw.ShortcutsDialog
Not configurable, so they do not belong in preferences. Dialog
reads the shared SHORTCUTS table, including Backspace.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
modified
README.md
+1 −1
@@ -72,7 +72,7 @@ Schlichtes GNOME-Schachprogramm (Python,
72 72 Durchklicken (Pfeiltasten, F dreht), sie öffnet bei der Stellung, die beim Export gezeigt 73 73 war, und die FEN markiert sich mit einem Klick. Alles außer PDF geht auch in die 74 74 Zwischenablage – Bilder als Bild, HTML als formatierter Text. 75 -- **Einstellungen** (Strg+,; Reiter „Tastenkürzel“ auch mit Strg+?): Standardfarbe, Streuung von Maia, Brettfarben (Holz, 75 +- **Einstellungen** (Strg+,): Standardfarbe, Streuung von Maia, Brettfarben (Holz, 76 76 Schiefer, Grün), Notation (deutsch Sf3 oder englisch Nf3 – gilt für Zugliste und 77 77 Erklärungen; PGN-Dateien bleiben international), Figurensätze aus PyChess (`/usr/share/pychess/pieces` ), Lichess-Konto. 78 78
modified
ROADMAP.md
+1 −1
@@ -52,7 +52,7 @@ rechts: [Modus-Slot] [▯] [☰]
52 52 | Zwei Spieler / LAN | Hilfe-Gruppe mit Zähler „noch 2“ für den Spieler am Zug, daneben Remis/Aufgeben im selben Popover-Muster | 53 53 54 54 - **Primäres Menü** nach HIG: Spielstände, Export, Lichess-Abschnitt, Brett drehen, 55 - dann *Einstellungen* , *Tastenkürzel* (Gtk.ShortcutsWindow) und *Info zu Schach* 55 + dann *Einstellungen* , *Tastenkürzel* (Adw.ShortcutsDialog) und *Info zu Schach* 56 56 (Adw.AboutDialog). Das Figuren-Untermenü zieht in die Einstellungen um. So bleibt 57 57 das Menü bei 3–12 Einträgen. 58 58 - **Schmale Fenster:** Ab einem `Adw.Breakpoint` wandert der Modus-Slot in eine
modified
schach/app.py
+9 −3
@@ -1453,7 +1453,7 @@ class Window(OnlineMixin, PuzzleMixin, O
1453 1453 (name, " Eingebaut " if name == " python-chess " else name. capitalize()) 1454 1454 for name in FEATURED_THEMES if name in installed 1455 1455 ] 1456 - dialog = self . prefs_dialog = Preferences(self , themes, SHORTCUTS) 1456 + dialog = self . prefs_dialog = Preferences(self , themes) 1457 1457 dialog. connect(" closed " , lambda * _: setattr (self , " prefs_dialog " , None )) 1458 1458 if page: 1459 1459 dialog. show_page(page)
@@ -1526,8 +1526,14 @@ class Window(OnlineMixin, PuzzleMixin, O
1526 1526 Gtk. UriLauncher. new(f " https://lichess.org/ { self . online_id} " ). launch(self , None , None , None ) 1527 1527 1528 1528 def _shortcuts_dialog (self , * _): 1529 - """Tastenkürzel stehen als eigener Reiter in den Einstellungen.""" 1530 - self . _preferences_dialog(page= " shortcuts " ) 1529 + """Eigenes Fenster statt Einstellungs-Reiter: Einstellen lassen sich die Kürzel ja nicht.""" 1530 + dialog = Adw. ShortcutsDialog() 1531 + for title, items in SHORTCUTS: 1532 + section = Adw. ShortcutsSection(title= title) 1533 + for label, accel in items: 1534 + section. add(Adw. ShortcutsItem. new(label, accel)) 1535 + dialog. add(section) 1536 + dialog. present(self ) 1531 1537 1532 1538 def _about_dialog (self , * _): 1533 1539 about = Adw. AboutDialog(
modified
schach/prefs.py
+1 −15
@@ -13,7 +13,7 @@ COLORS = [("white", "Weiß"), ("black", "Schwarz"), ("random", "Zufällig")]
13 13 14 14 15 15 class Preferences (Adw. PreferencesDialog): 16 - def __init__ (self , win, themes, shortcuts= ()): 16 + def __init__ (self , win, themes): 17 17 super (). __init__ (title= " Einstellungen " , search_enabled= False ) 18 18 self . win = win 19 19 self . app = win. get_application()
@@ -22,7 +22,6 @@ class Preferences(Adw.PreferencesDialog)
22 22 " general " : self . _general_page(), 23 23 " appearance " : self . _appearance_page(), 24 24 " lichess " : self . _lichess_page(), 25 - " shortcuts " : self . _shortcuts_page(shortcuts), 26 25 } 27 26 for page in self . pages. values(): 28 27 self . add(page)
@@ -32,19 +31,6 @@ class Preferences(Adw.PreferencesDialog)
32 31 if name in self . pages: 33 32 self . set_visible_page(self . pages[name]) 34 33 35 - # --- Tastenkürzel ------------------------------------------------------ 36 - 37 - def _shortcuts_page (self , shortcuts): 38 - page = Adw. PreferencesPage(title= " Tastenkürzel " , icon_name= " preferences-desktop-keyboard-shortcuts-symbolic " ) 39 - for title, items in shortcuts: 40 - group = Adw. PreferencesGroup(title= title) 41 - for label, accel in items: 42 - row = Adw. ActionRow(title= label, use_markup= False ) 43 - row. add_suffix(Gtk. ShortcutLabel(accelerator= accel, valign= Gtk. Align. CENTER)) 44 - group. add(row) 45 - page. add(group) 46 - return page 47 - 48 34 def _set (self , key, value): 49 35 """Wert in allen Fenstern übernehmen und speichern.""" 50 36 self . app. update_setting(key, value)