fix: toggler and slider roundness

This commit is contained in:
Ashley Wulber 2024-04-15 15:47:22 -04:00 committed by Michael Murphy
parent d5c8b762c1
commit 39f535c18b
2 changed files with 17 additions and 4 deletions

2
iced

@ -1 +1 @@
Subproject commit c87978d8973feeac57f32647676f01d6a02aaf7a
Subproject commit 3fe3a619b04786bdb4b3b67fa354b96ef693f017

View file

@ -642,7 +642,11 @@ impl slider::StyleSheet for Theme {
},
handle: slider::Handle {
shape: slider::HandleShape::Circle { radius: 10.0 },
shape: slider::HandleShape::Rectangle {
height: 20,
width: 20,
border_radius: cosmic.corner_radii.radius_m.into(),
},
color: cosmic.accent.base.into(),
border_color: Color::TRANSPARENT,
border_width: 0.0,
@ -660,9 +664,15 @@ impl slider::StyleSheet for Theme {
fn hovered(&self, style: &Self::Style) -> slider::Appearance {
match style {
Slider::Standard => {
let cosmic: &cosmic_theme::Theme = self.cosmic();
let mut style = self.active(style);
style.handle.shape = slider::HandleShape::Circle { radius: 16.0 };
style.handle.border_width = 6.0;
style.handle.shape = slider::HandleShape::Rectangle {
height: 26,
width: 26,
border_radius: cosmic.corner_radii.radius_m.into(),
};
style.handle.border_width = 3.0;
let mut border_color = self.cosmic().palette.neutral_10;
border_color.alpha = 0.1;
style.handle.border_color = border_color.into();
@ -811,6 +821,9 @@ impl toggler::StyleSheet for Theme {
background_border: None,
foreground: theme.palette.neutral_2.into(),
foreground_border: None,
border_radius: theme.radius_xl().into(),
handle_radius: theme.radius_xl().into(),
handle_margin: 2.0,
}
}