From ca9d93b5c6da53a122f8fa2cceb12db006c270d1 Mon Sep 17 00:00:00 2001 From: edwloef Date: Wed, 12 Nov 2025 18:12:43 +0100 Subject: [PATCH] make default container style respect `crisp` feature --- widget/src/container.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/widget/src/container.rs b/widget/src/container.rs index 3e054ea6..62ed727d 100644 --- a/widget/src/container.rs +++ b/widget/src/container.rs @@ -458,7 +458,7 @@ pub fn draw_background( } /// The appearance of a container. -#[derive(Debug, Clone, Copy, PartialEq, Default)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The text [`Color`] of the container. pub text_color: Option, @@ -472,6 +472,18 @@ pub struct Style { pub snap: bool, } +impl Default for Style { + fn default() -> Self { + Self { + text_color: None, + background: None, + border: Border::default(), + shadow: Shadow::default(), + snap: cfg!(feature = "crisp"), + } + } +} + impl Style { /// Updates the text color of the [`Style`]. pub fn color(self, color: impl Into) -> Self {