Struct egui::widgets::ProgressBar
source · pub struct ProgressBar { /* private fields */ }
Expand description
A simple progress bar.
See also: crate::Spinner
.
Implementations§
source§impl ProgressBar
impl ProgressBar
sourcepub fn desired_width(self, desired_width: f32) -> Self
pub fn desired_width(self, desired_width: f32) -> Self
The desired width of the bar. Will use all horizontal space if not set.
sourcepub fn desired_height(self, desired_height: f32) -> Self
pub fn desired_height(self, desired_height: f32) -> Self
The desired height of the bar. Will use the default interaction size if not set.
sourcepub fn text(self, text: impl Into<WidgetText>) -> Self
pub fn text(self, text: impl Into<WidgetText>) -> Self
A custom text to display on the progress bar.
sourcepub fn show_percentage(self) -> Self
pub fn show_percentage(self) -> Self
Show the progress in percent on the progress bar.
sourcepub fn animate(self, animate: bool) -> Self
pub fn animate(self, animate: bool) -> Self
Whether to display a loading animation when progress < 1
.
Note that this will cause the UI to be redrawn.
Defaults to false
.
If Self::rounding
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 rounding(self, rounding: impl Into<Rounding>) -> Self
pub fn rounding(self, rounding: impl Into<Rounding>) -> Self
Set the rounding of the progress bar.
If Self::rounding
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.