diff --git a/core/embed/rust/src/ui/layout_delizia/component/frame.rs b/core/embed/rust/src/ui/layout_delizia/component/frame.rs index ba01517ead..6c09d8e5c0 100644 --- a/core/embed/rust/src/ui/layout_delizia/component/frame.rs +++ b/core/embed/rust/src/ui/layout_delizia/component/frame.rs @@ -410,13 +410,11 @@ fn frame_place( bounds: Rect, margin: usize, ) -> Rect { - let (mut header_area, mut content_area) = bounds.split_top(TITLE_HEIGHT); - content_area = content_area + let header_area = header.place(bounds); + let mut content_area = bounds + .inset(Insets::top(header_area.height().max(TITLE_HEIGHT))) .inset(Insets::top(theme::SPACING)) .inset(Insets::top(margin as i16)); - header_area = header_area.inset(Insets::sides(theme::SPACING)); - - header.place(header_area); if let Some(footer) = footer { // FIXME: spacer at the bottom might be applied also for usage without footer diff --git a/core/embed/rust/src/ui/layout_delizia/component/header.rs b/core/embed/rust/src/ui/layout_delizia/component/header.rs index 83a4dcf929..87b5efb645 100644 --- a/core/embed/rust/src/ui/layout_delizia/component/header.rs +++ b/core/embed/rust/src/ui/layout_delizia/component/header.rs @@ -93,7 +93,7 @@ impl Header { pub const fn new(alignment: Alignment, title: TString<'static>) -> Self { Self { area: Rect::zero(), - title: Label::new(title, alignment, theme::label_title_main()).vertically_centered(), + title: Label::new(title, alignment, theme::label_title_main()), subtitle: None, button: None, anim: None, @@ -185,23 +185,32 @@ impl Component for Header { fn place(&mut self, bounds: Rect) -> Rect { let header_area = if let Some(b) = &mut self.button { - let (rest, button_area) = bounds.split_right(TITLE_HEIGHT); + let (rest, button_area) = bounds.split_right(TITLE_HEIGHT + theme::SPACING * 2); + let (button_area, _under_button_area) = button_area.split_top(TITLE_HEIGHT); b.place(button_area); rest } else { bounds - }; + } + .inset(Insets::sides(theme::SPACING)); if self.subtitle.is_some() { let title_area = self.title.place(header_area); let remaining = header_area.inset(Insets::top(title_area.height())); - let _subtitle_area = self.subtitle.place(remaining); + let subtitle_area = self.subtitle.place(remaining); + self.area = title_area.outset(Insets::top(subtitle_area.height())); } else { - self.title.place(header_area); - } + let title_area = self.title.place(header_area); + if title_area.height() < header_area.height() / 10 { + self.title + .place(title_area.translate(Offset::y(title_area.height() / 2))); + } else { + self.title + .place(title_area.translate(Offset::y(-theme::SPACING))); + } + }; - self.area = bounds; - bounds + self.area } fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option { @@ -238,7 +247,7 @@ impl Component for Header { self.button.render(target); - target.in_clip(self.area.split_left(offset.x).0, &|target| { + target.in_clip(self.title.area().split_left(offset.x).0, &|target| { if let Some(icon) = self.icon { let color = self.color.unwrap_or(theme::GREEN); shape::ToifImage::new(self.title.area().left_center(), icon.toif) diff --git a/core/src/apps/stellar/operations/layout.py b/core/src/apps/stellar/operations/layout.py index 530caf4187..60cc5ebb4c 100644 --- a/core/src/apps/stellar/operations/layout.py +++ b/core/src/apps/stellar/operations/layout.py @@ -190,7 +190,7 @@ async def confirm_path_payment_strict_receive_op( await confirm_output( op.destination_account, format_amount(op.destination_amount, op.destination_asset), - title=TR.stellar__path_pay, + TR.stellar__path_pay, ) await confirm_asset_issuer(op.destination_asset) # confirm what the sender is using to pay @@ -209,7 +209,7 @@ async def confirm_path_payment_strict_send_op( await confirm_output( op.destination_account, format_amount(op.destination_min, op.destination_asset), - title=TR.stellar__path_pay_at_least, + TR.stellar__path_pay_at_least, ) await confirm_asset_issuer(op.destination_asset) # confirm what the sender is using to pay