Prospective fix for Qt style’s slider’s release callback

Like in the Slint impl, invoke only if previously pressed.
This commit is contained in:
Simon Hausmann 2024-05-09 13:38:20 +02:00
parent d03a6f0071
commit 09cfd067dd

View file

@ -217,8 +217,10 @@ impl Item for NativeSlider {
InputEventResult::GrabMouse
}
MouseEvent::Exit | MouseEvent::Released { button: PointerEventButton::Left, .. } => {
if data.pressed != 0 {
Self::FIELD_OFFSETS.released.apply_pin(self).call(&(self.value(),));
}
data.pressed = 0;
Self::FIELD_OFFSETS.released.apply_pin(self).call(&(self.value(),));
InputEventResult::EventAccepted
}
MouseEvent::Moved { position: pos } => {