Files
ltk/src
Pedro M. de Echanove Pasquin 477ef13ff4
Some checks failed
CI / build + test (push) Has been cancelled
CI / cargo audit (push) Has been cancelled
toggle, widget: scale the pill with an explicit row height, and give elide a half-pixel tolerance
Toggle::height used to adjust only the row: the resolved value was floored at the theme track height and the pill kept its theme size, so a toggle capped below the fluid row height still rendered a full-size pill — on large surfaces, visibly out of scale next to controls that honour their cap. The floor is gone; when the resolved height falls below the theme row height, track and thumb now scale down proportionally (never up — the factor is capped at 1), and preferred_size reports the scaled track width so layout, focus ring and centring stay consistent. A toggle without an explicit height is untouched.
elide compared measure( text ) <= max_w strictly, which breaks when the caller sized itself from the same measurement: a button reports text + 2×pad as its preferred width, the layout grants exactly that, and draw hands elide back rect.width − 2×pad. In f32 the add-then-subtract round-trip can land a few ULP under the original measurement, the strict comparison fails, and the truncation branch then costs the full width of the ellipsis — a sub-pixel deficit turned "Empezar" into "Empez...". The fit check now allows half a pixel of slack, which absorbs any mismatch of this class while leaving genuine overflows to truncate as before.
2026-08-09 12:07:35 +02:00
..
2026-05-10 09:58:23 +02:00
2026-05-10 09:58:23 +02:00
2026-05-10 09:58:23 +02:00