From 8a5afbe5854b87a369d408b5e59ffde433f9a1f0 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Sat, 30 Mar 2024 19:31:47 +0100 Subject: [PATCH] style(core): fix formatting [no changelog] --- core/embed/rust/src/ui/model_mercury/component/button.rs | 2 +- core/embed/rust/src/ui/model_mercury/component/fido.rs | 4 ++-- core/embed/rust/src/ui/model_mercury/layout.rs | 5 +---- core/embed/rust/src/ui/shape/mod.rs | 4 ++-- tests/input_flows.py | 2 +- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/core/embed/rust/src/ui/model_mercury/component/button.rs b/core/embed/rust/src/ui/model_mercury/component/button.rs index 0a44545735..dbb513aa0a 100644 --- a/core/embed/rust/src/ui/model_mercury/component/button.rs +++ b/core/embed/rust/src/ui/model_mercury/component/button.rs @@ -598,7 +598,7 @@ where } } pub fn render<'s>( - & self, + &self, target: &mut impl Renderer<'s>, area: Rect, style: &ButtonStyle, diff --git a/core/embed/rust/src/ui/model_mercury/component/fido.rs b/core/embed/rust/src/ui/model_mercury/component/fido.rs index 77450e9b78..4da615068e 100644 --- a/core/embed/rust/src/ui/model_mercury/component/fido.rs +++ b/core/embed/rust/src/ui/model_mercury/component/fido.rs @@ -75,7 +75,6 @@ where // let current_account = get_account(scrollbar.active_page); let current_account = "".into(); - Self { app_name: Label::centered(app_name, theme::TEXT_DEMIBOLD), account_name: Label::centered(current_account, theme::TEXT_DEMIBOLD), @@ -162,7 +161,8 @@ where // NOTE: This is a hotfix used due to the erroneous behavior of TextLayout. // This line should be removed when the problem with TextLayout is fixed. // See also the code for FidoConfirm::new(). - self.account_name.set_text((self.get_account)(self.scrollbar.active_page)); + self.account_name + .set_text((self.get_account)(self.scrollbar.active_page)); bounds } diff --git a/core/embed/rust/src/ui/model_mercury/layout.rs b/core/embed/rust/src/ui/model_mercury/layout.rs index d217ca171a..63075a631a 100644 --- a/core/embed/rust/src/ui/model_mercury/layout.rs +++ b/core/embed/rust/src/ui/model_mercury/layout.rs @@ -1336,10 +1336,7 @@ extern "C" fn new_show_tx_context_menu(n_args: usize, args: *const Obj, kwargs: let options: [(StrBuffer, Icon); 3] = [ (StrBuffer::from("Address QR code"), theme::ICON_QR_CODE), - ( - StrBuffer::from("Fee info"), - theme::ICON_CHEVRON_RIGHT, - ), + (StrBuffer::from("Fee info"), theme::ICON_CHEVRON_RIGHT), (StrBuffer::from("Cancel transaction"), theme::ICON_CANCEL), ]; let content = VerticalMenu::context_menu(options); diff --git a/core/embed/rust/src/ui/shape/mod.rs b/core/embed/rust/src/ui/shape/mod.rs index 38da6434ef..e448f4577f 100644 --- a/core/embed/rust/src/ui/shape/mod.rs +++ b/core/embed/rust/src/ui/shape/mod.rs @@ -6,13 +6,13 @@ mod blur; mod cache; mod canvas; mod circle; +mod corner_highlight; mod display; #[cfg(feature = "ui_jpeg_decoder")] mod jpeg; mod qrcode; mod rawimage; mod render; -mod corner_highlight; mod text; mod toif; mod utils; @@ -27,13 +27,13 @@ pub use canvas::{ BasicCanvas, Canvas, CanvasBuilder, Mono8Canvas, Rgb565Canvas, Rgba8888Canvas, Viewport, }; pub use circle::Circle; +pub use corner_highlight::CornerHighlight; pub use display::{render_on_canvas, render_on_display}; #[cfg(feature = "ui_jpeg_decoder")] pub use jpeg::JpegImage; pub use qrcode::QrImage; pub use rawimage::RawImage; pub use render::{DirectRenderer, ProgressiveRenderer, Renderer}; -pub use corner_highlight::CornerHighlight; pub use text::Text; pub use toif::ToifImage; #[cfg(feature = "model_mercury")] diff --git a/tests/input_flows.py b/tests/input_flows.py index 08a862a1ba..828c145e4f 100644 --- a/tests/input_flows.py +++ b/tests/input_flows.py @@ -950,7 +950,7 @@ class InputFlowLockTimeDatetime(InputFlowBase): def assert_func(self, debug: DebugLink, br: messages.ButtonRequest) -> None: layout_text = get_text_possible_pagination(debug, br) TR.assert_in(layout_text, "bitcoin__locktime_set_to") - assert self.lock_time_str.replace(' ', '') in layout_text.replace(' ', '') + assert self.lock_time_str.replace(" ", "") in layout_text.replace(" ", "") def input_flow_tt(self) -> BRGeneratorType: yield from lock_time_input_flow_tt(self.debug, self.assert_func)