1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 23:08:14 +00:00

chore(core/rust): drop unused ui_bounds

[no changelog]
This commit is contained in:
Martin Milata 2024-07-09 23:47:00 +02:00
parent 354dad617d
commit 7e26e1df15
65 changed files with 0 additions and 552 deletions

View File

@ -22,7 +22,6 @@ display_rgba8888 = ["ui_antialiasing"]
framebuffer = []
framebuffer32bit = []
ui_debug = []
ui_bounds = []
ui_antialiasing = []
ui_blurring = []
ui_jpeg_decoder = ["jpeg"]

View File

@ -112,7 +112,6 @@ static void _librust_qstrs(void) {
MP_QSTR_bitcoin__valid_signature;
MP_QSTR_bitcoin__voting_rights;
MP_QSTR_bootscreen;
MP_QSTR_bounds;
MP_QSTR_br_code;
MP_QSTR_br_type;
MP_QSTR_brightness__title;

View File

@ -47,11 +47,6 @@ impl Component for Bar {
.with_radius(self.radius)
.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -66,10 +66,6 @@ pub trait Component {
fn paint(&mut self);
fn render<'s>(&'s self, _target: &mut impl Renderer<'s>);
#[cfg(feature = "ui_bounds")]
/// Report current paint bounds of this component. Used for debugging.
fn bounds(&self, _sink: &mut dyn FnMut(Rect)) {}
}
/// Components should always avoid unnecessary overpaint to prevent obvious
@ -164,11 +160,6 @@ where
fn render<'s>(&'s self, target: &mut impl Renderer<'s>) {
self.component.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.component.bounds(sink)
}
}
impl<T: Paginate> Paginate for Child<T> {
@ -233,12 +224,6 @@ where
self.0.render(target);
self.1.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.0.bounds(sink);
self.1.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]
@ -288,13 +273,6 @@ where
self.1.render(target);
self.2.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.0.bounds(sink);
self.1.bounds(sink);
self.2.bounds(sink);
}
}
impl<T> Component for Option<T>
@ -328,13 +306,6 @@ where
_ => bounds.with_size(Offset::zero()),
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
if let Some(ref c) = self {
c.bounds(sink)
}
}
}
pub trait ComponentExt: Sized {

View File

@ -45,11 +45,6 @@ where
fn render<'s>(&'s self, target: &mut impl Renderer<'s>) {
self.inner.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.inner.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -73,11 +73,6 @@ impl Component for CachedJpeg {
)
.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -55,14 +55,6 @@ impl Component for Image {
.with_align(Alignment2D::CENTER)
.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(Rect::from_center_and_size(
self.area.center(),
self.toif.size(),
));
}
}
#[cfg(feature = "ui_debug")]
@ -146,14 +138,6 @@ impl Component for BlendedImage {
.with_fg(self.fg_color)
.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(Rect::from_top_left_and_size(
self.bg_top_left,
self.bg.toif.size(),
));
}
}
#[cfg(feature = "ui_debug")]

View File

@ -54,11 +54,6 @@ impl Component for Jpeg {
.with_scale(self.scale)
.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -143,11 +143,6 @@ impl Component for Label<'_> {
fn render<'s>(&'s self, target: &mut impl Renderer<'s>) {
self.text.map(|c| self.layout.render_text2(c, target));
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.layout.bounds)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -37,11 +37,6 @@ where
fn render<'s>(&'s self, target: &mut impl Renderer<'s>) {
self.inner.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.inner.bounds(sink);
}
}
#[cfg(all(feature = "micropython", feature = "touch", feature = "new_rendering"))]
@ -102,11 +97,6 @@ where
fn render<'s>(&'s self, target: &mut impl Renderer<'s>) {
self.inner.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.inner.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -101,12 +101,6 @@ where
self.inner.render(target);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.pad.area);
self.inner.bounds(sink);
}
}
pub trait PaintOverlapping {

View File

@ -175,11 +175,6 @@ impl Component for Qr {
.with_bg(DARK)
.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -137,11 +137,6 @@ impl Component for FormattedText {
fn render<'s>(&'s self, target: &mut impl Renderer<'s>) {
self.layout_content(&mut TextRenderer2::new(target));
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.op_layout.layout.bounds)
}
}
// DEBUG-ONLY SECTION BELOW

