iced-yoda/style/src/pick_list.rs

34 lines
1.1 KiB
Rust
Raw Normal View History

2022-11-10 01:10:28 +01:00
//! Change the appearance of a pick list.
use iced_core::{Background, BorderRadius, Color};
2020-07-10 02:50:47 +02:00
/// The appearance of a pick list.
#[derive(Debug, Clone, Copy)]
pub struct Appearance {
2022-11-10 01:10:28 +01:00
/// The text [`Color`] of the pick list.
pub text_color: Color,
2022-11-10 01:10:28 +01:00
/// The placeholder [`Color`] of the pick list.
pub placeholder_color: Color,
/// The handle [`Color`] of the pick list.
pub handle_color: Color,
2022-11-10 01:10:28 +01:00
/// The [`Background`] of the pick list.
pub background: Background,
2022-11-10 01:10:28 +01:00
/// The border radius of the pick list.
pub border_radius: BorderRadius,
2022-11-10 01:10:28 +01:00
/// The border width of the pick list.
pub border_width: f32,
2022-11-10 01:10:28 +01:00
/// The border color of the pick list.
pub border_color: Color,
}
/// A set of rules that dictate the style of a container.
pub trait StyleSheet {
2022-11-10 01:10:28 +01:00
/// The supported style of the [`StyleSheet`].
type Style: Default + Clone;
2022-11-10 01:10:28 +01:00
/// Produces the active [`Appearance`] of a pick list.
fn active(&self, style: &<Self as StyleSheet>::Style) -> Appearance;
2022-11-10 01:10:28 +01:00
/// Produces the hovered [`Appearance`] of a pick list.
fn hovered(&self, style: &<Self as StyleSheet>::Style) -> Appearance;
}