diff options
author | 2022-12-13 09:31:57 +0100 | |
---|---|---|
committer | 2022-12-13 09:31:57 +0100 | |
commit | 2e6d90f141217bad83eacd392562c13d7485881f (patch) | |
tree | baa2c507076073aed4fd24abc9c7a7949d85c039 /style/src/menu.rs | |
parent | ba95042fff378213f5029b2b164d79e768482a47 (diff) | |
parent | 02182eea45537c9eb5b2bddfdff822bb8a3d143d (diff) | |
download | iced-2e6d90f141217bad83eacd392562c13d7485881f.tar.gz iced-2e6d90f141217bad83eacd392562c13d7485881f.tar.bz2 iced-2e6d90f141217bad83eacd392562c13d7485881f.zip |
Merge branch 'master' into feat/slider-orientation
Diffstat (limited to '')
-rw-r--r-- | style/src/menu.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/style/src/menu.rs b/style/src/menu.rs index 6ef3e2a2..7d878748 100644 --- a/style/src/menu.rs +++ b/style/src/menu.rs @@ -1,19 +1,30 @@ +//! Change the appearance of menus. use iced_core::{Background, Color}; /// The appearance of a menu. #[derive(Debug, Clone, Copy)] pub struct Appearance { + /// The text [`Color`] of the menu. pub text_color: Color, + /// The [`Background`] of the menu. pub background: Background, + /// The border width of the menu. pub border_width: f32, + /// The border radius of the menu. pub border_radius: f32, + /// The border [`Color`] of the menu. pub border_color: Color, + /// The text [`Color`] of a selected option in the menu. pub selected_text_color: Color, + /// The background [`Color`] of a selected option in the menu. pub selected_background: Background, } +/// The style sheet of a menu. pub trait StyleSheet { - type Style: Default + Copy; + /// The supported style of the [`StyleSheet`]. + type Style: Default + Clone; - fn appearance(&self, style: Self::Style) -> Appearance; + /// Produces the [`Appearance`] of a menu. + fn appearance(&self, style: &Self::Style) -> Appearance; } |