pub struct ProgressBar { /* private fields */ }Expand description
A horizontal progress bar; value from 0.0 to 1.0. It can carry a label and a
percentage above it and a detail below.
use ravenrs_widgets::{ProgressBar, Ui};
let bar = ProgressBar::new(0.4).label("Copying").percent().detail("12 of 30 photos").height(4.0);
let mut ui = Ui::new(bar, ravenrs_style::Theme::raven_dark());
ui.update();Implementations§
Source§impl ProgressBar
impl ProgressBar
Sourcepub fn new(value: f32) -> ProgressBar
pub fn new(value: f32) -> ProgressBar
A progress bar at value, clamped to 0.0–1.0.
Sourcepub fn tone(self, tone: Tone) -> ProgressBar
pub fn tone(self, tone: Tone) -> ProgressBar
Sets the fill color tone (accent by default).
Sourcepub fn color(self, color: Color) -> ProgressBar
pub fn color(self, color: Color) -> ProgressBar
Fills with this color instead of the tone’s.
Sourcepub fn height(self, height: f32) -> ProgressBar
pub fn height(self, height: f32) -> ProgressBar
Sets the thickness of the bar in logical pixels (6 by default).
Sourcepub fn label(self, label: impl Into<String>) -> ProgressBar
pub fn label(self, label: impl Into<String>) -> ProgressBar
What is progressing, above the bar. It also names it for screen readers.
Sourcepub fn percent(self) -> ProgressBar
pub fn percent(self) -> ProgressBar
Shows the percentage above the bar, at its end.
Sourcepub fn detail(self, detail: impl Into<String>) -> ProgressBar
pub fn detail(self, detail: impl Into<String>) -> ProgressBar
A line in small text below the bar, such as how many are done.
Trait Implementations§
Source§impl Clone for ProgressBar
impl Clone for ProgressBar
Source§fn clone(&self) -> ProgressBar
fn clone(&self) -> ProgressBar
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ProgressBar
impl Debug for ProgressBar
Auto Trait Implementations§
impl Freeze for ProgressBar
impl RefUnwindSafe for ProgressBar
impl Send for ProgressBar
impl Sync for ProgressBar
impl Unpin for ProgressBar
impl UnsafeUnpin for ProgressBar
impl UnwindSafe for ProgressBar
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?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
Mutably borrows from an owned value. Read more
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<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.