iced-yoda/style/src/progress_bar.rs

23 lines
688 B
Rust
Raw Normal View History

2022-11-10 01:10:28 +01:00
//! Change the appearance of a progress bar.
use iced_core::Background;
2020-01-07 01:53:26 +01:00
/// The appearance of a progress bar.
#[derive(Debug, Clone, Copy)]
pub struct Appearance {
2022-11-10 01:10:28 +01:00
/// The [`Background`] of the progress bar.
2020-01-07 01:53:26 +01:00
pub background: Background,
2022-11-10 01:10:28 +01:00
/// The [`Background`] of the bar of the progress bar.
2020-01-07 01:53:26 +01:00
pub bar: Background,
2022-11-10 01:10:28 +01:00
/// The border radius of the progress bar.
pub border_radius: f32,
2020-01-07 01:53:26 +01:00
}
/// A set of rules that dictate the style of a progress bar.
pub trait StyleSheet {
2022-11-10 01:10:28 +01:00
/// The supported style of the [`StyleSheet`].
type Style: Default;
2020-01-07 01:53:26 +01:00
2022-11-10 01:10:28 +01:00
/// Produces the [`Appearance`] of the progress bar.
fn appearance(&self, style: &Self::Style) -> Appearance;
2020-01-07 01:53:26 +01:00
}