pub struct ProgressRing { /* private fields */ }Expand description
A themed determinate circular progress indicator.
// Default: 56 pt diameter, sky arc, percent in the centre.
ui.add(ProgressRing::new(0.42));
// Larger, green, custom centre text + sub-caption.
ui.add(
ProgressRing::new(0.6)
.size(88.0)
.accent(Accent::Green)
.text("12 / 20")
.caption("files"),
);
// Hide the centre text entirely with an empty override.
ui.add(ProgressRing::new(0.3).size(32.0).text(""));Implementations§
Source§impl ProgressRing
impl ProgressRing
Sourcepub fn new(fraction: f32) -> Self
pub fn new(fraction: f32) -> Self
Create a ring at fraction (0..=1). NaN and out-of-range values
are clamped.
Sourcepub fn size(self, size: f32) -> Self
pub fn size(self, size: f32) -> Self
Outer diameter in points. Default: 56. Clamped to at least 8.
Sourcepub fn stroke_width(self, width: f32) -> Self
pub fn stroke_width(self, width: f32) -> Self
Arc stroke thickness in points. Defaults to ~8 % of size,
clamped to [3.0, 10.0].
Sourcepub fn color(self, color: Color32) -> Self
pub fn color(self, color: Color32) -> Self
Paint the arc with an explicit colour. Clears any previously set accent.
Sourcepub fn accent(self, accent: Accent) -> Self
pub fn accent(self, accent: Accent) -> Self
Pick the arc colour from one of the theme’s accents. Clears any previously set explicit colour. Default: the theme’s sky.
Trait Implementations§
Source§impl Clone for ProgressRing
impl Clone for ProgressRing
Source§fn clone(&self) -> ProgressRing
fn clone(&self) -> ProgressRing
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProgressRing
impl Debug for ProgressRing
Auto Trait Implementations§
impl Freeze for ProgressRing
impl RefUnwindSafe for ProgressRing
impl Send for ProgressRing
impl Sync for ProgressRing
impl Unpin for ProgressRing
impl UnsafeUnpin for ProgressRing
impl UnwindSafe for ProgressRing
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
Mutably borrows from an owned value. Read more