From 425b4817f3288b5da42b180c3ab4901034a773d5 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(+) diff --git a/src/dialog.rs b/src/dialog.rs index 8cba533..550fa5a 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