Size TextRow's field box from the field's height, so its label shows

Every TextRow drew a field and a hint but no name: "Filename template"
and "Destination" on the settings page and in the export sheet, the two
storage budgets, the export size fields. The label was there, painted
behind the entry, with a clipped "ws" of "Thumbnails and previews"
poking out beside the thumbnail field.

The field sits in a Rectangle so the row can dim it and watch it lose
focus, and that Rectangle took its height from `field.preferred-height`.
`Field` sets its own `height` outright and has no layout inside it, so
its preferred height is zero. The box was zero tall, the row around it
took its height from the unit label beside it, and the field, centred
on an empty box, sat half its own height above the row, on top of the
FieldRow. Segmented never showed it because its chips live in a layout
that reports a real height.

Reading `field.height` instead gives the box the height the field
actually draws at, so the row reserves it and the label sits above. The
note on `Field.label` that recorded the fault now records the trap.
This commit is contained in:
2026-09-25 20:43:00 -04:00
parent 058286750b
commit c559d31dad
2 changed files with 12 additions and 6 deletions
+7 -1
View File
@@ -759,7 +759,13 @@ export component TextRow inherits VerticalLayout {
Rectangle { Rectangle {
width: root.field-width; width: root.field-width;
height: field.preferred-height; // The field's own height, not its `preferred-height`. `Field` is
// a Rectangle whose height is set outright rather than reported
// by a layout inside it, so its preferred height is zero; a
// zero-tall box here centres the field on its top edge, half a
// field above the row — which is where the label was, so from 0.9.0
// every `TextRow` drew its name behind its entry.
height: field.height;
opacity: root.enabled ? 1.0 : 0.4; opacity: root.enabled ? 1.0 : 0.4;
field := Field { field := Field {
+5 -5
View File
@@ -764,11 +764,11 @@ export component Field inherits Rectangle {
/// carried a second time, here, where the accessibility tree can attach it /// carried a second time, here, where the accessibility tree can attach it
/// to the control the user is actually typing into. /// to the control the user is actually typing into.
/// ///
/// That second copy is not redundant even where the caption renders. It is /// **Anything wrapping this sizes itself from `height`, not
/// the *only* copy where the caption does not: `TextRow`'s label draws /// `preferred-height`.** The height is set outright, so there is no layout
/// behind its own field on the settings page and has done since 0.9.0, so /// inside to report a preferred one and it reads zero. `TextRow` sized its
/// a sighted user reading that page today has less to go on than a screen /// box from it from 0.9.0 to 0.15.0, the field centred itself half a field
/// reader does. /// above that empty box, and every `TextRow` label drew behind its entry.
in property <string> label; in property <string> label;
in property <string> placeholder; in property <string> placeholder;
/// Masks the entry, for a credential that should not be readable over the /// Masks the entry, for a credential that should not be readable over the