iced-yoda/style/src/checkbox.rs

23 lines
619 B
Rust
Raw Normal View History

2020-01-07 02:54:54 +01:00
//! Show toggle controls using checkboxes.
use iced_core::{Background, Color};
/// The appearance of a checkbox.
#[derive(Debug, Clone, Copy)]
2022-06-04 03:26:53 +02:00
pub struct Appearance {
2020-01-07 02:54:54 +01:00
pub background: Background,
pub checkmark_color: Color,
pub border_radius: f32,
pub border_width: f32,
2020-01-07 02:54:54 +01:00
pub border_color: Color,
pub text_color: Option<Color>,
2020-01-07 02:54:54 +01:00
}
/// A set of rules that dictate the style of a checkbox.
pub trait StyleSheet {
2022-06-04 03:26:53 +02:00
type Style: Default + Copy;
2020-01-07 02:54:54 +01:00
2022-06-04 03:26:53 +02:00
fn active(&self, style: Self::Style, is_checked: bool) -> Appearance;
2022-06-04 03:26:53 +02:00
fn hovered(&self, style: Self::Style, is_checked: bool) -> Appearance;
2020-01-07 02:54:54 +01:00
}