Implement event capturing for Slider
This commit is contained in:
parent
fd275a2fee
commit
c361fe48c7
@ -234,6 +234,8 @@ where
|
|||||||
if layout.bounds().contains(cursor_position) {
|
if layout.bounds().contains(cursor_position) {
|
||||||
change();
|
change();
|
||||||
self.state.is_dragging = true;
|
self.state.is_dragging = true;
|
||||||
|
|
||||||
|
return event::Status::Captured;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mouse::Event::ButtonReleased(mouse::Button::Left) => {
|
mouse::Event::ButtonReleased(mouse::Button::Left) => {
|
||||||
@ -242,11 +244,15 @@ where
|
|||||||
messages.push(on_release);
|
messages.push(on_release);
|
||||||
}
|
}
|
||||||
self.state.is_dragging = false;
|
self.state.is_dragging = false;
|
||||||
|
|
||||||
|
return event::Status::Captured;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mouse::Event::CursorMoved { .. } => {
|
mouse::Event::CursorMoved { .. } => {
|
||||||
if self.state.is_dragging {
|
if self.state.is_dragging {
|
||||||
change();
|
change();
|
||||||
|
|
||||||
|
return event::Status::Captured;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
Loading…
Reference in New Issue
Block a user