From 001000019df7d77ca2393cef9cce30728daea785 Mon Sep 17 00:00:00 2001 From: pml68 Date: Sat, 3 May 2025 11:20:18 +0200 Subject: feat: add `backdrop` method to `Dialog` --- src/dialog.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/dialog.rs b/src/dialog.rs index def4194..01bdbb1 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -153,6 +153,16 @@ where buttons.into_iter().fold(self, Self::push_button) } + /// Sets the backdrop color of the [`Dialog`]. + pub fn backdrop(self, color: impl Into) -> Self + where + ::Class<'a>: From>, + { + let backdrop_color = color.into(); + + self.style(move |_theme| Style { backdrop_color }) + } + /// Sets the style of the [`Dialog`]. #[must_use] pub fn style(mut self, style: impl Fn(&Theme) -> Style + 'a) -> Self -- cgit v1.2.3