pub struct ComboBoxStyle {
pub input: TextInputStyle,
pub popup: SelectStyle,
pub width: f32,
pub height: f32,
pub icon_size: f32,
pub icon_gap: f32,
pub disabled_opacity: f32,
}Expand description
Input, popup, geometry, and disabled appearance shared by both controls.
Dimensions are logical pixels. The default style is derived from the default
theme and ComboBoxSize::Default; no public field is clamped or validated.
§Examples
use ailloli_ui_widgets::controls::ComboBoxStyle;
let style = ComboBoxStyle::default();
assert_eq!((style.width, style.height), (220.0, 36.0));
assert_eq!(style.disabled_opacity, style.popup.disabled_opacity);Fields§
§input: TextInputStyleEditable trigger’s text-input style.
popup: SelectStyleRetained listbox popup style.
width: f32Preferred trigger width in logical pixels.
height: f32Preferred trigger height in logical pixels.
icon_size: f32Trailing chevron and option icon size in logical pixels.
icon_gap: f32Horizontal separation around icons in logical pixels.
disabled_opacity: f32Opacity multiplier applied while the whole control is disabled.
Implementations§
Source§impl ComboBoxStyle
impl ComboBoxStyle
Sourcepub fn from_theme(theme: Theme, size: ComboBoxSize) -> Self
pub fn from_theme(theme: Theme, size: ComboBoxSize) -> Self
Derives a combo-box style from theme and a density preset.
Compact produces 180 x 30; Default produces 220 x 36, all in
logical pixels.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{ComboBoxSize, ComboBoxStyle};
let compact = ComboBoxStyle::from_theme(Theme::default(), ComboBoxSize::Compact);
assert_eq!((compact.width, compact.height), (180.0, 30.0));Sourcepub fn from_autocomplete_theme(theme: Theme, size: AutocompleteSize) -> Self
pub fn from_autocomplete_theme(theme: Theme, size: AutocompleteSize) -> Self
Derives an autocomplete style by mapping its density to combo-box density.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{AutocompleteSize, AutocompleteStyle};
let style = AutocompleteStyle::from_autocomplete_theme(Theme::default(), AutocompleteSize::Default);
assert_eq!((style.width, style.height), (220.0, 36.0));Trait Implementations§
Source§impl Clone for ComboBoxStyle
impl Clone for ComboBoxStyle
Source§fn clone(&self) -> ComboBoxStyle
fn clone(&self) -> ComboBoxStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ComboBoxStyle
impl Debug for ComboBoxStyle
Auto Trait Implementations§
impl Freeze for ComboBoxStyle
impl RefUnwindSafe for ComboBoxStyle
impl Send for ComboBoxStyle
impl Sync for ComboBoxStyle
impl Unpin for ComboBoxStyle
impl UnwindSafe for ComboBoxStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.