2022-11-10 01:10:28 +01:00
|
|
|
//! Change the appearance of a pick list.
|
2023-05-23 12:26:16 +02:00
|
|
|
use iced_core::{Background, BorderRadius, Color};
|
2020-06-11 20:41:11 +02:00
|
|
|
|
2020-07-10 02:50:47 +02:00
|
|
|
/// The appearance of a pick list.
|
2020-06-11 20:41:11 +02:00
|
|
|
#[derive(Debug, Clone, Copy)]
|
2022-06-07 04:51:44 +02:00
|
|
|
pub struct Appearance {
|
2022-11-10 01:10:28 +01:00
|
|
|
/// The text [`Color`] of the pick list.
|
2020-06-11 20:41:11 +02:00
|
|
|
pub text_color: Color,
|
2022-11-10 01:10:28 +01:00
|
|
|
/// The placeholder [`Color`] of the pick list.
|
2021-07-22 20:13:14 +07:00
|
|
|
pub placeholder_color: Color,
|
2022-12-14 03:29:20 +01:00
|
|
|
/// 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.
|
2020-06-11 20:41:11 +02:00
|
|
|
pub background: Background,
|
2022-11-10 01:10:28 +01:00
|
|
|
/// The border radius of the pick list.
|
2023-05-23 12:26:16 +02:00
|
|
|
pub border_radius: BorderRadius,
|
2022-11-10 01:10:28 +01:00
|
|
|
/// The border width of the pick list.
|
2020-11-23 00:31:50 +01:00
|
|
|
pub border_width: f32,
|
2022-11-10 01:10:28 +01:00
|
|
|
/// The border color of the pick list.
|
2020-06-11 20:41:11 +02:00
|
|
|
pub border_color: Color,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// A set of rules that dictate the style of a container.
|
2022-11-09 04:05:31 +01:00
|
|
|
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 + Clone;
|
2020-06-11 20:41:11 +02:00
|
|
|
|
2022-11-10 01:10:28 +01:00
|
|
|
/// Produces the active [`Appearance`] of a pick list.
|
2022-11-09 04:05:31 +01:00
|
|
|
fn active(&self, style: &<Self as StyleSheet>::Style) -> Appearance;
|
2020-06-11 20:41:11 +02:00
|
|
|
|
2022-11-10 01:10:28 +01:00
|
|
|
/// Produces the hovered [`Appearance`] of a pick list.
|
2022-11-09 04:05:31 +01:00
|
|
|
fn hovered(&self, style: &<Self as StyleSheet>::Style) -> Appearance;
|
2020-06-11 20:41:11 +02:00
|
|
|
}
|