diff --git a/core/embed/rust/src/ui/flow/base.rs b/core/embed/rust/src/ui/flow/base.rs index 2e4657b44..2da6a7348 100644 --- a/core/embed/rust/src/ui/flow/base.rs +++ b/core/embed/rust/src/ui/flow/base.rs @@ -1,4 +1,7 @@ -use crate::ui::component::{base::AttachType, swipe_detect::SwipeConfig, SwipeDirection}; +use crate::{ + strutil::ShortString, + ui::component::{base::AttachType, swipe_detect::SwipeConfig, SwipeDirection}, +}; pub trait Swipable { fn get_swipe_config(&self) -> SwipeConfig; @@ -11,16 +14,17 @@ pub trait Swipable { /// /// Also currently the type for message emitted by Flow::event to /// micropython. They don't need to be the same. -#[derive(Copy, Clone)] +#[derive(Clone)] pub enum FlowMsg { Confirmed, Cancelled, Info, Choice(usize), + Text(ShortString), } /// Composable event handler result. -#[derive(Copy, Clone)] +#[derive(Clone)] pub enum Decision { /// Do nothing, continue with processing next handler. Nothing, diff --git a/core/embed/rust/src/ui/flow/swipe.rs b/core/embed/rust/src/ui/flow/swipe.rs index b2a233fe9..d30598562 100644 --- a/core/embed/rust/src/ui/flow/swipe.rs +++ b/core/embed/rust/src/ui/flow/swipe.rs @@ -363,6 +363,11 @@ impl ObjComponent for SwipeFlow { Some(FlowMsg::Choice(i)) => { Ok((crate::ui::layout::result::CONFIRMED.as_obj(), i.try_into()?).try_into()?) } + Some(FlowMsg::Text(s)) => Ok(( + crate::ui::layout::result::CONFIRMED.as_obj(), + s.as_str().try_into()?, + ) + .try_into()?), } } fn obj_paint(&mut self) {