Add shadow to overlay::menu::Style

This commit is contained in:
dejang 2025-09-01 15:39:43 -04:00 committed by Héctor Ramón Jiménez
parent 39ca9e0233
commit 2d293fd11e
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -11,7 +11,7 @@ use crate::core::widget::tree::{self, Tree};
use crate::core::window;
use crate::core::{
Background, Clipboard, Color, Event, Length, Padding, Pixels, Point,
Rectangle, Size, Theme, Vector,
Rectangle, Shadow, Size, Theme, Vector,
};
use crate::core::{Element, Shell, Widget};
use crate::scrollable::{self, Scrollable};
@ -317,6 +317,7 @@ where
renderer::Quad {
bounds,
border: style.border,
shadow: style.shadow,
..renderer::Quad::default()
},
style.background,
@ -605,6 +606,8 @@ pub struct Style {
pub selected_text_color: Color,
/// The background [`Color`] of a selected option in the menu.
pub selected_background: Background,
/// The [`Shadow`] of the menu.
pub shadow: Shadow,
}
/// The theme catalog of a [`Menu`].
@ -653,5 +656,6 @@ pub fn default(theme: &Theme) -> Style {
text_color: palette.background.weak.text,
selected_text_color: palette.primary.strong.text,
selected_background: palette.primary.strong.color.into(),
shadow: Shadow::default(),
}
}