mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 09:08:11 +00:00
FontPicker and ComboBox: compact is a prop, so its setter is derived
This commit is contained in:
@@ -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> {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user