From e7d4d7e3e51ed7e6d231295fcc4e9139bfda0865 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 19:46:38 -0800 Subject: [PATCH] form_dialogs: a Range row with Param::length shows its value in the shown unit Only Number rows read Param::length, so a Range row over points showed points in an inch or millimeter document. - SliderField::lengths makes its number field a length field: it shows and reads the value in the shown unit at that unit's step and decimals, while the binding, the range and the slider stay in the stored unit. - Range rows pass Param::length to their SliderField. A popup-slider range row builds a length field too, and a set step, which is in the stored unit, steps the field by the same length in the shown unit. --- .../src/patterns/form_dialogs/param.rs | 5 +-- .../src/patterns/form_dialogs/rows.rs | 31 ++++++++++++----- .../tests/it/form_dialogs/params.rs | 33 +++++++++++++++++++ crates/ui-widgets/src/form/slider_field.rs | 22 +++++++++++-- 4 files changed, 79 insertions(+), 12 deletions(-) diff --git a/crates/ui-patterns/src/patterns/form_dialogs/param.rs b/crates/ui-patterns/src/patterns/form_dialogs/param.rs index 2081ba1515..b337e630f4 100644 --- a/crates/ui-patterns/src/patterns/form_dialogs/param.rs +++ b/crates/ui-patterns/src/patterns/form_dialogs/param.rs @@ -634,7 +634,7 @@ pub(crate) struct RowOptions { resettable: bool, /// The label a footer row shows while on ([`Param::in_footer`]). footer_on: Option