refactor: better helpers for the progress_bar

This commit is contained in:
Ashley Wulber 2026-04-07 15:37:13 -04:00 committed by Michael Murphy
parent b963fbfea9
commit d9121d6f0d
2 changed files with 16 additions and 3 deletions

View file

@ -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;

View file

@ -2,10 +2,22 @@ pub mod circular;
pub mod linear;
pub mod style;
pub fn circular_progress<Message>() -> circular::Circular<crate::Theme> {
/// A spinner / throbber widget that can be used to indicate that some operation is in progress.
pub fn indeterminate_circular<Message>() -> circular::Circular<crate::Theme> {
circular::Circular::new()
}
pub fn linear_progress<Message>() -> linear::Linear<crate::Theme> {
/// A linear throbber widget that can be used to indicate that some operation is in progress.
pub fn indeterminate_linear<Message>() -> linear::Linear<crate::Theme> {
linear::Linear::new()
}
/// A circular progress spinner widget that can be used to indicate the progress of some operation.
pub fn determinate_circular<Message>(progress: f32) -> circular::Circular<crate::Theme> {
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<Message>(progress: f32) -> linear::Linear<crate::Theme> {
linear::Linear::new().progress(progress)
}