feat: touch support to scale widget

This commit is contained in:
Byson94
2026-01-04 15:26:56 +05:30
parent 37b57aee60
commit e4ab87bc2a
2 changed files with 5 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- `can_shrink` property to image widget.
- `mutations` property to localsignal.
- `eval_ignore` property to all widgets.
- Touch support to scale widget.
### Fixed

View File

@@ -2385,10 +2385,12 @@ pub(super) fn build_gtk_scale(
scale_dat,
move |ctrl, event| {
match event.event_type() {
gtk4::gdk::EventType::ButtonPress => {
gtk4::gdk::EventType::ButtonPress
| gtk4::gdk::EventType::TouchBegin => {
scale_dat.borrow_mut().is_being_dragged = true;
}
gtk4::gdk::EventType::ButtonRelease => {
gtk4::gdk::EventType::ButtonRelease
| gtk4::gdk::EventType::TouchEnd => {
let mut scale_dat_mut = scale_dat.borrow_mut();
scale_dat_mut.is_being_dragged = false;