pub struct Spinner {
pub phase: f32,
pub color: Color,
pub size: f32,
pub stroke_w: f32,
}Expand description
An indeterminate progress spinner.
Renders a rotating arc inside a square layout rect. The application
drives the rotation by passing a monotonically-increasing phase
value (any units — only the fractional part of phase is used).
Fields§
§phase: f32Rotation phase. Only the fractional part is consumed, so any
monotonically increasing source works (elapsed.as_secs_f32(),
frame count divided by FPS, etc.).
color: ColorArc / ring colour. Defaults to the theme’s accent palette slot.
size: f32Square diameter in logical pixels. Both width and height of the laid-out rect target this size.
stroke_w: f32Stroke width of the arc and the dim guide ring.
Implementations§
Source§impl Spinner
impl Spinner
Sourcepub fn phase(self, p: f32) -> Self
pub fn phase(self, p: f32) -> Self
Set the rotation phase. The widget consumes only the fractional part, so callers can pass an unbounded monotonic clock value.
Sourcepub fn stroke_width(self, w: f32) -> Self
pub fn stroke_width(self, w: f32) -> Self
Set the arc / ring stroke width in logical pixels.
Sourcepub fn preferred_size(&self, max_width: f32) -> (f32, f32)
pub fn preferred_size(&self, max_width: f32) -> (f32, f32)
Return the preferred (width, height) — the spinner is square.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Spinner
impl RefUnwindSafe for Spinner
impl Send for Spinner
impl Sync for Spinner
impl Unpin 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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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