View File

@ -198,14 +198,6 @@ where
},
)
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
for layout in &self.visible {
sink(layout.bounds)
}
}
}
impl<'a, T> Paginate for Paragraphs<T>
@ -716,12 +708,6 @@ where
self.paragraphs.render(target);
self.render_left_column(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
self.paragraphs.bounds(sink);
}
}
impl<'a, T> Paginate for Checklist<T>

View File

@ -110,11 +110,6 @@ where
});
}
}
#[cfg(feature = "ui_bounds")]
fn obj_bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.bounds(sink)
}
}
#[derive(Copy, Clone, PartialEq, Eq)]
@ -300,21 +295,6 @@ impl LayoutObjInner {
fn obj_get_transition_out(&self) -> Obj {
self.transition_out.to_obj()
}
#[cfg(feature = "ui_debug")]
fn obj_bounds(&self) {
// Sink for `Trace::bounds` that draws the boundaries using pseudorandom color.
fn wireframe(r: Rect) {
let w = r.width() as u16;
let h = r.height() as u16;
let color = display::Color::from_u16(w.rotate_right(w.into()).wrapping_add(h * 8));
display::rect_stroke(r, color)
}
// use crate::ui::model_tt::theme;
// wireframe(theme::borders());
self.root().obj_bounds(&mut wireframe);
}
}
impl LayoutObj {
@ -346,7 +326,6 @@ impl LayoutObj {
Qstr::MP_QSTR_paint => obj_fn_1!(ui_layout_paint).as_obj(),
Qstr::MP_QSTR_request_complete_repaint => obj_fn_1!(ui_layout_request_complete_repaint).as_obj(),
Qstr::MP_QSTR_trace => obj_fn_2!(ui_layout_trace).as_obj(),
Qstr::MP_QSTR_bounds => obj_fn_1!(ui_layout_bounds).as_obj(),
Qstr::MP_QSTR___del__ => obj_fn_1!(ui_layout_delete).as_obj(),
Qstr::MP_QSTR_page_count => obj_fn_1!(ui_layout_page_count).as_obj(),
Qstr::MP_QSTR_button_request => obj_fn_1!(ui_layout_button_request).as_obj(),
@ -582,21 +561,6 @@ extern "C" fn ui_layout_trace(_this: Obj, _callback: Obj) -> Obj {
Obj::const_none()
}
#[cfg(feature = "ui_bounds")]
extern "C" fn ui_layout_bounds(this: Obj) -> Obj {
let block = || {
let this: Gc<LayoutObj> = this.try_into()?;
this.inner_mut().obj_bounds();
Ok(Obj::const_none())
};
unsafe { util::try_or_raise(block) }
}
#[cfg(not(feature = "ui_bounds"))]
extern "C" fn ui_layout_bounds(_this: Obj) -> Obj {
Obj::const_none()
}
extern "C" fn ui_layout_delete(this: Obj) -> Obj {
let block = || {
let this: Gc<LayoutObj> = this.try_into()?;

View File

@ -115,9 +115,4 @@ impl<'a> Component for Intro<'a> {
self.host.render(target);
self.menu.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.menu.bounds(sink);
}
}

View File

@ -116,11 +116,4 @@ impl Component for Menu {
self.reboot.render(target);
self.reset.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.close.bounds(sink);
self.reboot.bounds(sink);
self.reset.bounds(sink);
}
}

View File

@ -188,14 +188,6 @@ impl Component for AddressDetails {
_ => self.xpub_view.render(target),
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
match self.current_page {
0 => self.details.bounds(sink),
_ => self.xpub_view.bounds(sink),
}
}
}
impl Swipable for AddressDetails {

View File

@ -274,12 +274,6 @@ impl Component for Confirm<'_> {
}
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.left_button.bounds(sink);
self.right_button.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -438,11 +438,6 @@ impl Component for Button {
self.render_background(target, style, 0xFF);
self.render_content(target, style, 0xFF);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -240,13 +240,6 @@ where
display::fade_backlight(theme::backlight::get_backlight_normal());
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.icon.bounds(sink);
self.app_name.bounds(sink);
self.account_name.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -242,11 +242,6 @@ impl<'a> Component for Footer<'a> {
.render(target);
});
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -347,15 +347,6 @@ where
}
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.title.bounds(sink);
self.subtitle.bounds(sink);
self.button.bounds(sink);
self.footer.bounds(sink);
self.content.bounds(sink);
}
}
#[cfg(feature = "micropython")]

