diff --git a/src/widget/mod.rs b/src/widget/mod.rs index 7dcfa233..f442b0da 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -257,7 +257,8 @@ pub use popover::{Popover, popover}; pub mod progress_bar; #[doc(inline)] pub use progress_bar::{ - circular, circular::Circular, circular_progress, linear, linear::Linear, linear_progress, style, + circular, circular::Circular, determinate_circular, determinate_linear, indeterminate_circular, + indeterminate_linear, linear, linear::Linear, style, }; pub mod radio; diff --git a/src/widget/progress_bar/mod.rs b/src/widget/progress_bar/mod.rs index c1230961..ea069ffc 100644 --- a/src/widget/progress_bar/mod.rs +++ b/src/widget/progress_bar/mod.rs @@ -2,10 +2,22 @@ pub mod circular; pub mod linear; pub mod style; -pub fn circular_progress() -> circular::Circular { +/// A spinner / throbber widget that can be used to indicate that some operation is in progress. +pub fn indeterminate_circular() -> circular::Circular { circular::Circular::new() } -pub fn linear_progress() -> linear::Linear { +/// A linear throbber widget that can be used to indicate that some operation is in progress. +pub fn indeterminate_linear() -> linear::Linear { linear::Linear::new() } + +/// A circular progress spinner widget that can be used to indicate the progress of some operation. +pub fn determinate_circular(progress: f32) -> circular::Circular { + circular::Circular::new().progress(progress) +} + +/// A linear progress bar widget that can be used to indicate the progress of some operation. +pub fn determinate_linear(progress: f32) -> linear::Linear { + linear::Linear::new().progress(progress) +}