pub struct Icon { /* private fields */ }Expand description
A glyph from the bundled catalog.
Implementations§
Source§impl Icon
impl Icon
Sourcepub fn spinning(self, ident: impl Into<Ident>) -> Self
pub fn spinning(self, ident: impl Into<Ident>) -> Self
Turns the glyph, for a state that is still running.
This exists because the alternative kept being chosen by accident: a rotation glyph is the obvious drawing for “working”, and a rotation glyph that does not rotate reads as one that has jammed. Whichever component reports running work, it reports it the same way through here.
The identity is asked for rather than derived because a decorative glyph has none, and an animation needs something stable to run under.
Sourcepub fn breathing(self, ident: impl Into<Ident>) -> Self
pub fn breathing(self, ident: impl Into<Ident>) -> Self
Breathes the glyph, for a state that is deliberating rather than getting through work. The quieter of the two claims.
Sourcepub fn named(
ident: impl Into<Ident>,
glyph: Glyph,
name: impl Into<SharedString>,
) -> Self
pub fn named( ident: impl Into<Ident>, glyph: Glyph, name: impl Into<SharedString>, ) -> Self
A glyph that is the only thing saying what it means.
The name is a constructor argument rather than an option for the same
reason IconButton’s is: a
picture nobody can name is a picture nobody can address.
pub fn tone(self, tone: IconTone) -> Self
pub fn muted(self) -> Self
pub fn faint(self) -> Self
pub fn on_accent(self) -> Self
pub fn accent(self) -> Self
pub fn danger(self) -> Self
pub fn warning(self) -> Self
pub fn success(self) -> Self
pub fn info(self) -> Self
Sourcepub fn follow_direction(self, follow: bool) -> Self
pub fn follow_direction(self, follow: bool) -> Self
Whether the active reading direction may flip this glyph.
On by default, and the glyph still decides: only a
Directional drawing ever
flips. Turning it off is for a caller that has already rotated the
glyph into another meaning, where a horizontal flip would land it
somewhere neither reading direction points.
Sourcepub fn resolved_size(&self, theme: &Theme) -> f32
pub fn resolved_size(&self, theme: &Theme) -> f32
The painted edge length, in pixels, at the active theme and size.
pub fn resolved_color(&self, theme: &Theme) -> Hsla
Sourcepub fn flips_in(&self, direction: LayoutDirection) -> bool
pub fn flips_in(&self, direction: LayoutDirection) -> bool
Whether this glyph would be drawn flipped in direction.
Trait Implementations§
Source§impl IntoElement for Icon
impl IntoElement for Icon
Source§type Element = ViewElement<Icon>
type Element = ViewElement<Icon>
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
AnyElement.Source§impl RenderOnce for Icon
impl RenderOnce for Icon
Source§fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl Freeze for Icon
impl RefUnwindSafe for Icon
impl Send for Icon
impl Sync for Icon
impl Unpin for Icon
impl UnsafeUnpin for Icon
impl UnwindSafe for Icon
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
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,
Source§impl<E> Flipping for Ewhere
E: IntoElement,
impl<E> Flipping for Ewhere
E: IntoElement,
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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