Introduce Custom variants for every style in the built-in Theme

This commit is contained in:
Héctor Ramón Jiménez 2022-11-09 04:05:31 +01:00
parent 8102f96f12
commit 18fb74f200
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
34 changed files with 576 additions and 286 deletions

View file

@ -222,7 +222,7 @@ where
self.value,
&self.range,
theme,
self.style,
&self.style,
)
}
@ -353,7 +353,7 @@ pub fn draw<T, R>(
value: T,
range: &RangeInclusive<T>,
style_sheet: &dyn StyleSheet<Style = <R::Theme as StyleSheet>::Style>,
style: <R::Theme as StyleSheet>::Style,
style: &<R::Theme as StyleSheet>::Style,
) where
T: Into<f64> + Copy,
R: crate::Renderer,
@ -363,11 +363,11 @@ pub fn draw<T, R>(
let is_mouse_over = bounds.contains(cursor_position);
let style = if state.is_dragging {
style_sheet.dragging(style)
style_sheet.dragging(&style)
} else if is_mouse_over {
style_sheet.hovered(style)
style_sheet.hovered(&style)
} else {
style_sheet.active(style)
style_sheet.active(&style)
};
let rail_y = bounds.y + (bounds.height / 2.0).round();