summaryrefslogtreecommitdiff
path: root/crates/material_theme
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--crates/material_theme/Cargo.toml2
-rw-r--r--crates/material_theme/src/button.rs1
-rw-r--r--crates/material_theme/src/rule.rs2
3 files changed, 5 insertions, 0 deletions
diff --git a/crates/material_theme/Cargo.toml b/crates/material_theme/Cargo.toml
index e36860b..b1c608f 100644
--- a/crates/material_theme/Cargo.toml
+++ b/crates/material_theme/Cargo.toml
@@ -17,6 +17,8 @@ default = []
serde = ["dep:serde"]
# Provides support for animating with `iced_anim`.
animate = ["dep:iced_anim"]
+# Enables pixel snapping for crisp edges by default (can cause jitter!)
+crisp = ["iced_widget/crisp"]
# Provides support for `iced_dialog`.
dialog = ["dep:iced_dialog"]
# Provides support for the markdown widget.
diff --git a/crates/material_theme/src/button.rs b/crates/material_theme/src/button.rs
index 3f16bc7..2800ac4 100644
--- a/crates/material_theme/src/button.rs
+++ b/crates/material_theme/src/button.rs
@@ -32,6 +32,7 @@ fn button(
text_color: foreground,
border: border::rounded(400),
shadow: shadow_from_elevation(elevation(elevation_level), shadow_color),
+ snap: cfg!(feature = "crisp"),
};
match status {
diff --git a/crates/material_theme/src/rule.rs b/crates/material_theme/src/rule.rs
index 36e4dd4..77cb0ef 100644
--- a/crates/material_theme/src/rule.rs
+++ b/crates/material_theme/src/rule.rs
@@ -21,6 +21,7 @@ pub fn inset(theme: &Theme) -> Style {
fill_mode: FillMode::Padded(8),
width: 1,
radius: Radius::default(),
+ snap: cfg!(feature = "crisp"),
}
}
pub fn full_width(theme: &Theme) -> Style {
@@ -29,5 +30,6 @@ pub fn full_width(theme: &Theme) -> Style {
fill_mode: FillMode::Full,
width: 1,
radius: Radius::default(),
+ snap: cfg!(feature = "crisp"),
}
}