diff --git a/core/.changelog.d/5189.removed.2 b/core/.changelog.d/5189.removed.2 new file mode 100644 index 0000000000..94ac511a56 --- /dev/null +++ b/core/.changelog.d/5189.removed.2 @@ -0,0 +1 @@ +[T2T1] Don't enter/exit menu via horizontal swipe. diff --git a/core/embed/rust/src/ui/layout_bolt/component/page.rs b/core/embed/rust/src/ui/layout_bolt/component/page.rs index 9b16032ba6..0535284edd 100644 --- a/core/embed/rust/src/ui/layout_bolt/component/page.rs +++ b/core/embed/rust/src/ui/layout_bolt/component/page.rs @@ -121,16 +121,6 @@ where self } - pub fn with_swipe_left(mut self) -> Self { - self.swipe_left = true; - self - } - - pub fn with_swipe_right(mut self) -> Self { - self.swipe_right = true; - self - } - fn setup_swipe(&mut self) { self.swipe.allow_up = self.scrollbar.has_next_page(); self.swipe.allow_down = self.scrollbar.has_previous_page(); diff --git a/core/embed/rust/src/ui/layout_bolt/component/simple_page.rs b/core/embed/rust/src/ui/layout_bolt/component/simple_page.rs index 606f813045..5256d7481c 100644 --- a/core/embed/rust/src/ui/layout_bolt/component/simple_page.rs +++ b/core/embed/rust/src/ui/layout_bolt/component/simple_page.rs @@ -17,7 +17,6 @@ pub struct SimplePage { swipe: Swipe, scrollbar: ScrollBar, axis: Axis, - swipe_right_to_go_back: bool, fade: Cell>, } @@ -33,7 +32,6 @@ where pad: Pad::with_background(background), scrollbar: ScrollBar::new(axis), axis, - swipe_right_to_go_back: false, fade: Cell::new(None), } } @@ -46,11 +44,6 @@ where Self::new(content, Axis::Vertical, background) } - pub fn with_swipe_right_to_go_back(mut self) -> Self { - self.swipe_right_to_go_back = true; - self - } - pub fn inner(&self) -> &T { &self.content } @@ -58,12 +51,10 @@ where fn setup_swipe(&mut self) { if self.is_horizontal() { self.swipe.allow_left = self.scrollbar.has_next_page(); - self.swipe.allow_right = - self.scrollbar.has_previous_page() || self.swipe_right_to_go_back; + self.swipe.allow_right = self.scrollbar.has_previous_page(); } else { self.swipe.allow_up = self.scrollbar.has_next_page(); self.swipe.allow_down = self.scrollbar.has_previous_page(); - self.swipe.allow_right = self.swipe_right_to_go_back; } } @@ -137,11 +128,6 @@ where self.change_page(ctx, 1); return None; } - (SwipeDirection::Right, _) - if self.swipe_right_to_go_back && self.scrollbar.active_page == 0 => - { - return Some(PageMsg::Cancelled); - } (SwipeDirection::Right, Axis::Horizontal) | (SwipeDirection::Down, Axis::Vertical) => { self.change_page(ctx, -1); diff --git a/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs b/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs index c63eb2fa42..31089545e6 100644 --- a/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs +++ b/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs @@ -298,9 +298,7 @@ impl FirmwareUI for UIBolt { Frame::left_aligned( theme::label_title(), title, - ButtonPage::new(paragraphs, theme::BG) - .with_hold()? - .with_swipe_left(), + ButtonPage::new(paragraphs, theme::BG).with_hold()?, ) .with_info_button(), ); @@ -453,12 +451,9 @@ impl FirmwareUI for UIBolt { .add(Paragraph::new(&theme::TEXT_NORMAL, fee_label).no_break()) .add(Paragraph::new(&theme::TEXT_MONO, fee)); - let mut page = ButtonPage::new(paragraphs.into_paragraphs(), theme::BG) + let page = ButtonPage::new(paragraphs.into_paragraphs(), theme::BG) .with_hold()? .with_cancel_button(verb_cancel); - if info_button { - page = page.with_swipe_left(); - } let mut frame = Frame::left_aligned( theme::label_title(), title.unwrap_or(TString::empty()), @@ -775,8 +770,7 @@ impl FirmwareUI for UIBolt { ad.add_xpub(xtitle, text)?; } - let layout = - RootComponent::new(SimplePage::horizontal(ad, theme::BG).with_swipe_right_to_go_back()); + let layout = RootComponent::new(SimplePage::horizontal(ad, theme::BG)); Ok(layout) } @@ -981,8 +975,7 @@ impl FirmwareUI for UIBolt { Frame::left_aligned( theme::label_title(), title, - SimplePage::new(paragraphs.into_paragraphs(), axis, theme::BG) - .with_swipe_right_to_go_back(), + SimplePage::new(paragraphs.into_paragraphs(), axis, theme::BG), ) .with_cancel_button(), );