diff --git a/core/embed/rust/src/ui/layout_eckhart/firmware/action_bar.rs b/core/embed/rust/src/ui/layout_eckhart/firmware/action_bar.rs index dd8b624e52..da6929b2b3 100644 --- a/core/embed/rust/src/ui/layout_eckhart/firmware/action_bar.rs +++ b/core/embed/rust/src/ui/layout_eckhart/firmware/action_bar.rs @@ -1,7 +1,7 @@ use crate::{ translations::TR, ui::{ - component::{Component, Event, EventCtx}, + component::{Component, Event, EventCtx, Timeout}, geometry::{Alignment2D, Insets, Offset, Rect}, shape::{self, Renderer}, util::{animation_disabled, Pager}, @@ -29,6 +29,8 @@ pub struct ActionBar { right_original: Option<(ButtonContent, ButtonStyleSheet)>, /// Hold to confirm animation htc_anim: Option, + /// Timeout + timeout: Option, } pub enum ActionBarMsg { @@ -48,6 +50,8 @@ enum Mode { Single, /// Cancel and confirm button; Up/Down navigation for paginated content Double { pager: Pager }, + /// Automatic confirmation after a timeout + Timeout, } impl ActionBar { @@ -68,6 +72,18 @@ impl ActionBar { Mode::Single, None, button.with_expanded_touch_area(Self::BUTTON_EXPAND_TOUCH), + None, + ) + } + + /// Create action bar with single button confirming the layout + pub fn new_timeout(button: Button, timeout_ms: u32) -> Self { + Self::new( + Mode::Timeout, + None, + button + .initially_enabled(false), + Some(Timeout::new(timeout_ms)), ) } @@ -86,6 +102,7 @@ impl ActionBar { right .with_expanded_touch_area(Self::BUTTON_EXPAND_TOUCH) .with_content_offset(Self::BUTTON_CONTENT_OFFSET.neg()), + None, ) } @@ -140,7 +157,12 @@ impl ActionBar { } } - fn new(mode: Mode, left_button: Option