Merge pull request #3112 from edwloef/container-default-style-snap
make default container style respect `crisp` feature
This commit is contained in:
commit
fc80f697b1
1 changed files with 13 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue