pub struct ProgressBar<'ui> { /* private fields */ }Expand description
Builder for a progress bar widget.
§Examples
ui.progress_bar(0.6)
.size([100.0, 12.0])
.overlay_text("Progress!")
.build();Implementations§
Source§impl<'ui> ProgressBar<'ui>
impl<'ui> ProgressBar<'ui>
Sourcepub fn new(ui: &'ui Ui, fraction: f32) -> Self
pub fn new(ui: &'ui Ui, fraction: f32) -> Self
Creates a progress bar with a given fraction showing the progress (0.0 = 0%, 1.0 = 100%).
The progress bar will be automatically sized to fill the entire width of the window if no custom size is specified.
Sourcepub fn overlay_text(self, overlay_text: impl AsRef<str>) -> Self
pub fn overlay_text(self, overlay_text: impl AsRef<str>) -> Self
Sets an optional text that will be drawn over the progress bar.
Trait Implementations§
Source§impl<'ui> Clone for ProgressBar<'ui>
impl<'ui> Clone for ProgressBar<'ui>
Source§fn clone(&self) -> ProgressBar<'ui>
fn clone(&self) -> ProgressBar<'ui>
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 moreAuto Trait Implementations§
impl<'ui> Freeze for ProgressBar<'ui>
impl<'ui> !RefUnwindSafe for ProgressBar<'ui>
impl<'ui> !Send for ProgressBar<'ui>
impl<'ui> !Sync for ProgressBar<'ui>
impl<'ui> Unpin for ProgressBar<'ui>
impl<'ui> !UnwindSafe for ProgressBar<'ui>
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