diff --git a/core/embed/rust/src/ui/component/base.rs b/core/embed/rust/src/ui/component/base.rs index 18eef12d6e..1dc0b66f70 100644 --- a/core/embed/rust/src/ui/component/base.rs +++ b/core/embed/rust/src/ui/component/base.rs @@ -5,7 +5,7 @@ use heapless::Vec; use crate::{ time::Duration, ui::{ - component::{maybe::PaintOverlapping, Map}, + component::{maybe::PaintOverlapping, MsgMap}, display::Color, geometry::{Offset, Rect}, }, @@ -314,7 +314,7 @@ where } pub trait ComponentExt: Sized { - fn map(self, func: F) -> Map; + fn map(self, func: F) -> MsgMap; fn into_child(self) -> Child; fn request_complete_repaint(&mut self, ctx: &mut EventCtx); } @@ -323,8 +323,8 @@ impl ComponentExt for T where T: Component, { - fn map(self, func: F) -> Map { - Map::new(self, func) + fn map(self, func: F) -> MsgMap { + MsgMap::new(self, func) } fn into_child(self) -> Child { diff --git a/core/embed/rust/src/ui/component/map.rs b/core/embed/rust/src/ui/component/map.rs index 8902f23008..867d51f59f 100644 --- a/core/embed/rust/src/ui/component/map.rs +++ b/core/embed/rust/src/ui/component/map.rs @@ -1,18 +1,18 @@ use super::{Component, Event, EventCtx}; use crate::ui::geometry::Rect; -pub struct Map { +pub struct MsgMap { inner: T, func: F, } -impl Map { +impl MsgMap { pub fn new(inner: T, func: F) -> Self { Self { inner, func } } } -impl Component for Map +impl Component for MsgMap where T: Component, F: Fn(T::Msg) -> Option, @@ -38,7 +38,7 @@ where } #[cfg(feature = "ui_debug")] -impl crate::trace::Trace for Map +impl crate::trace::Trace for MsgMap where T: Component + crate::trace::Trace, { diff --git a/core/embed/rust/src/ui/component/mod.rs b/core/embed/rust/src/ui/component/mod.rs index a89f77cf20..c8559edcf0 100644 --- a/core/embed/rust/src/ui/component/mod.rs +++ b/core/embed/rust/src/ui/component/mod.rs @@ -20,7 +20,7 @@ pub use base::{Child, Component, ComponentExt, Event, EventCtx, Never, TimerToke pub use border::Border; pub use empty::Empty; pub use label::Label; -pub use map::Map; +pub use map::MsgMap; pub use marquee::Marquee; pub use maybe::Maybe; pub use pad::Pad; diff --git a/core/embed/rust/src/ui/model_tt/component/button.rs b/core/embed/rust/src/ui/model_tt/component/button.rs index 8f04c60dba..fec10c558d 100644 --- a/core/embed/rust/src/ui/model_tt/component/button.rs +++ b/core/embed/rust/src/ui/model_tt/component/button.rs @@ -2,7 +2,7 @@ use crate::{ time::Duration, ui::{ component::{ - Component, ComponentExt, Event, EventCtx, FixedHeightBar, Map, Split, TimerToken, + Component, ComponentExt, Event, EventCtx, FixedHeightBar, MsgMap, Split, TimerToken, }, display::{self, toif::Icon, Color, Font}, event::TouchEvent, @@ -509,10 +509,11 @@ pub enum CancelConfirmMsg { Confirmed, } -type CancelInfoConfirm = - FixedHeightBar, F0>, Split, F1>, Map, F2>>>>; +type CancelInfoConfirm = FixedHeightBar< + Split, F0>, Split, F1>, MsgMap, F2>>>, +>; -type CancelConfirm = FixedHeightBar, F0>, Map, F1>>>; +type CancelConfirm = FixedHeightBar, F0>, MsgMap, F1>>>; #[derive(Clone, Copy)] pub enum CancelInfoConfirmMsg {