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>
| Changeset | aa29a4f8fa94fe6d7875d1543fb8e0fa07749a65 |
|---|---|
| Author (claimed) | Timo Stolz <timo.stolz@nullachtvierzehn.de>, |
| Parents | 4ccc1842828b |
| Children | e867cf33e63e |
| Pushlog | by timo via ssh by timo via ssh |
modified schach/training.py +4 −0
| @@ -87,6 +87,10 @@ class OpeningMixin: | ||
| 87 | 87 | wrap=True, xalign=0, hexpand=True, use_markup=True, selectable=False, |
| 88 | 88 | margin_top=10, margin_bottom=10, margin_start=14, margin_end=6, |
| 89 | 89 | ) |
| 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) | |
| 90 | 94 | self.coach_button = Gtk.Button( |
| 91 | 95 | label="Gegen Maia weiterspielen", valign=Gtk.Align.CENTER, visible=False, margin_end=10, |
| 92 | 96 | ) |