summaryrefslogtreecommitdiffstats
path: root/style/src/menu.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-12-02 18:53:21 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-12-02 18:53:21 +0100
commit4029a1cdaaac1abbdcc141b20469a49670cd99b6 (patch)
tree71fa9d9c4aa1f02ce05771db43a4bb7bc6570e77 /style/src/menu.rs
parent676d8efe03ebdbeeb95aef96b8097395b788b1ab (diff)
parent8b55e9b9e6ba0b83038dd491dd34d95b4f9a381b (diff)
downloadiced-4029a1cdaaac1abbdcc141b20469a49670cd99b6.tar.gz
iced-4029a1cdaaac1abbdcc141b20469a49670cd99b6.tar.bz2
iced-4029a1cdaaac1abbdcc141b20469a49670cd99b6.zip
Merge branch 'master' into non-uniform-border-radius-for-quads
Diffstat (limited to 'style/src/menu.rs')
-rw-r--r--style/src/menu.rs15
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;
}