pub struct SizeTokens { /* private fields */ }Expand description
The crate’s size policy: three control heights and two glyph slots.
control heights size pressable controls — sm for compact chips and
icon buttons, md for standalone controls, lg for controls that sit
beside inputs and table rows and must match their height. slot sizes
the fixed leading box a glyph is centered in: sm matches the
extra-small text line, md the small text line, so a glyph beside
wrappable text stays centered on the first line no matter how far the
text wraps.
Implementations§
Source§impl SizeTokens
impl SizeTokens
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
The crate’s default size policy.
Control heights land on the 4px grid the spacing scale already
walks, with lg equal to the upstream input and table-row height so
adjacent controls rail. Slots equal the text line-heights they seat
glyphs beside (16px for extra-small text, 20px for small).
Sourcepub fn read(cx: &App) -> &Self
pub fn read(cx: &App) -> &Self
The installed policy, or the default when the application has not
chosen one (or asks before crate::init ran).
Sourcepub const fn control_sm(&self) -> Pixels
pub const fn control_sm(&self) -> Pixels
Compact chips, icon buttons, and row actions.
Sourcepub const fn control_md(&self) -> Pixels
pub const fn control_md(&self) -> Pixels
Standalone controls: prompt and selection actions.
Sourcepub const fn control_lg(&self) -> Pixels
pub const fn control_lg(&self) -> Pixels
Controls that sit beside inputs and table rows.
Sourcepub const fn control_padding_sm(&self) -> Pixels
pub const fn control_padding_sm(&self) -> Pixels
Horizontal padding inside a compact control.
Sourcepub const fn control_padding_md(&self) -> Pixels
pub const fn control_padding_md(&self) -> Pixels
Horizontal padding inside a standalone control.
Sourcepub const fn with_control_padding_sm(self, padding: Pixels) -> Self
pub const fn with_control_padding_sm(self, padding: Pixels) -> Self
Replaces control_padding_sm.
Sourcepub const fn with_control_padding_md(self, padding: Pixels) -> Self
pub const fn with_control_padding_md(self, padding: Pixels) -> Self
Replaces control_padding_md.
Sourcepub const fn slot_xs(&self) -> Pixels
pub const fn slot_xs(&self) -> Pixels
The status-indicator box: a dot, or the spinner that replaces it.
Sourcepub const fn with_slot_xs(self, size: Pixels) -> Self
pub const fn with_slot_xs(self, size: Pixels) -> Self
Replaces the slot_xs box.
Sourcepub const fn with_control_sm(self, height: Pixels) -> Self
pub const fn with_control_sm(self, height: Pixels) -> Self
Replaces the control_sm height.
Sourcepub const fn with_control_md(self, height: Pixels) -> Self
pub const fn with_control_md(self, height: Pixels) -> Self
Replaces the control_md height.
Sourcepub const fn with_control_lg(self, height: Pixels) -> Self
pub const fn with_control_lg(self, height: Pixels) -> Self
Replaces the control_lg height.
Sourcepub const fn with_slot_sm(self, size: Pixels) -> Self
pub const fn with_slot_sm(self, size: Pixels) -> Self
Replaces the slot_sm box.
Sourcepub const fn with_slot_md(self, size: Pixels) -> Self
pub const fn with_slot_md(self, size: Pixels) -> Self
Replaces the slot_md box.
Trait Implementations§
Source§impl Clone for SizeTokens
impl Clone for SizeTokens
Source§fn clone(&self) -> SizeTokens
fn clone(&self) -> SizeTokens
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SizeTokens
Source§impl Debug for SizeTokens
impl Debug for SizeTokens
Source§impl Default for SizeTokens
impl Default for SizeTokens
impl Global for SizeTokens
Source§impl PartialEq for SizeTokens
impl PartialEq for SizeTokens
impl StructuralPartialEq for SizeTokens
Auto Trait Implementations§
impl Freeze for SizeTokens
impl RefUnwindSafe for SizeTokens
impl Send for SizeTokens
impl Sync for SizeTokens
impl Unpin for SizeTokens
impl UnsafeUnpin for SizeTokens
impl UnwindSafe for SizeTokens
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Span], returning an
Instrumented wrapper.§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ReadGlobal for Twhere
T: Global,
impl<T> ReadGlobal for Twhere
T: Global,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<T> UpdateGlobal for Twhere
T: Global,
impl<T> UpdateGlobal for Twhere
T: Global,
§fn update_global<C, F, R>(cx: &mut C, update: F) -> R
fn update_global<C, F, R>(cx: &mut C, update: F) -> R
§fn set_global<C>(cx: &mut C, global: T)where
C: BorrowAppContext,
fn set_global<C>(cx: &mut C, global: T)where
C: BorrowAppContext,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Subscriber to this type, returning a
[WithDispatch] wrapper.