Fix inactive mode-button padding to actually track _outerPaddingV

The previous vertical padding halving had no visible effect: the
inactive button's own vertical padding was hardcoded to 16, which
already exceeded content height + 2*_outerPaddingV at the old value
(5) and kept doing so at the new one (2.5) - so it stayed the tallest
row element regardless of _outerPaddingV, and the header's total
height never actually shrank. Deriving it as 6 + _outerPaddingV
(mirroring the active button's own 6 plus the wrap it would get)
keeps it exactly as tall as the active button and the middle content,
so changes to _outerPaddingV now actually propagate.
This commit is contained in:
Constantin Leue
2026-08-07 22:11:28 +02:00
parent fc892e1558
commit ae48a0deba
+13 -8
View File
@@ -190,14 +190,19 @@ class _ModeButton extends StatelessWidget {
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 24, horizontal: 24,
// Grosszuegiger als der aktive Zustand (6), damit dieser // Inaktiv: 6 (= aktives Padding) + TopModeBar._outerPaddingV, statt
// Button - roh, ohne umgebendes Leisten-Padding, siehe // eines fest verdrahteten Werts - dieser Button ist roh, ohne
// TopModeBar-Klassendoku - garantiert der hoechste Row-Inhalt // umgebendes Leisten-Padding (siehe Klassendoku), muss also selbst
// bleibt und dadurch die Leiste exakt auf ihre volle Hoehe // GENAU den Betrag zusaetzlich tragen, den der aktive Button durch
// (Text + diese Polsterung) bringt, statt von einem anderen // sein wrappendes Padding bekommt, um exakt gleich hoch wie dieser
// Zeileninhalt (z.B. den 34px hohen Pillen in der Mitte) // (und wie der mittlere Inhalt) auszufallen. Ein fest verdrahteter
// ueberragt zu werden und sichtbaren Rand stehen zu lassen. // Wert bliebe sonst nach einer Aenderung von _outerPaddingV zu
vertical: isActive ? 6 : 16, // gross und wuerde weiterhin ueberragen (frueher beobachtet: eine
// Halbierung von _outerPaddingV blieb dadurch am sichtbaren
// Randabstand komplett wirkungslos, weil dieser Button ohnehin
// schon der hoechste Row-Inhalt war und es dank des zu grossen
// festen Werts blieb).
vertical: isActive ? 6 : 6 + TopModeBar._outerPaddingV,
), ),
decoration: isActive decoration: isActive
? null ? null