diff --git a/core/embed/rust/src/ui/event/touch.rs b/core/embed/rust/src/ui/event/touch.rs index 093298119f..b99310ebd2 100644 --- a/core/embed/rust/src/ui/event/touch.rs +++ b/core/embed/rust/src/ui/event/touch.rs @@ -14,8 +14,6 @@ pub enum TouchEvent { TouchMove(Point), /// Touch has ended at a point on the screen. TouchEnd(Point), - /// Touch event has been suppressed by more important event - i.e. Swipe. - TouchAbort, } impl TouchEvent { @@ -34,6 +32,7 @@ impl TouchEvent { #[derive(Copy, Clone, PartialEq, Eq)] #[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))] pub enum SwipeEvent { + Start(Direction), Move(Direction, i16), End(Direction), } diff --git a/core/embed/rust/src/ui/flow/swipe.rs b/core/embed/rust/src/ui/flow/swipe.rs index e702f6ea6f..4fe5d84279 100644 --- a/core/embed/rust/src/ui/flow/swipe.rs +++ b/core/embed/rust/src/ui/flow/swipe.rs @@ -223,7 +223,7 @@ impl SwipeFlow { Some(SwipeDetectMsg::Move(dir, progress)) => { Event::Swipe(SwipeEvent::Move(dir, progress as i16)) } - Some(SwipeDetectMsg::Start(_)) => Event::Touch(TouchEvent::TouchAbort), + Some(SwipeDetectMsg::Start(dir)) => Event::Swipe(SwipeEvent::Start(dir)), None => event, } } else { diff --git a/core/embed/rust/src/ui/model_mercury/component/button.rs b/core/embed/rust/src/ui/model_mercury/component/button.rs index 5ff30c0fbb..46f2cd56fe 100644 --- a/core/embed/rust/src/ui/model_mercury/component/button.rs +++ b/core/embed/rust/src/ui/model_mercury/component/button.rs @@ -353,7 +353,8 @@ impl Component for Button { } } } - Event::Touch(TouchEvent::TouchAbort) => { + Event::Swipe(_) => { + // When a swipe is detected, abort any ongoing touch. match self.state { State::Initial | State::Disabled => { // Do nothing. diff --git a/core/embed/rust/src/ui/model_mercury/component/number_input_slider.rs b/core/embed/rust/src/ui/model_mercury/component/number_input_slider.rs index 5245e53045..2a7f36e790 100644 --- a/core/embed/rust/src/ui/model_mercury/component/number_input_slider.rs +++ b/core/embed/rust/src/ui/model_mercury/component/number_input_slider.rs @@ -185,7 +185,6 @@ impl Component for NumberInputSlider { ctx.request_paint(); self.touch_eval(pos, ctx, true) } - TouchEvent::TouchAbort => None, }; } None diff --git a/core/embed/rust/src/ui/model_mercury/component/swipe_up_screen.rs b/core/embed/rust/src/ui/model_mercury/component/swipe_up_screen.rs index aee1c8dd01..7c0100d45d 100644 --- a/core/embed/rust/src/ui/model_mercury/component/swipe_up_screen.rs +++ b/core/embed/rust/src/ui/model_mercury/component/swipe_up_screen.rs @@ -56,7 +56,7 @@ impl Component for SwipeUpScreen { Some(SwipeDetectMsg::Move(dir, progress)) => { Event::Swipe(SwipeEvent::Move(dir, progress as i16)) } - Some(SwipeDetectMsg::Start(_)) => Event::Touch(TouchEvent::TouchAbort), + Some(SwipeDetectMsg::Start(dir)) => Event::Swipe(SwipeEvent::Start(dir)), _ => event, }; diff --git a/core/embed/rust/src/ui/model_tt/component/number_input_slider.rs b/core/embed/rust/src/ui/model_tt/component/number_input_slider.rs index 07e608262b..a4028dd993 100644 --- a/core/embed/rust/src/ui/model_tt/component/number_input_slider.rs +++ b/core/embed/rust/src/ui/model_tt/component/number_input_slider.rs @@ -147,7 +147,6 @@ impl Component for NumberInputSlider { TouchEvent::TouchStart(pos) => self.slider_eval(pos, ctx), TouchEvent::TouchMove(pos) => self.slider_eval(pos, ctx), TouchEvent::TouchEnd(pos) => self.slider_eval(pos, ctx), - TouchEvent::TouchAbort => None, }; } None