improv(slider): add styling for breakpoint and right rail
This commit is contained in:
parent
08b2e1ca38
commit
e90b584d91
3 changed files with 9 additions and 6 deletions
2
iced
2
iced
|
|
@ -1 +1 @@
|
||||||
Subproject commit 53a8cc143c2499f3b68379a4939b30732c0efa6a
|
Subproject commit d2dc82733de4d6d009f0ab9499076d9d26cd2805
|
||||||
|
|
@ -560,8 +560,7 @@ impl slider::StyleSheet for Theme {
|
||||||
rail: Rail {
|
rail: Rail {
|
||||||
colors: slider::RailBackground::Pair(
|
colors: slider::RailBackground::Pair(
|
||||||
cosmic.accent.base.into(),
|
cosmic.accent.base.into(),
|
||||||
//TODO: no way to set color before/after slider
|
cosmic.palette.neutral_6.into(),
|
||||||
Color::TRANSPARENT,
|
|
||||||
),
|
),
|
||||||
width: 4.0,
|
width: 4.0,
|
||||||
border_radius: cosmic.corner_radii.radius_xs.into(),
|
border_radius: cosmic.corner_radii.radius_xs.into(),
|
||||||
|
|
@ -573,6 +572,10 @@ impl slider::StyleSheet for Theme {
|
||||||
border_color: Color::TRANSPARENT,
|
border_color: Color::TRANSPARENT,
|
||||||
border_width: 0.0,
|
border_width: 0.0,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
breakpoint: slider::Breakpoint {
|
||||||
|
color: cosmic.on_bg_color().into(),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Slider::Custom { active, .. } => active(self),
|
Slider::Custom { active, .. } => active(self),
|
||||||
|
|
|
||||||
|
|
@ -303,7 +303,7 @@ where
|
||||||
.style(Slider::Custom {
|
.style(Slider::Custom {
|
||||||
active: Rc::new(|t| {
|
active: Rc::new(|t| {
|
||||||
let cosmic = t.cosmic();
|
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 {
|
a.rail.colors = RailBackground::Gradient {
|
||||||
gradient: Linear::new(Radians(0.0)).add_stops(HSV_RAINBOW.clone()),
|
gradient: Linear::new(Radians(0.0)).add_stops(HSV_RAINBOW.clone()),
|
||||||
auto_angle: true,
|
auto_angle: true,
|
||||||
|
|
@ -317,7 +317,7 @@ where
|
||||||
}),
|
}),
|
||||||
hovered: Rc::new(|t| {
|
hovered: Rc::new(|t| {
|
||||||
let cosmic = t.cosmic();
|
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 {
|
a.rail.colors = RailBackground::Gradient {
|
||||||
gradient: Linear::new(Radians(0.0)).add_stops(HSV_RAINBOW.clone()),
|
gradient: Linear::new(Radians(0.0)).add_stops(HSV_RAINBOW.clone()),
|
||||||
auto_angle: true,
|
auto_angle: true,
|
||||||
|
|
@ -331,7 +331,7 @@ where
|
||||||
}),
|
}),
|
||||||
dragging: Rc::new(|t| {
|
dragging: Rc::new(|t| {
|
||||||
let cosmic = t.cosmic();
|
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 {
|
a.rail.colors = RailBackground::Gradient {
|
||||||
gradient: Linear::new(Radians(0.0)).add_stops(HSV_RAINBOW.clone()),
|
gradient: Linear::new(Radians(0.0)).add_stops(HSV_RAINBOW.clone()),
|
||||||
auto_angle: true,
|
auto_angle: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue