From f94b37942bbb1d0823a6694c4e94cd65ebebb214 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 19:04:54 +0000 Subject: [PATCH] FontPicker and ComboBox: compact is a prop, so its setter is derived --- crates/font-manager/src/picker.rs | 8 +------- crates/ui-widgets/src/pickers/combo_box.rs | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/crates/font-manager/src/picker.rs b/crates/font-manager/src/picker.rs index d43146789..c89214e6f 100644 --- a/crates/font-manager/src/picker.rs +++ b/crates/font-manager/src/picker.rs @@ -734,6 +734,7 @@ pub struct FontPicker<'a> { host_picked: Option, /// Whether the font picker uses compact bar sizing (`size.length.field.sm` / `size.length.short`). #[style_key] + #[prop] compact: bool, } @@ -787,13 +788,6 @@ impl<'a> FontPicker<'a> { .enabled(catalog.is_ready()) } - /// Sets whether the font picker uses compact bar sizing (`size.length.field.sm` / `size.length.short`). - #[must_use] - pub fn compact(mut self, compact: bool) -> Self { - self.compact = compact; - self - } - /// The adornments at the end of the field: the missing mark when `missing`, then the chevron. The mark is a glyph /// whose part carries the note. fn trailing(name: Label, missing: bool, arrow: DropdownArrow) -> Vec { diff --git a/crates/ui-widgets/src/pickers/combo_box.rs b/crates/ui-widgets/src/pickers/combo_box.rs index 6a0a9f46a..b514db91c 100644 --- a/crates/ui-widgets/src/pickers/combo_box.rs +++ b/crates/ui-widgets/src/pickers/combo_box.rs @@ -100,6 +100,7 @@ pub struct ComboBox<'a> { preview: Preview, /// Whether the combo box sizes to its options alone, as in a toolbar or ribbon. #[style_key] + #[prop] compact: bool, } @@ -120,13 +121,6 @@ impl<'a> ComboBox<'a> { .label(label) } - /// Sets whether the combo box sizes to its options alone, as in a toolbar or ribbon. - #[must_use] - pub fn compact(mut self, compact: bool) -> Self { - self.compact = compact; - self - } - /// Previews `text`, led by the pointer or by the keys. The pass reports it only when the previewed text changes, /// so a second pass of a frame, which sees the lead its first pass stored, reports nothing. fn show_preview(&mut self, cx: &mut Cx<'_, Self>, text: String, by_pointer: bool) {