improv(slider): add styling for breakpoint and right rail

This commit is contained in:
Michael Aaron Murphy 2024-02-21 15:31:14 +01:00 committed by Michael Murphy
parent 08b2e1ca38
commit e90b584d91
3 changed files with 9 additions and 6 deletions

2
iced

@ -1 +1 @@
Subproject commit 53a8cc143c2499f3b68379a4939b30732c0efa6a
Subproject commit d2dc82733de4d6d009f0ab9499076d9d26cd2805

View file

@ -560,8 +560,7 @@ impl slider::StyleSheet for Theme {
rail: Rail {
colors: slider::RailBackground::Pair(
cosmic.accent.base.into(),
//TODO: no way to set color before/after slider
Color::TRANSPARENT,
cosmic.palette.neutral_6.into(),
),
width: 4.0,
border_radius: cosmic.corner_radii.radius_xs.into(),
@ -573,6 +572,10 @@ impl slider::StyleSheet for Theme {
border_color: Color::TRANSPARENT,
border_width: 0.0,
},
breakpoint: slider::Breakpoint {
color: cosmic.on_bg_color().into(),
},
}
}
Slider::Custom { active, .. } => active(self),

View file

@ -303,7 +303,7 @@ where
.style(Slider::Custom {
active: Rc::new(|t| {
let cosmic = t.cosmic();
let mut a = iced_style::slider::StyleSheet::active(t, &Slider::default());
let mut a = slider::StyleSheet::active(t, &Slider::default());
a.rail.colors = RailBackground::Gradient {
gradient: Linear::new(Radians(0.0)).add_stops(HSV_RAINBOW.clone()),
auto_angle: true,
@ -317,7 +317,7 @@ where
}),
hovered: Rc::new(|t| {
let cosmic = t.cosmic();
let mut a = iced_style::slider::StyleSheet::active(t, &Slider::default());
let mut a = slider::StyleSheet::active(t, &Slider::default());
a.rail.colors = RailBackground::Gradient {
gradient: Linear::new(Radians(0.0)).add_stops(HSV_RAINBOW.clone()),
auto_angle: true,
@ -331,7 +331,7 @@ where
}),
dragging: Rc::new(|t| {
let cosmic = t.cosmic();
let mut a = iced_style::slider::StyleSheet::active(t, &Slider::default());
let mut a = slider::StyleSheet::active(t, &Slider::default());
a.rail.colors = RailBackground::Gradient {
gradient: Linear::new(Radians(0.0)).add_stops(HSV_RAINBOW.clone()),
auto_angle: true,