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 b656337f5a..9b16032ba6 100644 --- a/core/embed/rust/src/ui/layout_bolt/component/page.rs +++ b/core/embed/rust/src/ui/layout_bolt/component/page.rs @@ -46,20 +46,6 @@ pub struct ButtonPage { fade: Cell>, } -impl ButtonPage -where - T: Paginate, - T: Component, -{ - pub fn with_hold(mut self) -> Result { - self.button_confirm = Button::with_text(TR::buttons__hold_to_confirm.into()) - .styled(theme::button_confirm()) - .without_haptics(); - self.loader = Some(Loader::new()); - Ok(self) - } -} - impl ButtonPage where T: Paginate, @@ -122,6 +108,14 @@ where self } + pub fn with_hold(mut self) -> Result { + self.button_confirm = Button::with_text(TR::buttons__hold_to_confirm.into()) + .styled(theme::button_confirm()) + .without_haptics(); + self.loader = Some(Loader::new()); + Ok(self) + } + pub fn with_confirm_style(mut self, style: ButtonStyleSheet) -> Self { self.button_confirm = self.button_confirm.styled(style); self diff --git a/core/embed/rust/src/ui/layout_eckhart/component/action_bar.rs b/core/embed/rust/src/ui/layout_eckhart/component/action_bar.rs new file mode 100644 index 0000000000..9909c5f567 --- /dev/null +++ b/core/embed/rust/src/ui/layout_eckhart/component/action_bar.rs @@ -0,0 +1,260 @@ +use crate::ui::{ + component::{Component, Event, EventCtx}, + geometry::{Alignment2D, Offset, Rect}, + shape::{self, Renderer}, + util::Pager, +}; + +use super::{ + button::{Button, ButtonContent, ButtonMsg}, + theme, ButtonStyleSheet, +}; + +/// Component for control buttons in the bottom of the screen. +pub struct ActionBar { + /// Behavior based on `Mode` + mode: Mode, + /// Right or single button, can have text or icon + right_button: Button, + /// Optional left button, can be shorter than the right one + left_button: Option