diff --git a/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/passphrase.rs b/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/passphrase.rs index 87b2b43138..4afb59c35e 100644 --- a/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/passphrase.rs +++ b/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/passphrase.rs @@ -450,6 +450,7 @@ impl PassphraseInput { const SHOWN_PADDING: i16 = 24; const SHOWN_STYLE: TextStyle = theme::TEXT_MEDIUM.with_line_breaking(LineBreaking::BreakWordsNoHyphen); + const SHOWN_TOUCH_OUTSET: Insets = Insets::bottom(200); const ICON: Icon = theme::ICON_DASH_VERTICAL; const ICON_WIDTH: i16 = Self::ICON.toif.width(); const ICON_SPACE: i16 = 12; @@ -588,6 +589,13 @@ impl Component for PassphraseInput { return None; } + // Extend the passphrase area downward to allow touch input without the finger + // covering the passphrase + let extended_shown_area = self + .shown_area + .outset(Self::SHOWN_TOUCH_OUTSET) + .clamp(SCREEN); + match event { // Return touch start if the touch is detected inside the touchable area Event::Touch(TouchEvent::TouchStart(pos)) if self.area.contains(pos) => { @@ -600,14 +608,16 @@ impl Component for PassphraseInput { } // Return touch end if the touch end is detected inside the visible area Event::Touch(TouchEvent::TouchEnd(pos)) - if self.shown_area.contains(pos) && self.display_style == DisplayStyle::Shown => + if extended_shown_area.contains(pos) + && self.display_style == DisplayStyle::Shown => { self.display_style = DisplayStyle::Hidden; return Some(PassphraseInputMsg::TouchEnd); } // Return touch end if the touch moves out of the visible area Event::Touch(TouchEvent::TouchMove(pos)) - if !self.shown_area.contains(pos) && self.display_style == DisplayStyle::Shown => + if !extended_shown_area.contains(pos) + && self.display_style == DisplayStyle::Shown => { self.display_style = DisplayStyle::Hidden; return Some(PassphraseInputMsg::TouchEnd); diff --git a/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/pin.rs b/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/pin.rs index 4590ec1fd7..1e0f44c94d 100644 --- a/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/pin.rs +++ b/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/pin.rs @@ -278,6 +278,7 @@ impl PinInput { const SHOWN_STYLE: TextStyle = theme::TEXT_MEDIUM .with_line_breaking(LineBreaking::BreakWordsNoHyphen) .with_chunks(Chunks::new(1, 8)); + const SHOWN_TOUCH_OUTSET: Insets = Insets::bottom(200); const PIN_ICON: Icon = theme::ICON_DASH_VERTICAL; const ICON_WIDTH: i16 = Self::PIN_ICON.toif.width(); const ICON_SPACE: i16 = 12; @@ -438,6 +439,13 @@ impl Component for PinInput { return None; } + // Extend the pin area downward to allow touch input without the finger + // covering the passphrase + let extended_shown_area = self + .shown_area + .outset(Self::SHOWN_TOUCH_OUTSET) + .clamp(SCREEN); + match event { // Return touch start if the touch is detected inside the touchable area Event::Touch(TouchEvent::TouchStart(pos)) if self.area.contains(pos) => { @@ -450,14 +458,16 @@ impl Component for PinInput { } // Return touch end if the touch end is detected inside the visible area Event::Touch(TouchEvent::TouchEnd(pos)) - if self.shown_area.contains(pos) && self.display_style == DisplayStyle::Shown => + if extended_shown_area.contains(pos) + && self.display_style == DisplayStyle::Shown => { self.display_style = DisplayStyle::Hidden; return Some(PinInputMsg::TouchEnd); } // Return touch end if the touch moves out of the visible area Event::Touch(TouchEvent::TouchMove(pos)) - if !self.shown_area.contains(pos) && self.display_style == DisplayStyle::Shown => + if !extended_shown_area.contains(pos) + && self.display_style == DisplayStyle::Shown => { self.display_style = DisplayStyle::Hidden; return Some(PinInputMsg::TouchEnd);