summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--style/src/slider.rs2
-rw-r--r--style/src/theme.rs5
-rw-r--r--wgpu/src/triangle.rs4
-rw-r--r--widget/src/lazy/responsive.rs1
-rw-r--r--widget/src/slider.rs4
-rw-r--r--widget/src/vertical_slider.rs4
6 files changed, 14 insertions, 6 deletions
diff --git a/style/src/slider.rs b/style/src/slider.rs
index ca115f46..f0068558 100644
--- a/style/src/slider.rs
+++ b/style/src/slider.rs
@@ -17,6 +17,8 @@ pub struct Rail {
pub colors: (Color, Color),
/// The width of the stroke of a slider rail.
pub width: f32,
+ /// The border radius of the corners of the rail.
+ pub border_radius: BorderRadius,
}
/// The appearance of the handle of a slider.
diff --git a/style/src/theme.rs b/style/src/theme.rs
index 4a8ee749..64497181 100644
--- a/style/src/theme.rs
+++ b/style/src/theme.rs
@@ -433,9 +433,10 @@ impl slider::StyleSheet for Theme {
rail: slider::Rail {
colors: (
palette.primary.base.color,
- palette.primary.base.color,
+ palette.secondary.base.color,
),
- width: 2.0,
+ width: 4.0,
+ border_radius: 2.0.into(),
},
handle: slider::Handle {
color: palette.background.base.color,
diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs
index 6cd54ef7..6f32f182 100644
--- a/wgpu/src/triangle.rs
+++ b/wgpu/src/triangle.rs
@@ -155,6 +155,10 @@ impl Layer {
for (index, mesh) in meshes.iter().enumerate() {
let clip_bounds = (mesh.clip_bounds() * scale_factor).snap();
+ if clip_bounds.width < 1 || clip_bounds.height < 1 {
+ continue;
+ }
+
render_pass.set_scissor_rect(
clip_bounds.x,
clip_bounds.y,
diff --git a/widget/src/lazy/responsive.rs b/widget/src/lazy/responsive.rs
index b41d978b..9b4fd9dd 100644
--- a/widget/src/lazy/responsive.rs
+++ b/widget/src/lazy/responsive.rs
@@ -81,6 +81,7 @@ where
self.element = view(new_size);
self.size = new_size;
+ self.layout = None;
tree.diff(&self.element);
}
diff --git a/widget/src/slider.rs b/widget/src/slider.rs
index 2851d8c3..c2498b87 100644
--- a/widget/src/slider.rs
+++ b/widget/src/slider.rs
@@ -403,7 +403,7 @@ pub fn draw<T, R>(
width: offset + handle_width / 2.0,
height: style.rail.width,
},
- border_radius: Default::default(),
+ border_radius: style.rail.border_radius,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},
@@ -418,7 +418,7 @@ pub fn draw<T, R>(
width: bounds.width - offset - handle_width / 2.0,
height: style.rail.width,
},
- border_radius: Default::default(),
+ border_radius: style.rail.border_radius,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},
diff --git a/widget/src/vertical_slider.rs b/widget/src/vertical_slider.rs
index 3b2430c4..b14e5401 100644
--- a/widget/src/vertical_slider.rs
+++ b/widget/src/vertical_slider.rs
@@ -401,7 +401,7 @@ pub fn draw<T, R>(
width: style.rail.width,
height: offset + handle_width / 2.0,
},
- border_radius: Default::default(),
+ border_radius: style.rail.border_radius,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},
@@ -416,7 +416,7 @@ pub fn draw<T, R>(
width: style.rail.width,
height: bounds.height - offset - handle_width / 2.0,
},
- border_radius: Default::default(),
+ border_radius: style.rail.border_radius,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},