fix(slider): adjust handle bounds and size for iced widget slider update

This commit is contained in:
Aadil 2026-07-27 17:46:25 +05:30 • committed by GitHub
parent bdb273389d
commit 1f6dc991ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 23 deletions

View file

@ -775,12 +775,12 @@ impl slider::Catalog for Theme {
handle: slider::Handle {
shape: slider::HandleShape::Rectangle {
height: 20,
width: 20,
height: 26,
width: 26,
border_radius: cosmic.corner_radii.radius_m.into(),
},
border_color: Color::TRANSPARENT,
border_width: 0.0,
border_width: 3.0,
background: Background::Color(cosmic.accent.base.into()),
},
@ -795,12 +795,6 @@ impl slider::Catalog for Theme {
slider::Status::Active => appearance,
slider::Status::Hovered => match class {
Slider::Standard => {
appearance.handle.shape = slider::HandleShape::Rectangle {
height: 26,
width: 26,
border_radius: cosmic.corner_radii.radius_m.into(),
};
appearance.handle.border_width = 3.0;
appearance.handle.border_color =
self.cosmic().palette.neutral_10.with_alpha(0.1).into();
appearance
@ -809,20 +803,9 @@ impl slider::Catalog for Theme {
},
slider::Status::Dragged => match class {
Slider::Standard => {
let mut style = {
appearance.handle.shape = slider::HandleShape::Rectangle {
height: 26,
width: 26,
border_radius: cosmic.corner_radii.radius_m.into(),
};
appearance.handle.border_width = 3.0;
appearance.handle.border_color =
self.cosmic().palette.neutral_10.with_alpha(0.1).into();
appearance
};
style.handle.border_color =
appearance.handle.border_color =
self.cosmic().palette.neutral_10.with_alpha(0.2).into();
style
appearance
}
Slider::Custom { dragging, .. } => dragging(self),
},

View file

@ -360,7 +360,9 @@ where
})
.step(4.0 / 17.0)
.shift_step(64.0 / 17.0)
.width(self.width),
.width(self.width)
.handle_height(16)
.handle_width(16),
text_input("", self.input_color)
.on_input(move |s| on_update(ColorPickerUpdate::Input(s)))
.on_paste(move |s| on_update(ColorPickerUpdate::Input(s)))