From dd519d936c560d200036a21c6bfa20cea1b6d579 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Wed, 15 Mar 2023 22:20:25 +0100 Subject: [PATCH] fixup! fix(core/ui): fix receive dialogs for long xpubs --- .../rust/src/ui/model_tt/component/horizontal_page.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/embed/rust/src/ui/model_tt/component/horizontal_page.rs b/core/embed/rust/src/ui/model_tt/component/horizontal_page.rs index 6aa3722ce6..e6ee842f54 100644 --- a/core/embed/rust/src/ui/model_tt/component/horizontal_page.rs +++ b/core/embed/rust/src/ui/model_tt/component/horizontal_page.rs @@ -3,12 +3,13 @@ use crate::ui::{ base::ComponentExt, AuxPageMsg, Component, Event, EventCtx, Never, Pad, PageMsg, Paginate, }, display::{self, Color}, - geometry::Rect, + geometry::{Insets, Rect}, }; use super::{theme, ScrollBar, Swipe, SwipeDirection}; const SCROLLBAR_HEIGHT: i16 = 18; +const SCROLLBAR_BORDER: i16 = 4; pub struct HorizontalPage { content: T, @@ -75,10 +76,11 @@ where fn place(&mut self, bounds: Rect) -> Rect { self.swipe.place(bounds); - let (content, scrollbar) = bounds.split_bottom(SCROLLBAR_HEIGHT); + let (content, scrollbar) = bounds.split_bottom(SCROLLBAR_HEIGHT + SCROLLBAR_BORDER); self.pad.place(content); self.content.place(content); - self.scrollbar.place(scrollbar); + self.scrollbar + .place(scrollbar.inset(Insets::bottom(SCROLLBAR_BORDER))); self.scrollbar .set_count_and_active_page(self.content.page_count(), 0);