Implement event capturing for Slider
This commit is contained in:
parent
fd275a2fee
commit
c361fe48c7
1 changed files with 6 additions and 0 deletions
|
|
@ -234,6 +234,8 @@ where
|
|||
if layout.bounds().contains(cursor_position) {
|
||||
change();
|
||||
self.state.is_dragging = true;
|
||||
|
||||
return event::Status::Captured;
|
||||
}
|
||||
}
|
||||
mouse::Event::ButtonReleased(mouse::Button::Left) => {
|
||||
|
|
@ -242,11 +244,15 @@ where
|
|||
messages.push(on_release);
|
||||
}
|
||||
self.state.is_dragging = false;
|
||||
|
||||
return event::Status::Captured;
|
||||
}
|
||||
}
|
||||
mouse::Event::CursorMoved { .. } => {
|
||||
if self.state.is_dragging {
|
||||
change();
|
||||
|
||||
return event::Status::Captured;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue