2020-06-11 20:41:11 +02:00
|
|
|
use iced_core::{Background, Color};
|
|
|
|
|
|
2022-06-07 04:51:44 +02:00
|
|
|
use crate::container;
|
|
|
|
|
use crate::menu;
|
|
|
|
|
use crate::scrollable;
|
|
|
|
|
|
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 {
|
2020-06-11 20:41:11 +02:00
|
|
|
pub text_color: Color,
|
2021-07-22 20:13:14 +07:00
|
|
|
pub placeholder_color: Color,
|
2020-06-11 20:41:11 +02:00
|
|
|
pub background: Background,
|
2020-11-23 00:31:50 +01:00
|
|
|
pub border_radius: f32,
|
|
|
|
|
pub border_width: f32,
|
2020-06-11 20:41:11 +02:00
|
|
|
pub border_color: Color,
|
|
|
|
|
pub icon_size: f32,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// A set of rules that dictate the style of a container.
|
2022-06-07 04:51:44 +02:00
|
|
|
pub trait StyleSheet:
|
|
|
|
|
container::StyleSheet + menu::StyleSheet + scrollable::StyleSheet
|
|
|
|
|
{
|
|
|
|
|
type Style: Default + Copy + Into<<Self as menu::StyleSheet>::Style>;
|
2020-06-11 20:41:11 +02:00
|
|
|
|
2022-06-07 04:51:44 +02:00
|
|
|
fn active(&self, style: <Self as StyleSheet>::Style) -> Appearance;
|
2020-06-11 20:41:11 +02:00
|
|
|
|
|
|
|
|
/// Produces the style of a container.
|
2022-06-07 04:51:44 +02:00
|
|
|
fn hovered(&self, style: <Self as StyleSheet>::Style) -> Appearance;
|
2020-06-11 20:41:11 +02:00
|
|
|
}
|