Avoid returning early on Captured event in scrollable
Co-authored-by: Austin M. Reppert <austinmreppert@gmail.com>
This commit is contained in:
parent
5540ac07e4
commit
d72ac36a0f
1 changed files with 10 additions and 10 deletions
|
|
@ -525,7 +525,7 @@ pub fn update<Message>(
|
||||||
let (mouse_over_y_scrollbar, mouse_over_x_scrollbar) =
|
let (mouse_over_y_scrollbar, mouse_over_x_scrollbar) =
|
||||||
scrollbars.is_mouse_over(cursor);
|
scrollbars.is_mouse_over(cursor);
|
||||||
|
|
||||||
let event_status = {
|
let mut event_status = {
|
||||||
let cursor = match cursor_over_scrollable {
|
let cursor = match cursor_over_scrollable {
|
||||||
Some(cursor_position)
|
Some(cursor_position)
|
||||||
if !(mouse_over_x_scrollbar || mouse_over_y_scrollbar) =>
|
if !(mouse_over_x_scrollbar || mouse_over_y_scrollbar) =>
|
||||||
|
|
@ -589,7 +589,7 @@ pub fn update<Message>(
|
||||||
|
|
||||||
notify_on_scroll(state, on_scroll, bounds, content_bounds, shell);
|
notify_on_scroll(state, on_scroll, bounds, content_bounds, shell);
|
||||||
|
|
||||||
return event::Status::Captured;
|
event_status = event::Status::Captured;
|
||||||
}
|
}
|
||||||
Event::Touch(event)
|
Event::Touch(event)
|
||||||
if state.scroll_area_touched_at.is_some()
|
if state.scroll_area_touched_at.is_some()
|
||||||
|
|
@ -635,7 +635,7 @@ pub fn update<Message>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return event::Status::Captured;
|
event_status = event::Status::Captured;
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
@ -647,7 +647,7 @@ pub fn update<Message>(
|
||||||
| Event::Touch(touch::Event::FingerLost { .. }) => {
|
| Event::Touch(touch::Event::FingerLost { .. }) => {
|
||||||
state.y_scroller_grabbed_at = None;
|
state.y_scroller_grabbed_at = None;
|
||||||
|
|
||||||
return event::Status::Captured;
|
event_status = event::Status::Captured;
|
||||||
}
|
}
|
||||||
Event::Mouse(mouse::Event::CursorMoved { .. })
|
Event::Mouse(mouse::Event::CursorMoved { .. })
|
||||||
| Event::Touch(touch::Event::FingerMoved { .. }) => {
|
| Event::Touch(touch::Event::FingerMoved { .. }) => {
|
||||||
|
|
@ -673,7 +673,7 @@ pub fn update<Message>(
|
||||||
shell,
|
shell,
|
||||||
);
|
);
|
||||||
|
|
||||||
return event::Status::Captured;
|
event_status = event::Status::Captured;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|
@ -709,7 +709,7 @@ pub fn update<Message>(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return event::Status::Captured;
|
event_status = event::Status::Captured;
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
@ -722,7 +722,7 @@ pub fn update<Message>(
|
||||||
| Event::Touch(touch::Event::FingerLost { .. }) => {
|
| Event::Touch(touch::Event::FingerLost { .. }) => {
|
||||||
state.x_scroller_grabbed_at = None;
|
state.x_scroller_grabbed_at = None;
|
||||||
|
|
||||||
return event::Status::Captured;
|
event_status = event::Status::Captured;
|
||||||
}
|
}
|
||||||
Event::Mouse(mouse::Event::CursorMoved { .. })
|
Event::Mouse(mouse::Event::CursorMoved { .. })
|
||||||
| Event::Touch(touch::Event::FingerMoved { .. }) => {
|
| Event::Touch(touch::Event::FingerMoved { .. }) => {
|
||||||
|
|
@ -749,7 +749,7 @@ pub fn update<Message>(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return event::Status::Captured;
|
event_status = event::Status::Captured;
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
@ -783,14 +783,14 @@ pub fn update<Message>(
|
||||||
shell,
|
shell,
|
||||||
);
|
);
|
||||||
|
|
||||||
return event::Status::Captured;
|
event_status = event::Status::Captured;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
event::Status::Ignored
|
event_status
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Computes the current [`mouse::Interaction`] of a [`Scrollable`].
|
/// Computes the current [`mouse::Interaction`] of a [`Scrollable`].
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue