euv_core/style/paint_prop/
struct.rs1use super::*;
2
3#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
5pub struct Border {
6 #[get(type(copy))]
8 pub(crate) width: f32,
9 #[get(type(copy))]
11 pub(crate) color: Color,
12}
13
14#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
16pub struct Shadow {
17 #[get(type(copy))]
19 pub(crate) offset_x: f32,
20 #[get(type(copy))]
22 pub(crate) offset_y: f32,
23 #[get(type(copy))]
25 pub(crate) blur_radius: f32,
26 #[get(type(copy))]
28 pub(crate) spread_radius: f32,
29 #[get(type(copy))]
31 pub(crate) color: Color,
32}
33
34#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
36pub struct LinearGradient {
37 #[get(type(copy))]
39 pub(crate) angle_deg: f32,
40 #[get(type(copy))]
42 pub(crate) start_color: Color,
43 #[get(type(copy))]
45 pub(crate) end_color: Color,
46}
47
48#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
50pub struct Transform2D {
51 #[get(type(copy))]
53 pub(crate) translate_x: f32,
54 #[get(type(copy))]
56 pub(crate) translate_y: f32,
57 #[get(type(copy))]
59 pub(crate) scale_x: f32,
60 #[get(type(copy))]
62 pub(crate) scale_y: f32,
63 #[get(type(copy))]
65 pub(crate) rotation_rad: f32,
66}
67
68#[derive(Clone, Copy, Data, Debug, PartialEq)]
70pub struct PaintStyle {
71 #[get(skip)]
73 pub(crate) background: Option<Color>,
74 #[get(skip)]
76 pub(crate) gradient: Option<LinearGradient>,
77 #[get(type(copy))]
79 pub(crate) border: Border,
80 #[get(type(copy))]
82 pub(crate) radius: CornerRadius,
83 #[get(skip)]
85 pub(crate) shadow: Option<Shadow>,
86 #[get(skip)]
88 pub(crate) focus_ring: Option<Border>,
89 #[get(type(copy))]
91 pub(crate) opacity: f32,
92 #[get(type(copy))]
94 pub(crate) transform: Transform2D,
95 #[get(type(copy))]
97 pub(crate) cursor: CursorIcon,
98 #[get(type(copy))]
100 pub(crate) pointer_events: PointerEvents,
101 #[get(type(copy))]
103 pub(crate) stop_scroll_propagation: bool,
104 #[get(type(copy))]
106 pub(crate) stop_event_propagation: bool,
107}