From d450c8d7ad71186d94e4f889746dc3dff8a3d7ad Mon Sep 17 00:00:00 2001 From: grdddj Date: Sat, 31 Dec 2022 15:30:43 +0100 Subject: [PATCH] WIP - fix scrollbar taking bigger area than it should --- core/embed/rust/src/ui/model_tr/component/scrollbar.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/embed/rust/src/ui/model_tr/component/scrollbar.rs b/core/embed/rust/src/ui/model_tr/component/scrollbar.rs index 54eacf5968..ab733b31be 100644 --- a/core/embed/rust/src/ui/model_tr/component/scrollbar.rs +++ b/core/embed/rust/src/ui/model_tr/component/scrollbar.rs @@ -51,7 +51,11 @@ impl ScrollBar { /// The width the scrollbar will really occupy. pub fn overall_width(&self) -> i16 { - Self::DOTS_INTERVAL * self.page_count as i16 - Self::DOTS_DISTANCE + if self.page_count <= MAX_DOTS { + Self::DOTS_INTERVAL * self.page_count as i16 - Self::DOTS_DISTANCE + } else { + Self::MAX_WIDTH + } } pub fn set_page_count(&mut self, page_count: usize) {