pub struct ProgressBar { /* private fields */ }egui only.Expand description
A simple progress bar.
See also: crate::Spinner.
Implementations§
Source§impl ProgressBar
impl ProgressBar
Sourcepub fn new(progress: f32) -> ProgressBar
pub fn new(progress: f32) -> ProgressBar
Progress in the [0, 1] range, where 1 means “completed”.
Sourcepub fn desired_width(self, desired_width: f32) -> ProgressBar
pub fn desired_width(self, desired_width: f32) -> ProgressBar
The desired width of the bar. Will use all horizontal space if not set.
Sourcepub fn desired_height(self, desired_height: f32) -> ProgressBar
pub fn desired_height(self, desired_height: f32) -> ProgressBar
The desired height of the bar. Will use the default interaction size if not set.
Sourcepub fn fill(self, color: Color32) -> ProgressBar
pub fn fill(self, color: Color32) -> ProgressBar
The fill color of the bar.
Sourcepub fn text(self, text: impl Into<WidgetText>) -> ProgressBar
pub fn text(self, text: impl Into<WidgetText>) -> ProgressBar
A custom text to display on the progress bar.
Sourcepub fn show_percentage(self) -> ProgressBar
pub fn show_percentage(self) -> ProgressBar
Show the progress in percent on the progress bar.
Sourcepub fn animate(self, animate: bool) -> ProgressBar
pub fn animate(self, animate: bool) -> ProgressBar
Whether to display a loading animation when progress < 1.
Note that this will cause the UI to be redrawn.
Defaults to false.
If Self::corner_radius and Self::animate are used simultaneously, the animation is not
rendered, since it requires a perfect circle to render correctly. However, the UI is still
redrawn.
Sourcepub fn corner_radius(
self,
corner_radius: impl Into<CornerRadius>,
) -> ProgressBar
pub fn corner_radius( self, corner_radius: impl Into<CornerRadius>, ) -> ProgressBar
Set the rounding of the progress bar.
If Self::corner_radius and Self::animate are used simultaneously, the animation is not
rendered, since it requires a perfect circle to render correctly. However, the UI is still
redrawn.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ProgressBar
impl Freeze for ProgressBarwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<RichText> is !null: Freeze,
PhantomData<ArcInner<RichText>>: Freeze,
*const ArcInner<LayoutJob> is !null: Freeze,
PhantomData<ArcInner<LayoutJob>>: Freeze,
*const ArcInner<Galley> is !null: Freeze,
PhantomData<ArcInner<Galley>>: Freeze,
impl Move for ProgressBar
impl RefUnwindSafe for ProgressBar
impl Send for ProgressBar
impl Sync for ProgressBar
impl Unpin for ProgressBar
impl UnsafeUnpin for ProgressBarwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<RichText> is !null: UnsafeUnpin,
PhantomData<ArcInner<RichText>>: UnsafeUnpin,
*const ArcInner<LayoutJob> is !null: UnsafeUnpin,
PhantomData<ArcInner<LayoutJob>>: UnsafeUnpin,
*const ArcInner<Galley> is !null: UnsafeUnpin,
PhantomData<ArcInner<Galley>>: UnsafeUnpin,
impl UnwindSafe for ProgressBarwhere
RawVecInner: UnwindSafe,
Arc<RichText>: UnwindSafe,
Arc<LayoutJob>: UnwindSafe,
Arc<Galley>: UnwindSafe,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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