diff --git a/core/.changelog.d/4302.added.2 b/core/.changelog.d/4302.added.2 new file mode 100644 index 0000000000..2cbb8c20ac --- /dev/null +++ b/core/.changelog.d/4302.added.2 @@ -0,0 +1 @@ +[T3T1] Add margin to the first page of a blob. diff --git a/core/embed/rust/librust_qstr.h b/core/embed/rust/librust_qstr.h index 4606af2843..8c8aa915c5 100644 --- a/core/embed/rust/librust_qstr.h +++ b/core/embed/rust/librust_qstr.h @@ -194,6 +194,7 @@ static void _librust_qstrs(void) { MP_QSTR_confirm_address; MP_QSTR_confirm_backup; MP_QSTR_confirm_blob; + MP_QSTR_confirm_blob_intro; MP_QSTR_confirm_coinjoin; MP_QSTR_confirm_emphasized; MP_QSTR_confirm_fido; @@ -359,7 +360,6 @@ static void _librust_qstrs(void) { MP_QSTR_notification_level; MP_QSTR_page_count; MP_QSTR_page_counter; - MP_QSTR_page_limit; MP_QSTR_pages; MP_QSTR_paint; MP_QSTR_passphrase__access_wallet; diff --git a/core/embed/rust/src/ui/model_mercury/component/frame.rs b/core/embed/rust/src/ui/model_mercury/component/frame.rs index 32719551a7..9857265ec4 100644 --- a/core/embed/rust/src/ui/model_mercury/component/frame.rs +++ b/core/embed/rust/src/ui/model_mercury/component/frame.rs @@ -89,6 +89,7 @@ pub struct Frame { swipe: SwipeConfig, internal_page_cnt: usize, horizontal_swipe: HorizontalSwipe, + margin: usize, } pub enum FrameMsg { @@ -111,6 +112,7 @@ where swipe: SwipeConfig::new(), internal_page_cnt: 1, horizontal_swipe: HorizontalSwipe::new(), + margin: 0, } } @@ -262,12 +264,18 @@ where ..self } } + pub fn with_vertical_pages(self) -> Self { Self { swipe: self.swipe.with_vertical_pages(), ..self } } + + pub fn with_margin(mut self, margin: usize) -> Self { + self.margin = margin; + self + } } impl Component for Frame @@ -278,7 +286,7 @@ where fn place(&mut self, bounds: Rect) -> Rect { self.bounds = bounds; - let content_area = frame_place(&mut self.header, &mut self.footer, bounds); + let content_area = frame_place(&mut self.header, &mut self.footer, bounds, self.margin); self.content.place(content_area); @@ -347,9 +355,16 @@ fn frame_event( header.event(ctx, event) } -fn frame_place(header: &mut Header, footer: &mut Option