Skip to main content

SelectStyle

Struct SelectStyle 

Source
pub struct SelectStyle {
Show 18 fields pub bg: &'static str, pub border: Option<&'static str>, pub radius: f64, pub shadow: Option<Shadow>, pub color: &'static str, pub sub: &'static str, pub px: f64, pub row_h: f64, pub row_radius: f64, pub row_hover: &'static str, pub row_hi: &'static str, pub check: &'static str, pub search_bg: &'static str, pub rows: f64, pub min_w: f64, pub search_min_w: f64, pub thumb: &'static str, pub gap: f64,
}
Expand description

The look of an open list, set from CSS (Styled): standard background, border-color, border-radius, box-shadow, color, font-size, plus the custom properties named after the fields (--row-h, --row-hi, --check, …).

Fields§

§bg: &'static str§border: Option<&'static str>§radius: f64§shadow: Option<Shadow>§color: &'static str

Option text.

§sub: &'static str

Placeholder / “No matches”.

§px: f64§row_h: f64§row_radius: f64§row_hover: &'static str

Hovered row fill.

§row_hi: &'static str

Highlighted (keyboard) row fill.

§check: &'static str

Tick on the chosen row.

§search_bg: &'static str§rows: f64

Rows shown at once; more scroll.

§min_w: f64

Minimum list width (a narrow trigger still gets a readable list).

§search_min_w: f64

Minimum width of a searchable list.

§thumb: &'static str

Scroll thumb.

§gap: f64

Space between trigger and list.

Implementations§

Source§

impl SelectStyle

Source

pub fn window(&self) -> usize

Rows in the window.

Source

pub fn fit(self, h: f64, searchable: bool) -> SelectStyle

This style with as many rows as fit a container h tall (at least 3), so a list never runs past a short dialog: it scrolls instead.

Source

pub fn list_size(&self, n: usize, searchable: bool, anchor_w: f64) -> (f64, f64)

Size of the list for n matching options under a trigger anchor_w wide.

Trait Implementations§

Source§

impl Clone for SelectStyle

Source§

fn clone(&self) -> SelectStyle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for SelectStyle

Source§

impl Debug for SelectStyle

Source§

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

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

impl Default for SelectStyle

Source§

fn default() -> SelectStyle

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

impl PartialEq for SelectStyle

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SelectStyle

Source§

impl Styled for SelectStyle

Source§

fn apply_style(&mut self, s: &Style)

Override the fields the resolved style sets; untouched fields keep their value.
Source§

fn styled(self, sheet: &Sheet, spec: &str) -> Self
where Self: Sized,

self overridden by the element spec of sheet.
Source§

fn from_sheet(sheet: &Sheet, spec: &str) -> Self
where Self: Sized + Default,

Default overridden by the element spec of sheet.

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.

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.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.