pub struct SelectStyle {Show 28 fields
pub trigger_background: Color,
pub trigger_background_hovered: Color,
pub trigger_background_pressed: Color,
pub popup_background: Color,
pub option_hovered: Color,
pub option_active: Color,
pub option_selected: Color,
pub border: Border,
pub popup_border: Border,
pub focus_ring: Border,
pub shadows: Vec<BoxShadow>,
pub text: TextStyle,
pub placeholder_text: TextStyle,
pub disabled_text: TextStyle,
pub icon_tint: Color,
pub selected_icon_tint: Color,
pub disabled_icon_tint: Color,
pub width: f32,
pub height: f32,
pub option_height: f32,
pub popup_max_height: f32,
pub popup_gap: f32,
pub radius: Radius,
pub padding_x: f32,
pub icon_size: f32,
pub icon_gap: f32,
pub focus_ring_offset: f32,
pub disabled_opacity: f32,
}Expand description
Trigger, popup, row, typography, and focus appearance shared by both controls.
Dimensions are logical pixels and opacity is a multiplier. Public fields are used as supplied without validation. The default is the default theme’s regular select preset.
§Examples
use ailloli_ui_widgets::controls::SelectStyle;
let style = SelectStyle::default();
assert_eq!((style.width, style.height, style.option_height), (220.0, 36.0, 32.0));
assert_eq!(style.popup_max_height, 220.0);Fields§
§trigger_background: ColorResting trigger fill.
trigger_background_hovered: ColorHovered enabled trigger fill.
trigger_background_pressed: ColorPressed enabled trigger fill.
popup_background: ColorPopup surface fill.
option_hovered: ColorReserved hovered row fill token.
option_active: ColorKeyboard/pointer-active row fill.
option_selected: ColorSelected row fill.
border: BorderResting trigger border.
popup_border: BorderPopup border.
focus_ring: BorderFocus ring border.
shadows: Vec<BoxShadow>Popup shadows painted in order.
text: TextStyleEnabled trigger and row text.
placeholder_text: TextStyleNo-selection placeholder text.
disabled_text: TextStyleDisabled row and trigger text.
icon_tint: ColorEnabled leading/trailing icon tint.
selected_icon_tint: ColorSelected checkmark tint.
disabled_icon_tint: ColorDisabled icon tint before opacity multiplication.
width: f32Minimum intrinsic trigger/popup width in logical pixels.
height: f32Preferred trigger height in logical pixels.
option_height: f32Popup row height in logical pixels.
popup_max_height: f32Maximum popup height in logical pixels.
popup_gap: f32Trigger-to-popup gap in logical pixels.
radius: RadiusTrigger and popup corner radii.
padding_x: f32Horizontal content padding in logical pixels.
icon_size: f32Option and chevron icon size in logical pixels.
icon_gap: f32Horizontal icon/text gap in logical pixels.
focus_ring_offset: f32Focus ring distance beyond trigger bounds in logical pixels.
disabled_opacity: f32Disabled alpha multiplier.
Implementations§
Source§impl SelectStyle
impl SelectStyle
Sourcepub fn from_theme(theme: Theme, size: SelectSize) -> Self
pub fn from_theme(theme: Theme, size: SelectSize) -> Self
Derives a select style from theme and density.
Compact uses 180 x 30 with 28-pixel rows and 12-pixel text; default
uses 220 x 36 with 32-pixel rows and 13-pixel text.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{SelectSize, SelectStyle};
let style = SelectStyle::from_theme(Theme::default(), SelectSize::Compact);
assert_eq!((style.width, style.height, style.option_height), (180.0, 30.0, 28.0));Sourcepub fn from_dropdown_theme(theme: Theme, size: DropdownSize) -> Self
pub fn from_dropdown_theme(theme: Theme, size: DropdownSize) -> Self
Derives dropdown style by mapping dropdown density to select density.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{DropdownSize, DropdownStyle};
let style = DropdownStyle::from_dropdown_theme(Theme::default(), DropdownSize::Compact);
assert_eq!((style.width, style.height), (180.0, 30.0));Trait Implementations§
Source§impl Clone for SelectStyle
impl Clone for SelectStyle
Source§fn clone(&self) -> SelectStyle
fn clone(&self) -> SelectStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SelectStyle
impl Debug for SelectStyle
Source§impl Default for SelectStyle
impl Default for SelectStyle
Source§impl PartialEq for SelectStyle
impl PartialEq for SelectStyle
impl StructuralPartialEq for SelectStyle
Auto Trait Implementations§
impl Freeze for SelectStyle
impl RefUnwindSafe for SelectStyle
impl Send for SelectStyle
impl Sync for SelectStyle
impl Unpin for SelectStyle
impl UnwindSafe for SelectStyle
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.