FontPicker and ComboBox: compact is a prop, so its setter is derived

This commit is contained in:
aiongg
2026-11-25 19:04:54 +00:00
parent 308af64e6c
commit f94b37942b
2 changed files with 2 additions and 14 deletions
+1 -7
View File
@@ -734,6 +734,7 @@ pub struct FontPicker<'a> {
host_picked: Option<String>,
/// 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<Adornment> {
+1 -7
View File
@@ -100,6 +100,7 @@ pub struct ComboBox<'a> {
preview: Preview<String>,
/// 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) {