View File

@ -439,12 +439,6 @@ impl Component for Homescreen {
}
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.loader.bounds(sink);
sink(AREA);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -165,11 +165,6 @@ impl Component for Bip39Input {
render_pending_marker(target, text_base, text, style.font, style.text_color);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.button.bounds(sink);
}
}
impl Bip39Input {

View File

@ -223,17 +223,6 @@ where
btn.render(target);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.prompt.bounds(sink);
self.input.bounds(sink);
self.erase.bounds(sink);
self.back.bounds(sink);
for btn in &self.keys {
btn.bounds(sink)
}
}
}
pub trait MnemonicInput: Component<Msg = MnemonicInputMsg> {

View File

@ -390,18 +390,6 @@ impl Component for PassphraseKeyboard {
display::fade_backlight(theme::backlight::get_backlight_normal());
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.input.bounds(sink);
self.input_prompt.bounds(sink);
self.confirm_btn.bounds(sink);
self.erase_btn.bounds(sink);
self.cancel_btn.bounds(sink);
for btn in &self.keys {
btn.bounds(sink)
}
}
}
struct Input {
@ -469,11 +457,6 @@ impl Component for Input {
);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -260,19 +260,6 @@ impl Component for PinKeyboard<'_> {
btn.render(target);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.major_prompt.bounds(sink);
self.minor_prompt.bounds(sink);
self.erase_btn.bounds(sink);
self.cancel_btn.bounds(sink);
self.confirm_btn.bounds(sink);
self.textbox.bounds(sink);
for b in &self.digit_btns {
b.bounds(sink)
}
}
}
struct PinDots {
@ -443,12 +430,6 @@ impl Component for PinDots {
self.render_dots(dot_area, target)
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
sink(self.area.inset(HEADER_PADDING));
}
}
#[cfg(feature = "ui_debug")]

View File

@ -190,11 +190,6 @@ impl Component for Slip39Input {
);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.button.bounds(sink);
}
}
impl Slip39Input {

View File

@ -72,13 +72,6 @@ impl Component for SelectWordCount {
btn.render(target)
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
for btn in self.button.iter() {
btn.bounds(sink)
}
}
}
#[cfg(feature = "ui_debug")]

View File

