mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-08-04 12:56:25 +00:00
perf(core/ui): save flash by forbidding some inlining
[no changelog]
This commit is contained in:
parent
d1cf36097a
commit
9cd933b88e
@ -131,6 +131,7 @@ struct LayoutObjInner {
|
|||||||
|
|
||||||
impl LayoutObj {
|
impl LayoutObj {
|
||||||
/// Create a new `LayoutObj`, wrapping a root component.
|
/// Create a new `LayoutObj`, wrapping a root component.
|
||||||
|
#[inline(never)]
|
||||||
pub fn new(root: impl ComponentMsgObj + MaybeTrace + 'static) -> Result<Gc<Self>, Error> {
|
pub fn new(root: impl ComponentMsgObj + MaybeTrace + 'static) -> Result<Gc<Self>, Error> {
|
||||||
// Let's wrap the root component into a `Root` to maintain the top-level
|
// Let's wrap the root component into a `Root` to maintain the top-level
|
||||||
// invalidation logic.
|
// invalidation logic.
|
||||||
|
@ -68,14 +68,17 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
pub const fn left_aligned(title: TString<'static>, content: T) -> Self {
|
pub const fn left_aligned(title: TString<'static>, content: T) -> Self {
|
||||||
Self::new(Alignment::Start, title, content)
|
Self::new(Alignment::Start, title, content)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
pub const fn right_aligned(title: TString<'static>, content: T) -> Self {
|
pub const fn right_aligned(title: TString<'static>, content: T) -> Self {
|
||||||
Self::new(Alignment::End, title, content)
|
Self::new(Alignment::End, title, content)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
pub const fn centered(title: TString<'static>, content: T) -> Self {
|
pub const fn centered(title: TString<'static>, content: T) -> Self {
|
||||||
Self::new(Alignment::Center, title, content)
|
Self::new(Alignment::Center, title, content)
|
||||||
}
|
}
|
||||||
@ -90,6 +93,7 @@ where
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
pub fn with_subtitle(mut self, subtitle: TString<'static>) -> Self {
|
pub fn with_subtitle(mut self, subtitle: TString<'static>) -> Self {
|
||||||
let style = theme::TEXT_SUB_GREY;
|
let style = theme::TEXT_SUB_GREY;
|
||||||
self.title = Child::new(self.title.into_inner().top_aligned());
|
self.title = Child::new(self.title.into_inner().top_aligned());
|
||||||
@ -173,16 +177,14 @@ where
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_swipe(self, dir: SwipeDirection, settings: SwipeSettings) -> Self {
|
pub fn with_swipe(mut self, dir: SwipeDirection, settings: SwipeSettings) -> Self {
|
||||||
Self {
|
self.footer = self.footer.map(|f| match dir {
|
||||||
footer: self.footer.map(|f| match dir {
|
SwipeDirection::Up => f.with_swipe_up(),
|
||||||
SwipeDirection::Up => f.with_swipe_up(),
|
SwipeDirection::Down => f.with_swipe_down(),
|
||||||
SwipeDirection::Down => f.with_swipe_down(),
|
_ => f,
|
||||||
_ => f,
|
});
|
||||||
}),
|
self.swipe = self.swipe.with_swipe(dir, settings);
|
||||||
swipe: self.swipe.with_swipe(dir, settings),
|
self
|
||||||
..self
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_horizontal_pages(self) -> Self {
|
pub fn with_horizontal_pages(self) -> Self {
|
||||||
|
@ -175,21 +175,25 @@ impl ShowInfoParams {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
pub const fn with_subtitle(mut self, subtitle: Option<TString<'static>>) -> Self {
|
pub const fn with_subtitle(mut self, subtitle: Option<TString<'static>>) -> Self {
|
||||||
self.subtitle = subtitle;
|
self.subtitle = subtitle;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
pub const fn with_menu_button(mut self) -> Self {
|
pub const fn with_menu_button(mut self) -> Self {
|
||||||
self.menu_button = true;
|
self.menu_button = true;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
pub const fn with_cancel_button(mut self) -> Self {
|
pub const fn with_cancel_button(mut self) -> Self {
|
||||||
self.cancel_button = true;
|
self.cancel_button = true;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
pub const fn with_footer(
|
pub const fn with_footer(
|
||||||
mut self,
|
mut self,
|
||||||
instruction: TString<'static>,
|
instruction: TString<'static>,
|
||||||
@ -210,6 +214,7 @@ impl ShowInfoParams {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
pub fn into_layout(
|
pub fn into_layout(
|
||||||
self,
|
self,
|
||||||
) -> Result<impl Component<Msg = FlowMsg> + Swipable + MaybeTrace, Error> {
|
) -> Result<impl Component<Msg = FlowMsg> + Swipable + MaybeTrace, Error> {
|
||||||
|
Loading…
Reference in New Issue
Block a user