pub struct Spinner { /* private fields */ }Expand description
A one-cell indicator that something is working, with an optional label.
It plays a cell animation: a SpinnerStyle or any animation by name.
With reduced motion the animation’s rest frame stands still. Style keys: spinner (fg, with
variants for tones such as spinner.success) and spinner-label. The spinner’s colour is the
$fg of its animation.
With Spinner::done the spinner stops turning and plays the animation spinner-done once:
the built-in one grows a tick, one motion.step per frame, blending from the colour on screen
into $success, and rests on the last frame.
Implementations§
Source§impl Spinner
impl Spinner
Sourcepub fn style(self, style: SpinnerStyle) -> Self
pub fn style(self, style: SpinnerStyle) -> Self
Chooses how it moves.
Sourcepub fn animation(self, name: impl Into<AnimationName>) -> Self
pub fn animation(self, name: impl Into<AnimationName>) -> Self
Plays the animation name from the icon set or theme instead of a style, e.g. one an
application defines in its theme. An unknown name draws ⟦, like a missing icon.
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
Text after the spinner, e.g. “Pulling image”.
Sourcepub fn variant(self, variant: impl Into<String>) -> Self
pub fn variant(self, variant: impl Into<String>) -> Self
Theme variant, e.g. "success" or "warning".
Sourcepub fn done(self, done: bool) -> Self
pub fn done(self, done: bool) -> Self
Marks the work as finished. When this turns on, the spinner stops turning, plays the
animation spinner-done once, starting from the colour on screen, and rests on its last
frame. Turning it off spins again. A spinner that is already done when first drawn, or
drawn with reduced motion, shows the last frame at once. The cell and the label stay where
they are. Off by default.
Trait Implementations§
impl Eq for Spinner
impl StructuralPartialEq for Spinner
Source§impl<Msg: 'static> Widget<Msg> for Spinner
impl<Msg: 'static> Widget<Msg> for Spinner
Source§fn measure(&self, _cx: &mut MeasureCx<'_>, available: Size) -> Size
fn measure(&self, _cx: &mut MeasureCx<'_>, available: Size) -> Size
available.Source§fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
PaintCx::request_overlay. anchor is the area the widget was painted in.Source§fn event(&self, _cx: &mut EventCx<'_, Msg>, _event: &Event) -> bool
fn event(&self, _cx: &mut EventCx<'_, Msg>, _event: &Event) -> bool
true when the event was used; unused key and scroll events
bubble to the parent widget.Source§fn children_mut(&mut self) -> &mut [Node<Msg>]
fn children_mut(&mut self) -> &mut [Node<Msg>]
Auto Trait Implementations§
impl Freeze for Spinner
impl RefUnwindSafe for Spinner
impl Send for Spinner
impl Sync for Spinner
impl Unpin for Spinner
impl UnsafeUnpin for Spinner
impl UnwindSafe for Spinner
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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