2022-11-10 01:10:28 +01:00
|
|
|
//! Change the appearance of a progress bar.
|
2022-06-01 02:40:42 +02:00
|
|
|
use iced_core::Background;
|
2020-01-07 01:53:26 +01:00
|
|
|
|
|
|
|
|
/// The appearance of a progress bar.
|
2021-01-29 14:08:14 +09:00
|
|
|
#[derive(Debug, Clone, Copy)]
|
2022-06-01 02:40:42 +02:00
|
|
|
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.
|
2020-11-23 00:31:50 +01:00
|
|
|
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`].
|
2022-11-09 04:05:31 +01:00
|
|
|
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.
|
2022-11-09 04:05:31 +01:00
|
|
|
fn appearance(&self, style: &Self::Style) -> Appearance;
|
2020-01-07 01:53:26 +01:00
|
|
|
}
|