diff options
| author | pml68 <contact@pml68.dev> | 2025-05-03 11:20:18 +0200 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-05-03 11:20:26 +0200 |
| commit | 001000019df7d77ca2393cef9cce30728daea785 (patch) | |
| tree | d4a045fd87fb1df19e1d8cfd87ec26f9eb6a421e /src/dialog.rs | |
| parent | feat: set defaults for `Dialog`'s `Theme` and `Renderer` type parameters (diff) | |
| download | iced_dialog-001000019df7d77ca2393cef9cce30728daea785.tar.gz | |
feat: add `backdrop` method to `Dialog`
Diffstat (limited to '')
| -rw-r--r-- | src/dialog.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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<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 |
