mirror of https://github.com/wayvr-org/wayvr.git
wgui: MouseCancel event couldn't propagate all the way down (Closes #588)
This commit is contained in:
parent
e1fb392297
commit
7f6caca0f8
|
|
@ -508,11 +508,11 @@ fn register_event_mouse_release(
|
|||
state.sticky_down = !state.sticky_down;
|
||||
}
|
||||
|
||||
common.alterables.trigger_haptics();
|
||||
common.alterables.play_sound(WguiSoundType::ButtonRelease);
|
||||
common.alterables.mark_redraw();
|
||||
|
||||
if state.down {
|
||||
common.alterables.trigger_haptics();
|
||||
common.alterables.play_sound(WguiSoundType::ButtonRelease);
|
||||
common.alterables.mark_redraw();
|
||||
|
||||
state.down = false;
|
||||
if state.hovered {
|
||||
anim_hover(
|
||||
|
|
|
|||
|
|
@ -471,6 +471,7 @@ impl Layout {
|
|||
&mut self.get_event_params(l, node_id, style, alterables),
|
||||
widget_id,
|
||||
event,
|
||||
event_result,
|
||||
)?;
|
||||
|
||||
if res_priority.can_propagate() {
|
||||
|
|
|
|||
|
|
@ -561,13 +561,17 @@ impl WidgetState {
|
|||
}
|
||||
|
||||
// this is called before calling children of this widget
|
||||
pub fn process_event_priority(
|
||||
pub fn process_event_priority<'a>(
|
||||
&mut self,
|
||||
params: &mut EventParams,
|
||||
widget_id: WidgetID,
|
||||
event: &Event,
|
||||
event_result: &'a mut EventResult,
|
||||
) -> anyhow::Result<EventResult> {
|
||||
match &event {
|
||||
Event::MouseCancel => {
|
||||
*event_result = EventResult::Pass;
|
||||
}
|
||||
Event::MouseUp(_e) => {
|
||||
if self.data.swipe_running {
|
||||
self.data.swipe_running = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue