mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-27 00:48:12 +00:00
style(core/rust/ui): rename Map to MsgMap
[no changelog]
This commit is contained in:
parent
08cad2f909
commit
2388a8edea
@ -5,7 +5,7 @@ use heapless::Vec;
|
|||||||
use crate::{
|
use crate::{
|
||||||
time::Duration,
|
time::Duration,
|
||||||
ui::{
|
ui::{
|
||||||
component::{maybe::PaintOverlapping, Map},
|
component::{maybe::PaintOverlapping, MsgMap},
|
||||||
display::Color,
|
display::Color,
|
||||||
geometry::{Offset, Rect},
|
geometry::{Offset, Rect},
|
||||||
},
|
},
|
||||||
@ -314,7 +314,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub trait ComponentExt: Sized {
|
pub trait ComponentExt: Sized {
|
||||||
fn map<F>(self, func: F) -> Map<Self, F>;
|
fn map<F>(self, func: F) -> MsgMap<Self, F>;
|
||||||
fn into_child(self) -> Child<Self>;
|
fn into_child(self) -> Child<Self>;
|
||||||
fn request_complete_repaint(&mut self, ctx: &mut EventCtx);
|
fn request_complete_repaint(&mut self, ctx: &mut EventCtx);
|
||||||
}
|
}
|
||||||
@ -323,8 +323,8 @@ impl<T> ComponentExt for T
|
|||||||
where
|
where
|
||||||
T: Component,
|
T: Component,
|
||||||
{
|
{
|
||||||
fn map<F>(self, func: F) -> Map<Self, F> {
|
fn map<F>(self, func: F) -> MsgMap<Self, F> {
|
||||||
Map::new(self, func)
|
MsgMap::new(self, func)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn into_child(self) -> Child<Self> {
|
fn into_child(self) -> Child<Self> {
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
use super::{Component, Event, EventCtx};
|
use super::{Component, Event, EventCtx};
|
||||||
use crate::ui::geometry::Rect;
|
use crate::ui::geometry::Rect;
|
||||||
|
|
||||||
pub struct Map<T, F> {
|
pub struct MsgMap<T, F> {
|
||||||
inner: T,
|
inner: T,
|
||||||
func: F,
|
func: F,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, F> Map<T, F> {
|
impl<T, F> MsgMap<T, F> {
|
||||||
pub fn new(inner: T, func: F) -> Self {
|
pub fn new(inner: T, func: F) -> Self {
|
||||||
Self { inner, func }
|
Self { inner, func }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, F, U> Component for Map<T, F>
|
impl<T, F, U> Component for MsgMap<T, F>
|
||||||
where
|
where
|
||||||
T: Component,
|
T: Component,
|
||||||
F: Fn(T::Msg) -> Option<U>,
|
F: Fn(T::Msg) -> Option<U>,
|
||||||
@ -38,7 +38,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "ui_debug")]
|
#[cfg(feature = "ui_debug")]
|
||||||
impl<T, F> crate::trace::Trace for Map<T, F>
|
impl<T, F> crate::trace::Trace for MsgMap<T, F>
|
||||||
where
|
where
|
||||||
T: Component + crate::trace::Trace,
|
T: Component + crate::trace::Trace,
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@ pub use base::{Child, Component, ComponentExt, Event, EventCtx, Never, TimerToke
|
|||||||
pub use border::Border;
|
pub use border::Border;
|
||||||
pub use empty::Empty;
|
pub use empty::Empty;
|
||||||
pub use label::Label;
|
pub use label::Label;
|
||||||
pub use map::Map;
|
pub use map::MsgMap;
|
||||||
pub use marquee::Marquee;
|
pub use marquee::Marquee;
|
||||||
pub use maybe::Maybe;
|
pub use maybe::Maybe;
|
||||||
pub use pad::Pad;
|
pub use pad::Pad;
|
||||||
|
@ -2,7 +2,7 @@ use crate::{
|
|||||||
time::Duration,
|
time::Duration,
|
||||||
ui::{
|
ui::{
|
||||||
component::{
|
component::{
|
||||||
Component, ComponentExt, Event, EventCtx, FixedHeightBar, Map, Split, TimerToken,
|
Component, ComponentExt, Event, EventCtx, FixedHeightBar, MsgMap, Split, TimerToken,
|
||||||
},
|
},
|
||||||
display::{self, toif::Icon, Color, Font},
|
display::{self, toif::Icon, Color, Font},
|
||||||
event::TouchEvent,
|
event::TouchEvent,
|
||||||
@ -509,10 +509,11 @@ pub enum CancelConfirmMsg {
|
|||||||
Confirmed,
|
Confirmed,
|
||||||
}
|
}
|
||||||
|
|
||||||
type CancelInfoConfirm<T, F0, F1, F2> =
|
type CancelInfoConfirm<T, F0, F1, F2> = FixedHeightBar<
|
||||||
FixedHeightBar<Split<Map<Button<T>, F0>, Split<Map<Button<T>, F1>, Map<Button<T>, F2>>>>;
|
Split<MsgMap<Button<T>, F0>, Split<MsgMap<Button<T>, F1>, MsgMap<Button<T>, F2>>>,
|
||||||
|
>;
|
||||||
|
|
||||||
type CancelConfirm<T, F0, F1> = FixedHeightBar<Split<Map<Button<T>, F0>, Map<Button<T>, F1>>>;
|
type CancelConfirm<T, F0, F1> = FixedHeightBar<Split<MsgMap<Button<T>, F0>, MsgMap<Button<T>, F1>>>;
|
||||||
|
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
pub enum CancelInfoConfirmMsg {
|
pub enum CancelInfoConfirmMsg {
|
||||||
|
Loading…
Reference in New Issue
Block a user