Struct SelectStyle

Source
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: Color

Resting trigger fill.

§trigger_background_hovered: Color

Hovered enabled trigger fill.

§trigger_background_pressed: Color

Pressed enabled trigger fill.

§popup_background: Color

Popup surface fill.

§option_hovered: Color

Reserved hovered row fill token.

§option_active: Color

Keyboard/pointer-active row fill.

§option_selected: Color

Selected row fill.

§border: Border

Resting trigger border.

§popup_border: Border

Popup border.

§focus_ring: Border

Focus ring border.

§shadows: Vec<BoxShadow>

Popup shadows painted in order.

§text: TextStyle

Enabled trigger and row text.

§placeholder_text: TextStyle

No-selection placeholder text.

§disabled_text: TextStyle

Disabled row and trigger text.

§icon_tint: Color

Enabled leading/trailing icon tint.

§selected_icon_tint: Color

Selected checkmark tint.

§disabled_icon_tint: Color

Disabled icon tint before opacity multiplication.

§width: f32

Minimum intrinsic trigger/popup width in logical pixels.

§height: f32

Preferred trigger height in logical pixels.

§option_height: f32

Popup row height in logical pixels.

§popup_max_height: f32

Maximum popup height in logical pixels.

§popup_gap: f32

Trigger-to-popup gap in logical pixels.

§radius: Radius

Trigger and popup corner radii.

§padding_x: f32

Horizontal content padding in logical pixels.

§icon_size: f32

Option and chevron icon size in logical pixels.

§icon_gap: f32

Horizontal icon/text gap in logical pixels.

§focus_ring_offset: f32

Focus ring distance beyond trigger bounds in logical pixels.

§disabled_opacity: f32

Disabled alpha multiplier.

Implementations§

Source§

impl SelectStyle

Source

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));
Source

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

Source§

fn clone(&self) -> SelectStyle

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SelectStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SelectStyle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for SelectStyle

Source§

fn eq(&self, other: &SelectStyle) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SelectStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<A> IntoClickAction<A> for A
where A: Clone + 'static,

§

fn into_click_action(self) -> ClickAction<A>

Implements the into_click_action helper used by this module.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> Brush for T
where T: Clone + PartialEq + Default + Debug,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Props for T
where T: Clone + 'static,