From 84eef86c0afa571d5acfb952e849b306bff571bd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 09:39:38 -0800 Subject: [PATCH] UI: dialog option rows stand beside or under their choice - Transform effect: the Scale, Move and Rotate rows span the dialog instead of sitting behind a "Transform" label, and Reflect X, Reflect Y and Random show their names (the boxes were unlabeled). - Transform Each: the reference point picker shows its name. - Zig Zag, Roughen and Tweak: Relative and Absolute stand on one line, and so do Smooth and Corner. - Corners: Relative and Absolute stand on one line. - Drop Shadow: the color well stands under Color and the Darkness field under Darkness. - Print: the Range field stands under the Range choice instead of after Ignore Artboards. Each uses the form's own radio layouts (options_in_row, under_option) and plain check box rows. Tests in tests/dialog_layout.rs check where the dialogs paint these rows. --- crates/ui-egui/src/dialogs/corners.rs | 7 +- crates/ui-egui/src/dialogs/effect_rows.rs | 18 ++- crates/ui-egui/src/dialogs/print.rs | 5 +- crates/ui-egui/src/dialogs/transform_each.rs | 11 +- crates/ui-egui/src/tests.rs | 1 + crates/ui-egui/src/tests/dialog_layout.rs | 138 +++++++++++++++++++ 6 files changed, 169 insertions(+), 11 deletions(-) create mode 100644 crates/ui-egui/src/tests/dialog_layout.rs diff --git a/crates/ui-egui/src/dialogs/corners.rs b/crates/ui-egui/src/dialogs/corners.rs index 9c4ee9e4f4..1f330a64b6 100644 --- a/crates/ui-egui/src/dialogs/corners.rs +++ b/crates/ui-egui/src/dialogs/corners.rs @@ -87,8 +87,11 @@ fn dialog<'a>(relative: bool, lengths: LengthUnits) -> ParamDialog<'a> { Param::number("radius", tl!("Radius:"), 0.0, 1.0, 3).length(lengths).bounds(Some(0.0), None) }; let radii = vec![("relative".to_owned(), tl!("Relative").into()), ("absolute".to_owned(), tl!("Absolute").into())]; - let params = - vec![Param::new("kind", tl!("Corner:"), ParamKind::radio(kinds, None)), Param::new("radii", "", ParamKind::radio(radii, None)), radius]; + let params = vec![ + Param::new("kind", tl!("Corner:"), ParamKind::radio(kinds, None)), + Param::new("radii", "", ParamKind::radio(radii, None)).options_in_row(), + radius, + ]; ParamDialog::new(KIND, tl!("Corners"), params) } diff --git a/crates/ui-egui/src/dialogs/effect_rows.rs b/crates/ui-egui/src/dialogs/effect_rows.rs index e8eeacd29c..9ba4858116 100644 --- a/crates/ui-egui/src/dialogs/effect_rows.rs +++ b/crates/ui-egui/src/dialogs/effect_rows.rs @@ -58,7 +58,7 @@ fn sized_row(key: &str, label: Label, default: f64, relative: bool, lengths: Len /// the flag's JSON values, which `form::json_of` writes back as a bool. pub(super) fn relative_radio(label: impl Into