make default container style respect crisp feature

This commit is contained in:
edwloef 2025-11-12 18:12:43 +01:00
parent 54b5c52db2
commit ca9d93b5c6
No known key found for this signature in database

View file

@ -458,7 +458,7 @@ pub fn draw_background<Renderer>(
}
/// 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<Color>,
@ -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<Color>) -> Self {