aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dialog.rs10
1 files changed, 10 insertions, 0 deletions
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<Color>) -> Self
+ where
+ <Theme as Catalog>::Class<'a>: From<StyleFn<'a, Theme>>,
+ {
+ 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