cosmic/widget/segmented_button/
style.rs1use iced::Border;
5use iced_core::{Background, Color};
6
7#[derive(Default, Clone, Copy)]
9pub struct Appearance {
10 pub background: Option<Background>,
11 pub border: Border,
12 pub active_width: f32,
13 pub active: ItemStatusAppearance,
14 pub inactive: ItemStatusAppearance,
15 pub hover: ItemStatusAppearance,
16 pub pressed: ItemStatusAppearance,
17}
18
19#[derive(Default, Clone, Copy)]
21pub struct ItemAppearance {
22 pub border: Border,
23}
24
25#[derive(Default, Clone, Copy)]
27pub struct ItemStatusAppearance {
28 pub background: Option<Background>,
29 pub first: ItemAppearance,
30 pub middle: ItemAppearance,
31 pub last: ItemAppearance,
32 pub text_color: Color,
33}
34
35pub trait StyleSheet {
37 type Style: Default;
39
40 fn horizontal(&self, style: &Self::Style) -> Appearance;
42
43 fn vertical(&self, style: &Self::Style) -> Appearance;
45}