2020-09-19 18:44:27 +02:00
|
|
|
//! Show toggle controls using togglers.
|
|
|
|
|
use iced_core::Color;
|
|
|
|
|
|
|
|
|
|
/// The appearance of a toggler.
|
|
|
|
|
#[derive(Debug)]
|
2022-05-31 05:13:57 +02:00
|
|
|
pub struct Appearance {
|
2020-09-19 18:44:27 +02:00
|
|
|
pub background: Color,
|
|
|
|
|
pub background_border: Option<Color>,
|
|
|
|
|
pub foreground: Color,
|
|
|
|
|
pub foreground_border: Option<Color>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// A set of rules that dictate the style of a toggler.
|
|
|
|
|
pub trait StyleSheet {
|
2022-05-31 05:13:57 +02:00
|
|
|
type Style: Default + Copy;
|
2020-09-19 18:44:27 +02:00
|
|
|
|
2022-05-31 05:13:57 +02:00
|
|
|
fn active(&self, style: Self::Style, is_active: bool) -> Appearance;
|
2020-09-19 18:44:27 +02:00
|
|
|
|
2022-05-31 05:13:57 +02:00
|
|
|
fn hovered(&self, style: Self::Style, is_active: bool) -> Appearance;
|
2020-09-19 18:44:27 +02:00
|
|
|
}
|