Public repository: timo / schach

Reader

Ein aufgeräumtes Schach-Programm für GNOME

fix(training): reserve three lines in coach bar

public

fix(training): reserve three lines in coach bar

Each new comment changed the bar height and the board resized.

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

modified schach/training.py +4 −0

@@ -87,6 +87,10 @@ class OpeningMixin:
8787
             wrap=True, xalign=0, hexpand=True, use_markup=True, selectable=False,
8888
             margin_top=10, margin_bottom=10, margin_start=14, margin_end=6,
8989
         )
90
+        # Platz für drei Zeilen vorsehen: sonst ändert jede Rückmeldung die Höhe, und das Brett wackelt
91
+        three_lines = self.coach_label.create_pango_layout("Ag\nAg\nAg").get_pixel_size()[1]
92
+        self.coach_label.set_size_request(-1, three_lines)
93
+        self.coach_label.set_valign(Gtk.Align.CENTER)
9094
         self.coach_button = Gtk.Button(
9195
             label="Gegen Maia weiterspielen", valign=Gtk.Align.CENTER, visible=False, margin_end=10,
9296
         )