@ -106,13 +106,6 @@ where
self.paragraphs_pad.render(target);
self.paragraphs.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
self.input.bounds(sink);
self.paragraphs.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]
@ -214,13 +207,6 @@ impl Component for NumberInput {
self.dec.render(target);
self.inc.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.dec.bounds(sink);
self.inc.bounds(sink);
sink(self.area)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -109,14 +109,6 @@ impl Component for NumberInputSliderDialog {
self.cancel_button.render(target);
self.confirm_button.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
self.input.bounds(sink);
self.cancel_button.bounds(sink);
self.confirm_button.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]
@ -215,11 +207,6 @@ impl Component for NumberInputSlider {
.with_bg(theme::FG)
.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -145,13 +145,6 @@ impl Component for Progress {
self.description_pad.render(target);
self.description.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(Self::AREA);
self.title.bounds(sink);
self.description.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -171,9 +171,4 @@ impl Component for ScrollBar {
self.area = bounds;
bounds
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
}
}

View File

@ -58,11 +58,6 @@ impl Component for SetBrightnessDialog {
fn render<'s>(&'s self, target: &mut impl Renderer<'s>) {
self.0.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.0.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -106,9 +106,6 @@ impl<'a> Component for ShareWords<'a> {
fn render<'s>(&'s self, target: &mut impl Renderer<'s>) {
self.frame.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, _sink: &mut dyn FnMut(Rect)) {}
}
#[cfg(feature = "micropython")]
@ -293,9 +290,6 @@ impl<'a> Component for ShareWordsInner<'a> {
self.render_word(self.page_index, target, self.area_word);
};
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, _sink: &mut dyn FnMut(Rect)) {}
}
impl InternallySwipable for ShareWordsInner<'_> {

View File

@ -70,11 +70,6 @@ impl<T: Swipable + Component> Component for SwipeUpScreen<T> {
fn render<'s>(&'s self, target: &mut impl Renderer<'s>) {
self.content.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.content.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -308,11 +308,6 @@ impl Component for VerticalMenu {
.render(target);
});
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -126,12 +126,4 @@ impl<'a> Component for Intro<'a> {
self.text.render(target);
self.buttons.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.title.bounds(sink);
self.warn.bounds(sink);
self.text.bounds(sink);
self.buttons.bounds(sink);
}
}

View File

@ -188,9 +188,4 @@ impl Component for Menu {
self.pad.render(target);
self.choice_page.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.choice_page.bounds(sink)
}
}

View File

@ -269,11 +269,6 @@ impl Component for AddressDetails {
_ => self.xpub_view.render(target),
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -243,11 +243,6 @@ impl Component for Confirm<'_> {
}
self.buttons.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.buttons.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -176,13 +176,6 @@ impl Component for Progress {
self.description_pad.render(target);
self.description.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(Self::AREA);
self.title.bounds(sink);
self.description.bounds(sink);
}
}
// DEBUG-ONLY SECTION BELOW

View File

@ -114,9 +114,4 @@ impl<'a> Component for Intro<'a> {
self.host.render(target);
self.menu.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.menu.bounds(sink);
}
}

View File

@ -116,11 +116,4 @@ impl Component for Menu {
self.reboot.render(target);
self.reset.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.close.bounds(sink);
self.reboot.bounds(sink);
self.reset.bounds(sink);
}
}

View File

@ -184,15 +184,6 @@ impl Component for AddressDetails {
_ => self.xpub_view.render(target),
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
match self.current_page {
0 => self.qr_code.bounds(sink),
1 => self.details.bounds(sink),
_ => self.xpub_view.bounds(sink),
}
}
}
#[cfg(feature = "ui_debug")]

View File

