From e60ed788f2e693d9c64ed5fcbc98a905760706fc Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Tue, 21 Mar 2023 23:32:43 +0100 Subject: [PATCH] fix(core/rust/ui): add cargo flag for Component::bounds() support Rarely used debugging feature. [no changelog] --- core/embed/rust/Cargo.toml | 1 + core/embed/rust/src/ui/component/base.rs | 5 +++++ core/embed/rust/src/ui/component/border.rs | 1 + core/embed/rust/src/ui/component/image.rs | 2 ++ core/embed/rust/src/ui/component/label.rs | 1 + core/embed/rust/src/ui/component/map.rs | 1 + core/embed/rust/src/ui/component/maybe.rs | 1 + core/embed/rust/src/ui/component/painter.rs | 1 + core/embed/rust/src/ui/component/qr_code.rs | 1 + core/embed/rust/src/ui/component/text/formatted.rs | 1 + core/embed/rust/src/ui/component/text/paragraphs.rs | 2 ++ core/embed/rust/src/ui/layout/obj.rs | 7 ++++--- core/embed/rust/src/ui/model_tt/bootloader/confirm.rs | 1 + core/embed/rust/src/ui/model_tt/bootloader/intro.rs | 1 + core/embed/rust/src/ui/model_tt/bootloader/menu.rs | 1 + .../rust/src/ui/model_tt/component/address_details.rs | 1 + core/embed/rust/src/ui/model_tt/component/button.rs | 1 + core/embed/rust/src/ui/model_tt/component/dialog.rs | 2 ++ core/embed/rust/src/ui/model_tt/component/fido.rs | 1 + core/embed/rust/src/ui/model_tt/component/frame.rs | 2 ++ .../rust/src/ui/model_tt/component/hold_to_confirm.rs | 2 ++ .../embed/rust/src/ui/model_tt/component/homescreen/mod.rs | 1 + .../rust/src/ui/model_tt/component/horizontal_page.rs | 1 + .../embed/rust/src/ui/model_tt/component/keyboard/bip39.rs | 1 + .../rust/src/ui/model_tt/component/keyboard/mnemonic.rs | 1 + .../rust/src/ui/model_tt/component/keyboard/passphrase.rs | 2 ++ core/embed/rust/src/ui/model_tt/component/keyboard/pin.rs | 2 ++ .../rust/src/ui/model_tt/component/keyboard/slip39.rs | 1 + .../rust/src/ui/model_tt/component/keyboard/word_count.rs | 1 + core/embed/rust/src/ui/model_tt/component/number_input.rs | 2 ++ core/embed/rust/src/ui/model_tt/component/page.rs | 2 ++ core/embed/rust/src/ui/model_tt/component/progress.rs | 1 + core/embed/rust/src/ui/model_tt/component/scroll.rs | 1 + 33 files changed, 49 insertions(+), 3 deletions(-) diff --git a/core/embed/rust/Cargo.toml b/core/embed/rust/Cargo.toml index 9c191f76f..067866180 100644 --- a/core/embed/rust/Cargo.toml +++ b/core/embed/rust/Cargo.toml @@ -15,6 +15,7 @@ protobuf = ["micropython"] ui = [] dma2d = [] ui_debug = [] +ui_bounds = [] bootloader = [] buttons = [] touch = [] diff --git a/core/embed/rust/src/ui/component/base.rs b/core/embed/rust/src/ui/component/base.rs index fed6b792d..18eef12d6 100644 --- a/core/embed/rust/src/ui/component/base.rs +++ b/core/embed/rust/src/ui/component/base.rs @@ -54,6 +54,7 @@ pub trait Component { /// the `Child` wrapper. fn paint(&mut self); + #[cfg(feature = "ui_bounds")] /// Report current paint bounds of this component. Used for debugging. fn bounds(&self, _sink: &mut dyn FnMut(Rect)) {} } @@ -146,6 +147,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.component.bounds(sink) } @@ -199,6 +201,7 @@ where self.1.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.0.bounds(sink); self.1.bounds(sink); @@ -249,6 +252,7 @@ where self.2.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.0.bounds(sink); self.1.bounds(sink); @@ -301,6 +305,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { if let Some(ref c) = self { c.bounds(sink) diff --git a/core/embed/rust/src/ui/component/border.rs b/core/embed/rust/src/ui/component/border.rs index deab16da1..e61cf381a 100644 --- a/core/embed/rust/src/ui/component/border.rs +++ b/core/embed/rust/src/ui/component/border.rs @@ -39,6 +39,7 @@ where self.inner.paint() } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.inner.bounds(sink); } diff --git a/core/embed/rust/src/ui/component/image.rs b/core/embed/rust/src/ui/component/image.rs index 9c2de5ffd..d3a0efcd2 100644 --- a/core/embed/rust/src/ui/component/image.rs +++ b/core/embed/rust/src/ui/component/image.rs @@ -48,6 +48,7 @@ impl Component for Image { self.draw(self.area.center(), CENTER); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(Rect::from_center_and_size( self.area.center(), @@ -123,6 +124,7 @@ impl Component for BlendedImage { self.paint_image(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(Rect::from_top_left_and_size( self.bg_top_left, diff --git a/core/embed/rust/src/ui/component/label.rs b/core/embed/rust/src/ui/component/label.rs index f49097ce4..ff36d3b67 100644 --- a/core/embed/rust/src/ui/component/label.rs +++ b/core/embed/rust/src/ui/component/label.rs @@ -80,6 +80,7 @@ where self.layout.render_text(self.text.as_ref()); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.layout.bounds) } diff --git a/core/embed/rust/src/ui/component/map.rs b/core/embed/rust/src/ui/component/map.rs index 9e271b8f1..8902f2300 100644 --- a/core/embed/rust/src/ui/component/map.rs +++ b/core/embed/rust/src/ui/component/map.rs @@ -31,6 +31,7 @@ where self.inner.paint() } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.inner.bounds(sink); } diff --git a/core/embed/rust/src/ui/component/maybe.rs b/core/embed/rust/src/ui/component/maybe.rs index 0c9f101c3..0d7ce4f8e 100644 --- a/core/embed/rust/src/ui/component/maybe.rs +++ b/core/embed/rust/src/ui/component/maybe.rs @@ -93,6 +93,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.pad.area); self.inner.bounds(sink); diff --git a/core/embed/rust/src/ui/component/painter.rs b/core/embed/rust/src/ui/component/painter.rs index 72650b385..5946a110d 100644 --- a/core/embed/rust/src/ui/component/painter.rs +++ b/core/embed/rust/src/ui/component/painter.rs @@ -39,6 +39,7 @@ where (self.func)(self.area); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.area) } diff --git a/core/embed/rust/src/ui/component/qr_code.rs b/core/embed/rust/src/ui/component/qr_code.rs index 5b8d5e493..d660f2368 100644 --- a/core/embed/rust/src/ui/component/qr_code.rs +++ b/core/embed/rust/src/ui/component/qr_code.rs @@ -141,6 +141,7 @@ impl Component for Qr { Self::draw(&qr, area, self.border, scale); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.area) } diff --git a/core/embed/rust/src/ui/component/text/formatted.rs b/core/embed/rust/src/ui/component/text/formatted.rs index 69017662d..d7096a068 100644 --- a/core/embed/rust/src/ui/component/text/formatted.rs +++ b/core/embed/rust/src/ui/component/text/formatted.rs @@ -138,6 +138,7 @@ where self.layout_content(&mut TextRenderer); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.layout.bounds) } diff --git a/core/embed/rust/src/ui/component/text/paragraphs.rs b/core/embed/rust/src/ui/component/text/paragraphs.rs index 61788756f..a906cf4e8 100644 --- a/core/embed/rust/src/ui/component/text/paragraphs.rs +++ b/core/embed/rust/src/ui/component/text/paragraphs.rs @@ -201,6 +201,7 @@ where ) } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.area); for layout in &self.visible { @@ -595,6 +596,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.area); self.paragraphs.bounds(sink); diff --git a/core/embed/rust/src/ui/layout/obj.rs b/core/embed/rust/src/ui/layout/obj.rs index 4f6c82462..4c7d2dc0c 100644 --- a/core/embed/rust/src/ui/layout/obj.rs +++ b/core/embed/rust/src/ui/layout/obj.rs @@ -64,7 +64,7 @@ pub trait ObjComponent: MaybeTrace { fn obj_place(&mut self, bounds: Rect) -> Rect; fn obj_event(&mut self, ctx: &mut EventCtx, event: Event) -> Result; fn obj_paint(&mut self) -> bool; - fn obj_bounds(&self, sink: &mut dyn FnMut(Rect)); + fn obj_bounds(&self, _sink: &mut dyn FnMut(Rect)) {} fn obj_skip_paint(&mut self) {} } @@ -90,6 +90,7 @@ where will_paint } + #[cfg(feature = "ui_bounds")] fn obj_bounds(&self, sink: &mut dyn FnMut(Rect)) { self.bounds(sink) } @@ -509,7 +510,7 @@ extern "C" fn ui_layout_trace(_this: Obj, _callback: Obj) -> Obj { Obj::const_none() } -#[cfg(feature = "ui_debug")] +#[cfg(feature = "ui_bounds")] extern "C" fn ui_layout_bounds(this: Obj) -> Obj { let block = || { let this: Gc = this.try_into()?; @@ -519,7 +520,7 @@ extern "C" fn ui_layout_bounds(this: Obj) -> Obj { unsafe { util::try_or_raise(block) } } -#[cfg(not(feature = "ui_debug"))] +#[cfg(not(feature = "ui_bounds"))] extern "C" fn ui_layout_bounds(_this: Obj) -> Obj { Obj::const_none() } diff --git a/core/embed/rust/src/ui/model_tt/bootloader/confirm.rs b/core/embed/rust/src/ui/model_tt/bootloader/confirm.rs index af38bf7e3..e86aca6ad 100644 --- a/core/embed/rust/src/ui/model_tt/bootloader/confirm.rs +++ b/core/embed/rust/src/ui/model_tt/bootloader/confirm.rs @@ -188,6 +188,7 @@ impl<'a> Component for Confirm<'a> { } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.left.bounds(sink); self.right.bounds(sink); diff --git a/core/embed/rust/src/ui/model_tt/bootloader/intro.rs b/core/embed/rust/src/ui/model_tt/bootloader/intro.rs index fabbc93e2..e275e152d 100644 --- a/core/embed/rust/src/ui/model_tt/bootloader/intro.rs +++ b/core/embed/rust/src/ui/model_tt/bootloader/intro.rs @@ -94,6 +94,7 @@ impl<'a> Component for Intro<'a> { self.menu.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.menu.bounds(sink); } diff --git a/core/embed/rust/src/ui/model_tt/bootloader/menu.rs b/core/embed/rust/src/ui/model_tt/bootloader/menu.rs index aa2e30510..820bc234a 100644 --- a/core/embed/rust/src/ui/model_tt/bootloader/menu.rs +++ b/core/embed/rust/src/ui/model_tt/bootloader/menu.rs @@ -98,6 +98,7 @@ impl Component for Menu { self.reset.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.close.bounds(sink); self.reboot.bounds(sink); diff --git a/core/embed/rust/src/ui/model_tt/component/address_details.rs b/core/embed/rust/src/ui/model_tt/component/address_details.rs index 0c3f6a760..7f11e12ad 100644 --- a/core/embed/rust/src/ui/model_tt/component/address_details.rs +++ b/core/embed/rust/src/ui/model_tt/component/address_details.rs @@ -181,6 +181,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { match self.current_page { 0 => self.qr_code.bounds(sink), diff --git a/core/embed/rust/src/ui/model_tt/component/button.rs b/core/embed/rust/src/ui/model_tt/component/button.rs index ad9df2392..d23131c6b 100644 --- a/core/embed/rust/src/ui/model_tt/component/button.rs +++ b/core/embed/rust/src/ui/model_tt/component/button.rs @@ -314,6 +314,7 @@ where self.paint_content(style); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.area); } diff --git a/core/embed/rust/src/ui/model_tt/component/dialog.rs b/core/embed/rust/src/ui/model_tt/component/dialog.rs index 9ce53ddc5..833597053 100644 --- a/core/embed/rust/src/ui/model_tt/component/dialog.rs +++ b/core/embed/rust/src/ui/model_tt/component/dialog.rs @@ -71,6 +71,7 @@ where self.controls.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.content.bounds(sink); self.controls.bounds(sink); @@ -192,6 +193,7 @@ where self.controls.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.image.bounds(sink); self.paragraphs.bounds(sink); diff --git a/core/embed/rust/src/ui/model_tt/component/fido.rs b/core/embed/rust/src/ui/model_tt/component/fido.rs index 923d932bc..dc336c6da 100644 --- a/core/embed/rust/src/ui/model_tt/component/fido.rs +++ b/core/embed/rust/src/ui/model_tt/component/fido.rs @@ -191,6 +191,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.icon.bounds(sink); self.app_name.bounds(sink); diff --git a/core/embed/rust/src/ui/model_tt/component/frame.rs b/core/embed/rust/src/ui/model_tt/component/frame.rs index 43ffeab87..b6f9fa9d1 100644 --- a/core/embed/rust/src/ui/model_tt/component/frame.rs +++ b/core/embed/rust/src/ui/model_tt/component/frame.rs @@ -152,6 +152,7 @@ where self.content.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.title.bounds(sink); self.button.bounds(sink); @@ -242,6 +243,7 @@ where self.content.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.area); self.content.bounds(sink); diff --git a/core/embed/rust/src/ui/model_tt/component/hold_to_confirm.rs b/core/embed/rust/src/ui/model_tt/component/hold_to_confirm.rs index 2524878ad..f83919f7e 100644 --- a/core/embed/rust/src/ui/model_tt/component/hold_to_confirm.rs +++ b/core/embed/rust/src/ui/model_tt/component/hold_to_confirm.rs @@ -91,6 +91,7 @@ where self.buttons.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.pad.area); if self.loader.is_animating() { @@ -171,6 +172,7 @@ impl Component for CancelHold { self.hold.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.cancel.bounds(sink); self.hold.bounds(sink); diff --git a/core/embed/rust/src/ui/model_tt/component/homescreen/mod.rs b/core/embed/rust/src/ui/model_tt/component/homescreen/mod.rs index 9921efa4a..7b5ccd53c 100644 --- a/core/embed/rust/src/ui/model_tt/component/homescreen/mod.rs +++ b/core/embed/rust/src/ui/model_tt/component/homescreen/mod.rs @@ -212,6 +212,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.loader.bounds(sink); sink(self.pad.area); 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 e6ee842f5..6f5dee02e 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 @@ -124,6 +124,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.pad.area); self.scrollbar.bounds(sink); diff --git a/core/embed/rust/src/ui/model_tt/component/keyboard/bip39.rs b/core/embed/rust/src/ui/model_tt/component/keyboard/bip39.rs index 31601df79..68b86866d 100644 --- a/core/embed/rust/src/ui/model_tt/component/keyboard/bip39.rs +++ b/core/embed/rust/src/ui/model_tt/component/keyboard/bip39.rs @@ -144,6 +144,7 @@ impl Component for Bip39Input { } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.button.bounds(sink); } diff --git a/core/embed/rust/src/ui/model_tt/component/keyboard/mnemonic.rs b/core/embed/rust/src/ui/model_tt/component/keyboard/mnemonic.rs index cf5aeb912..9b725b083 100644 --- a/core/embed/rust/src/ui/model_tt/component/keyboard/mnemonic.rs +++ b/core/embed/rust/src/ui/model_tt/component/keyboard/mnemonic.rs @@ -163,6 +163,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.prompt.bounds(sink); self.input.bounds(sink); diff --git a/core/embed/rust/src/ui/model_tt/component/keyboard/passphrase.rs b/core/embed/rust/src/ui/model_tt/component/keyboard/passphrase.rs index 7e0995e10..dd68aff7d 100644 --- a/core/embed/rust/src/ui/model_tt/component/keyboard/passphrase.rs +++ b/core/embed/rust/src/ui/model_tt/component/keyboard/passphrase.rs @@ -264,6 +264,7 @@ impl Component for PassphraseKeyboard { } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.input.bounds(sink); self.scrollbar.bounds(sink); @@ -367,6 +368,7 @@ impl Component for Input { } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.area) } diff --git a/core/embed/rust/src/ui/model_tt/component/keyboard/pin.rs b/core/embed/rust/src/ui/model_tt/component/keyboard/pin.rs index 2301e2d7e..632856dca 100644 --- a/core/embed/rust/src/ui/model_tt/component/keyboard/pin.rs +++ b/core/embed/rust/src/ui/model_tt/component/keyboard/pin.rs @@ -270,6 +270,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.major_prompt.bounds(sink); self.minor_prompt.bounds(sink); @@ -454,6 +455,7 @@ impl Component for PinDots { } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.area); sink(self.area.inset(HEADER_PADDING)); diff --git a/core/embed/rust/src/ui/model_tt/component/keyboard/slip39.rs b/core/embed/rust/src/ui/model_tt/component/keyboard/slip39.rs index 3cd3aa6ba..a37e2f036 100644 --- a/core/embed/rust/src/ui/model_tt/component/keyboard/slip39.rs +++ b/core/embed/rust/src/ui/model_tt/component/keyboard/slip39.rs @@ -178,6 +178,7 @@ impl Component for Slip39Input { } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.button.bounds(sink); } diff --git a/core/embed/rust/src/ui/model_tt/component/keyboard/word_count.rs b/core/embed/rust/src/ui/model_tt/component/keyboard/word_count.rs index 356241993..6d4dad3d8 100644 --- a/core/embed/rust/src/ui/model_tt/component/keyboard/word_count.rs +++ b/core/embed/rust/src/ui/model_tt/component/keyboard/word_count.rs @@ -57,6 +57,7 @@ impl Component for SelectWordCount { } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { for btn in self.button.iter() { btn.bounds(sink) diff --git a/core/embed/rust/src/ui/model_tt/component/number_input.rs b/core/embed/rust/src/ui/model_tt/component/number_input.rs index 7637e2e8b..e0158b5c4 100644 --- a/core/embed/rust/src/ui/model_tt/component/number_input.rs +++ b/core/embed/rust/src/ui/model_tt/component/number_input.rs @@ -118,6 +118,7 @@ where self.confirm_button.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.area); self.input.bounds(sink); @@ -226,6 +227,7 @@ impl Component for NumberInput { self.inc.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.dec.bounds(sink); self.inc.bounds(sink); diff --git a/core/embed/rust/src/ui/model_tt/component/page.rs b/core/embed/rust/src/ui/model_tt/component/page.rs index 0fd703084..002c3ecf6 100644 --- a/core/embed/rust/src/ui/model_tt/component/page.rs +++ b/core/embed/rust/src/ui/model_tt/component/page.rs @@ -279,6 +279,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.pad.area); self.scrollbar.bounds(sink); @@ -458,6 +459,7 @@ where } } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { self.loader.bounds(sink); self.inner.bounds(sink); diff --git a/core/embed/rust/src/ui/model_tt/component/progress.rs b/core/embed/rust/src/ui/model_tt/component/progress.rs index 344410575..758589f8c 100644 --- a/core/embed/rust/src/ui/model_tt/component/progress.rs +++ b/core/embed/rust/src/ui/model_tt/component/progress.rs @@ -119,6 +119,7 @@ where self.description.paint(); } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(Self::AREA); self.title.bounds(sink); diff --git a/core/embed/rust/src/ui/model_tt/component/scroll.rs b/core/embed/rust/src/ui/model_tt/component/scroll.rs index e96715170..0f33c49bf 100644 --- a/core/embed/rust/src/ui/model_tt/component/scroll.rs +++ b/core/embed/rust/src/ui/model_tt/component/scroll.rs @@ -120,6 +120,7 @@ impl Component for ScrollBar { bounds } + #[cfg(feature = "ui_bounds")] fn bounds(&self, sink: &mut dyn FnMut(Rect)) { sink(self.area); }