@ -272,12 +272,6 @@ impl Component for Confirm<'_> {
}
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.left_button.bounds(sink);
self.right_button.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -382,11 +382,6 @@ impl Component for Button {
self.render_background(target, style);
self.render_content(target, style);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -76,12 +76,6 @@ where
self.content.render(target);
self.controls.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.content.bounds(sink);
self.controls.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]
@ -207,13 +201,6 @@ where
self.paragraphs.render(target);
self.controls.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.image.bounds(sink);
self.paragraphs.bounds(sink);
self.controls.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -242,13 +242,6 @@ where
display::fade_backlight(theme::backlight::get_backlight_normal());
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.icon.bounds(sink);
self.app_name.bounds(sink);
self.account_name.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -182,14 +182,6 @@ where
self.button.render(target);
self.content.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.title.bounds(sink);
self.subtitle.bounds(sink);
self.button.bounds(sink);
self.content.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -337,12 +337,6 @@ impl Component for Homescreen {
}
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.loader.bounds(sink);
sink(self.pad.area);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -199,11 +199,6 @@ impl Component for Bip39Input {
.render(target);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.button.bounds(sink);
}
}
impl Bip39Input {

View File

@ -196,16 +196,6 @@ where
btn.render(target);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.prompt.bounds(sink);
self.input.bounds(sink);
self.back.bounds(sink);
for btn in &self.keys {
btn.bounds(sink)
}
}
}
pub trait MnemonicInput: Component<Msg = MnemonicInputMsg> {

View File

@ -314,17 +314,6 @@ impl Component for PassphraseKeyboard {
display::fade_backlight(theme::backlight::get_backlight_normal());
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.input.bounds(sink);
self.scrollbar.bounds(sink);
self.confirm.bounds(sink);
self.back.bounds(sink);
for btn in &self.keys {
btn.bounds(sink)
}
}
}
struct Input {
@ -428,11 +417,6 @@ impl Component for Input {
);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -286,19 +286,6 @@ impl Component for PinKeyboard<'_> {
btn.render(target);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.major_prompt.bounds(sink);
self.minor_prompt.bounds(sink);
self.erase_btn.bounds(sink);
self.cancel_btn.bounds(sink);
self.confirm_btn.bounds(sink);
self.textbox.bounds(sink);
for b in &self.digit_btns {
b.bounds(sink)
}
}
}
struct PinDots {
@ -542,12 +529,6 @@ impl Component for PinDots {
self.render_dots(dot_area, target)
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
sink(self.area.inset(HEADER_PADDING));
}
}
#[cfg(feature = "ui_debug")]

View File

@ -249,11 +249,6 @@ impl Component for Slip39Input {
.render(target);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.button.bounds(sink);
}
}
impl Slip39Input {

View File

@ -63,13 +63,6 @@ impl Component for SelectWordCount {
btn.render(target)
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
for btn in self.button.iter() {
btn.bounds(sink)
}
}
}
#[cfg(feature = "ui_debug")]

View File

@ -128,15 +128,6 @@ where
self.info_button.render(target);
self.confirm_button.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
self.input.bounds(sink);
self.paragraphs.bounds(sink);
self.info_button.bounds(sink);
self.confirm_button.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]
@ -254,13 +245,6 @@ impl Component for NumberInput {
self.dec.render(target);
self.inc.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.dec.bounds(sink);
self.inc.bounds(sink);
sink(self.area)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -83,14 +83,6 @@ impl Component for NumberInputSliderDialog {
self.cancel_button.render(target);
self.confirm_button.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
self.input.bounds(sink);
self.cancel_button.bounds(sink);
self.confirm_button.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]
@ -189,11 +181,6 @@ impl Component for NumberInputSlider {
.with_bg(theme::FG)
.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area)
}
}
#[cfg(feature = "ui_debug")]

View File

@ -445,17 +445,6 @@ where
display::fade_backlight(val);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.pad.area);
self.scrollbar.bounds(sink);
self.content.bounds(sink);
self.button_cancel.bounds(sink);
self.button_confirm.bounds(sink);
self.button_prev.bounds(sink);
self.button_next.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -148,13 +148,6 @@ impl Component for Progress {
self.description_pad.render(target);
self.description.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(Self::AREA);
self.title.bounds(sink);
self.description.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -171,9 +171,4 @@ impl Component for ScrollBar {
self.area = bounds;
bounds
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.area);
}
}

View File

@ -58,11 +58,6 @@ impl Component for SetBrightnessDialog {
fn render<'s>(&'s self, target: &mut impl Renderer<'s>) {
self.0.render(target);
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
self.0.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]

View File

@ -178,13 +178,6 @@ where
display::fade_backlight(val);
}
}
#[cfg(feature = "ui_bounds")]
fn bounds(&self, sink: &mut dyn FnMut(Rect)) {
sink(self.pad.area);
self.scrollbar.bounds(sink);
self.content.bounds(sink);
}
}
#[cfg(feature = "ui_debug")]