style(core/rust): apply uniform import grouping
What changed, and why it matters
This is a purely cosmetic code-style commit. It runs the project's Rust formatter across hundreds of files, changing only how import statements are grouped and how long comments are wrapped. No program logic, security behavior, or functionality was altered.
No security action needed. This is a style-only change; normal code-review and CI verification are sufficient.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit applies make ruststyle (rustfmt) across the Rust codebase. All changes are whitespace, import re-ordering/re-grouping, and comment wrapping. There are no semantic code changes, no new dependencies, no unsafe additions, and no changes to crypto, storage, UI flow, or bootloader logic beyond formatting.
Changed components
Inspect captured patch +3670 / −5417
diff --git a/core/embed/io/touch/build.rs b/core/embed/io/touch/build.rs
index b6808735..21cf8765 100644
--- a/core/embed/io/touch/build.rs
+++ b/core/embed/io/touch/build.rs
@@ -50,8 +50,8 @@ pub fn def_module(lib: &mut CLibrary) -> Result<()> {
// -------------------------------------------------------------------------
fn set_panel_t2t1(_lib: &mut CLibrary) {
- // The T2T1 panel needs no touch coordinate correction; the driver falls back
- // to identity mapping when no TOUCH_PANEL_* macro is defined.
+ // The T2T1 panel needs no touch coordinate correction; the driver falls
+ // back to identity mapping when no TOUCH_PANEL_* macro is defined.
}
fn set_panel_lx154a2422cpt23(lib: &mut CLibrary) {
diff --git a/core/embed/models/build.rs b/core/embed/models/build.rs
index 9b6eb361..32ce0c67 100644
--- a/core/embed/models/build.rs
+++ b/core/embed/models/build.rs
@@ -1,7 +1,8 @@
use xbuild::{CLibrary, Result, bail_unsupported};
fn main() -> Result<()> {
- // Emit model identity for dependent build scripts (readable as DEP_MODELS_MODEL).
+ // Emit model identity for dependent build scripts (readable as
+ // DEP_MODELS_MODEL).
let model_id = if cfg!(feature = "model_t2t1") {
"T2T1"
} else if cfg!(feature = "model_t2b1") {
@@ -195,9 +196,9 @@ fn main() -> Result<()> {
///
/// Reads the model's `default_board` from `<model>/model.toml` and that board's
/// `header` (or `emulator_header` for an emulator build) from
-/// `<model>/boards/<default_board>.toml`, so the tomls stay the single source of
-/// truth. Returns "" for an unselected model; that case is rejected later by the
-/// model dispatch in `main`.
+/// `<model>/boards/<default_board>.toml`, so the tomls stay the single source
+/// of truth. Returns "" for an unselected model; that case is rejected later by
+/// the model dispatch in `main`.
fn default_board_header(model_id: &str) -> Result<String> {
if model_id.is_empty() {
return Ok(String::new());
diff --git a/core/embed/projects/firmware/build.rs b/core/embed/projects/firmware/build.rs
index 24ba6128..8e4c314e 100644
--- a/core/embed/projects/firmware/build.rs
+++ b/core/embed/projects/firmware/build.rs
@@ -1,4 +1,5 @@
-use std::{env, path::PathBuf};
+use std::env;
+use std::path::PathBuf;
use xbuild::{CLibrary, Result, bail_unsupported};
diff --git a/core/embed/projects/kernel/build.rs b/core/embed/projects/kernel/build.rs
index 8782e657..4d5f0401 100644
--- a/core/embed/projects/kernel/build.rs
+++ b/core/embed/projects/kernel/build.rs
@@ -1,4 +1,5 @@
-use std::{env, path::PathBuf};
+use std::env;
+use std::path::PathBuf;
use xbuild::{CLibrary, Result};
diff --git a/core/embed/rtl/build.rs b/core/embed/rtl/build.rs
index 80bb62a8..a7095d3a 100644
--- a/core/embed/rtl/build.rs
+++ b/core/embed/rtl/build.rs
@@ -1,7 +1,7 @@
-use xbuild::{Result, WrapErr, bail, ensure};
-
use std::process::Command;
+use xbuild::{Result, WrapErr, bail, ensure};
+
fn main() -> Result<()> {
xbuild::build(|lib| {
lib.import_lib("models")?;
diff --git a/core/embed/rust/build.rs b/core/embed/rust/build.rs
index 72cffd17..d5b95ea7 100644
--- a/core/embed/rust/build.rs
+++ b/core/embed/rust/build.rs
@@ -1,7 +1,7 @@
+use std::env;
#[cfg(all(feature = "test", not(feature = "with_new_crates")))]
use std::ffi::OsStr;
-use std::{env, path::PathBuf};
-
+use std::path::PathBuf;
#[cfg(not(feature = "with_new_crates"))]
use std::process::Command;
diff --git a/core/embed/rust/src/bootloader/mod.rs b/core/embed/rust/src/bootloader/mod.rs
index 21ccfea0..091632a2 100644
--- a/core/embed/rust/src/bootloader/mod.rs
+++ b/core/embed/rust/src/bootloader/mod.rs
@@ -1,23 +1,25 @@
+use heapless::Vec;
+
+#[cfg(feature = "power_manager")]
+use crate::time::Duration;
+#[cfg(feature = "ble")]
+use crate::trezorhal::bootloader::bootloader_process_ble;
+use crate::trezorhal::bootloader::{bootloader_process_usb, BootloaderWFResult};
+#[cfg(feature = "debuglink")]
+use crate::trezorhal::bootloader::{
+ debuglink_notify_layout_change, debuglink_process, DebuglinkResult,
+};
+#[cfg(all(feature = "haptic", feature = "power_manager"))]
+use crate::trezorhal::haptic::{play, HapticEffect};
+use crate::trezorhal::sysevent::{sysevents_poll, Syshandle};
+use crate::ui::component::base::AttachType;
+use crate::ui::component::{Component, Event, EventCtx};
#[cfg(all(feature = "button", feature = "power_manager"))]
use crate::ui::event::ButtonEvent;
#[cfg(feature = "button")]
use crate::ui::layout::simplified::button_eval;
-
-use crate::{
- trezorhal::{
- bootloader::{bootloader_process_usb, BootloaderWFResult},
- sysevent::{sysevents_poll, Syshandle},
- },
- ui::{
- component::{base::AttachType, Component, Event, EventCtx},
- layout::simplified::{render, ReturnToC},
- CommonUI, ModelUI,
- },
-};
-
-#[cfg(feature = "ble")]
-use crate::trezorhal::bootloader::bootloader_process_ble;
-
+use crate::ui::layout::simplified::{render, ReturnToC};
+use crate::ui::{CommonUI, ModelUI};
#[cfg(feature = "power_manager")]
use crate::{
time::Instant,
@@ -25,19 +27,6 @@ use crate::{
ui::display::fade_backlight_duration,
ui::event::PhysicalButton,
};
-
-#[cfg(all(feature = "haptic", feature = "power_manager"))]
-use crate::trezorhal::haptic::{play, HapticEffect};
-
-#[cfg(feature = "debuglink")]
-use crate::trezorhal::bootloader::{
- debuglink_notify_layout_change, debuglink_process, DebuglinkResult,
-};
-
-use heapless::Vec;
-
-#[cfg(feature = "power_manager")]
-use crate::time::Duration;
#[cfg(feature = "power_manager")]
const FADE_TIME: Duration = Duration::from_millis(30000);
#[cfg(feature = "power_manager")]
diff --git a/core/embed/rust/src/coverage/mod.rs b/core/embed/rust/src/coverage/mod.rs
index 69d8d033..123944ed 100644
--- a/core/embed/rust/src/coverage/mod.rs
+++ b/core/embed/rust/src/coverage/mod.rs
@@ -2,17 +2,13 @@
use heapless::index_map::{Entry, FnvIndexMap};
use spin::RwLock;
-use crate::{
- error::Error,
- micropython::{
- list::List,
- macros::{obj_fn_0, obj_fn_2, obj_module},
- module::Module,
- obj::Obj,
- qstr::Qstr,
- util,
- },
-};
+use crate::error::Error;
+use crate::micropython::list::List;
+use crate::micropython::macros::{obj_fn_0, obj_fn_2, obj_module};
+use crate::micropython::module::Module;
+use crate::micropython::obj::Obj;
+use crate::micropython::qstr::Qstr;
+use crate::micropython::util;
struct Key {
file: Qstr,
diff --git a/core/embed/rust/src/crypto/aesgcm.rs b/core/embed/rust/src/crypto/aesgcm.rs
index 7e5e4596..a0a697f2 100644
--- a/core/embed/rust/src/crypto/aesgcm.rs
+++ b/core/embed/rust/src/crypto/aesgcm.rs
@@ -2,7 +2,8 @@ use core::pin::Pin;
use zeroize::Zeroize;
-use super::{consteq, ffi, memory::Memory, Error};
+use super::memory::Memory;
+use super::{consteq, ffi, Error};
// Tag size is a parameter but we fix it to 16 here for simplicity.
pub const TAG_SIZE: usize = 16;
@@ -225,7 +226,8 @@ impl Drop for AesGcmInner<'_> {
#[cfg(test)]
mod test {
- use super::{super::memory::init_ctx, *};
+ use super::super::memory::init_ctx;
+ use super::*;
struct Vector {
key: &'static str,
diff --git a/core/embed/rust/src/crypto/crc32.rs b/core/embed/rust/src/crypto/crc32.rs
index d1990640..471dda7c 100644
--- a/core/embed/rust/src/crypto/crc32.rs
+++ b/core/embed/rust/src/crypto/crc32.rs
@@ -33,9 +33,8 @@ pub fn digest(data: &[u8]) -> [u8; 4] {
#[cfg(test)]
mod test {
- use crate::strutil::hexlify;
-
use super::*;
+ use crate::strutil::hexlify;
const CRC32_VECTORS: &[(&[u8], &[u8])] = &[
(b"", b"00000000"),
diff --git a/core/embed/rust/src/crypto/hmac.rs b/core/embed/rust/src/crypto/hmac.rs
index 1631de80..061e7cf3 100644
--- a/core/embed/rust/src/crypto/hmac.rs
+++ b/core/embed/rust/src/crypto/hmac.rs
@@ -2,10 +2,8 @@ use core::pin::Pin;
use zeroize::{Zeroize, ZeroizeOnDrop};
-use super::{
- ffi,
- memory::{init_ctx, Memory},
-};
+use super::ffi;
+use super::memory::{init_ctx, Memory};
pub const DIGEST_SIZE: usize = ffi::SHA256_DIGEST_LENGTH as usize;
pub type Digest = [u8; DIGEST_SIZE];
@@ -52,9 +50,8 @@ pub fn digest(key: &[u8], data: &[u8]) -> Digest {
#[cfg(test)]
mod test {
- use crate::strutil::hexlify;
-
use super::*;
+ use crate::strutil::hexlify;
const HMAC_SHA256_EMPTY: &[u8] =
b"b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad";
diff --git a/core/embed/rust/src/crypto/memory.rs b/core/embed/rust/src/crypto/memory.rs
index 2849395c..39d118b4 100644
--- a/core/embed/rust/src/crypto/memory.rs
+++ b/core/embed/rust/src/crypto/memory.rs
@@ -1,4 +1,6 @@
-use core::{marker::PhantomPinned, mem::MaybeUninit, pin::Pin};
+use core::marker::PhantomPinned;
+use core::mem::MaybeUninit;
+use core::pin::Pin;
use zeroize::{zeroize_flat_type, Zeroize};
diff --git a/core/embed/rust/src/crypto/merkle.rs b/core/embed/rust/src/crypto/merkle.rs
index 6c03d766..5cb9e8bc 100644
--- a/core/embed/rust/src/crypto/merkle.rs
+++ b/core/embed/rust/src/crypto/merkle.rs
@@ -1,4 +1,5 @@
-use super::{memory::init_ctx, sha256};
+use super::memory::init_ctx;
+use super::sha256;
/// Calculate a Merkle root based on a leaf element and a proof of inclusion.
///
diff --git a/core/embed/rust/src/crypto/sha256.rs b/core/embed/rust/src/crypto/sha256.rs
index a041e54e..bf2dc24c 100644
--- a/core/embed/rust/src/crypto/sha256.rs
+++ b/core/embed/rust/src/crypto/sha256.rs
@@ -1,11 +1,10 @@
-use core::{mem::MaybeUninit, pin::Pin};
+use core::mem::MaybeUninit;
+use core::pin::Pin;
use zeroize::{Zeroize, ZeroizeOnDrop};
-use super::{
- ffi,
- memory::{init_ctx, Memory},
-};
+use super::ffi;
+use super::memory::{init_ctx, Memory};
pub const BLOCK_SIZE: usize = ffi::SHA256_BLOCK_LENGTH as usize;
pub const DIGEST_SIZE: usize = ffi::SHA256_DIGEST_LENGTH as usize;
@@ -88,9 +87,8 @@ impl NoPinSha256 {
#[cfg(test)]
mod test {
- use crate::strutil::hexlify;
-
use super::*;
+ use crate::strutil::hexlify;
const SHA256_EMPTY: &[u8] = b"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
const SHA256_VECTORS: &[(&[u8], &[u8])] = &[
diff --git a/core/embed/rust/src/crypto/sha512.rs b/core/embed/rust/src/crypto/sha512.rs
index d73f2cb5..d8d4fc41 100644
--- a/core/embed/rust/src/crypto/sha512.rs
+++ b/core/embed/rust/src/crypto/sha512.rs
@@ -1,12 +1,10 @@
use core::pin::Pin;
-use super::{
- ffi,
- memory::{init_ctx, Memory},
-};
-
use zeroize::{Zeroize, ZeroizeOnDrop};
+use super::ffi;
+use super::memory::{init_ctx, Memory};
+
pub const BLOCK_SIZE: usize = ffi::SHA512_BLOCK_LENGTH as usize;
pub const DIGEST_SIZE: usize = ffi::SHA512_DIGEST_LENGTH as usize;
pub type Digest = [u8; DIGEST_SIZE];
@@ -54,9 +52,8 @@ pub fn digest(data: &[u8]) -> Digest {
#[cfg(test)]
mod test {
- use crate::strutil::hexlify;
-
use super::*;
+ use crate::strutil::hexlify;
const SHA512_EMPTY: &[u8] = b"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e";
const SHA512_VECTORS: &[(&[u8], &[u8])] = &[
diff --git a/core/embed/rust/src/debug.rs b/core/embed/rust/src/debug.rs
index faabf208..94bf465a 100644
--- a/core/embed/rust/src/debug.rs
+++ b/core/embed/rust/src/debug.rs
@@ -12,11 +12,12 @@ mod unix_ffi {
}
}
-#[cfg(feature = "micropython")]
-use crate::micropython::print::print;
#[cfg(not(feature = "micropython"))]
pub use unix_ffi::print;
+#[cfg(feature = "micropython")]
+use crate::micropython::print::print;
+
pub struct DebugConsole;
impl ufmt::uWrite for DebugConsole {
diff --git a/core/embed/rust/src/error.rs b/core/embed/rust/src/error.rs
index 77379943..ea12383f 100644
--- a/core/embed/rust/src/error.rs
+++ b/core/embed/rust/src/error.rs
@@ -1,4 +1,6 @@
-use core::{convert::Infallible, ffi::CStr, num::TryFromIntError};
+use core::convert::Infallible;
+use core::ffi::CStr;
+use core::num::TryFromIntError;
#[cfg(feature = "micropython")]
use {
diff --git a/core/embed/rust/src/io.rs b/core/embed/rust/src/io.rs
index e5bb3f4f..51e518ab 100644
--- a/core/embed/rust/src/io.rs
+++ b/core/embed/rust/src/io.rs
@@ -1,5 +1,4 @@
use crate::error::Error;
-
#[cfg(feature = "micropython")]
use crate::micropython::{buffer::get_buffer, gc::Gc, obj::Obj};
diff --git a/core/embed/rust/src/micropython/buffer.rs b/core/embed/rust/src/micropython/buffer.rs
index ecde85a0..bbf30900 100644
--- a/core/embed/rust/src/micropython/buffer.rs
+++ b/core/embed/rust/src/micropython/buffer.rs
@@ -1,8 +1,11 @@
-use core::{convert::TryFrom, ops::Deref, ptr, slice, str};
-
-use crate::{error::Error, micropython::obj::Obj, strutil::hexlify};
+use core::convert::TryFrom;
+use core::ops::Deref;
+use core::{ptr, slice, str};
use super::ffi;
+use crate::error::Error;
+use crate::micropython::obj::Obj;
+use crate::strutil::hexlify;
/// Represents an immutable UTF-8 string managed by MicroPython GC.
/// This either means static data, or a valid GC object.
diff --git a/core/embed/rust/src/micropython/dict.rs b/core/embed/rust/src/micropython/dict.rs
index 77dcf10a..49a119f0 100644
--- a/core/embed/rust/src/micropython/dict.rs
+++ b/core/embed/rust/src/micropython/dict.rs
@@ -1,9 +1,12 @@
use core::convert::TryFrom;
+use super::ffi;
+use super::gc::Gc;
+use super::map::Map;
+use super::obj::Obj;
+use super::runtime::catch_exception;
use crate::error::Error;
-use super::{ffi, gc::Gc, map::Map, obj::Obj, runtime::catch_exception};
-
/// Insides of the MicroPython `dict` object.
pub type Dict = ffi::mp_obj_dict_t;
diff --git a/core/embed/rust/src/micropython/exception.rs b/core/embed/rust/src/micropython/exception.rs
index 80d62ad5..ba5ce494 100644
--- a/core/embed/rust/src/micropython/exception.rs
+++ b/core/embed/rust/src/micropython/exception.rs
@@ -1,6 +1,9 @@
#![allow(non_upper_case_globals)]
-use super::{ffi, obj::Obj, qstr::Qstr, typ::Type};
+use super::ffi;
+use super::obj::Obj;
+use super::qstr::Qstr;
+use super::typ::Type;
pub const AttributeError: &Type = unsafe { &ffi::mp_type_AttributeError };
pub const EOFError: &Type = unsafe { &ffi::mp_type_EOFError };
diff --git a/core/embed/rust/src/micropython/func.rs b/core/embed/rust/src/micropython/func.rs
index 6c6a267b..6ff9f8e5 100644
--- a/core/embed/rust/src/micropython/func.rs
+++ b/core/embed/rust/src/micropython/func.rs
@@ -1,4 +1,5 @@
-use super::{ffi, obj::Obj};
+use super::ffi;
+use super::obj::Obj;
pub type Func = ffi::mp_obj_fun_builtin_fixed_t;
diff --git a/core/embed/rust/src/micropython/gc.rs b/core/embed/rust/src/micropython/gc.rs
index 62696e6a..ebc9b658 100644
--- a/core/embed/rust/src/micropython/gc.rs
+++ b/core/embed/rust/src/micropython/gc.rs
@@ -1,12 +1,9 @@
-use core::{
- alloc::Layout,
- ops::{Deref, DerefMut},
- ptr::{self, NonNull},
-};
-
-use crate::error::Error;
+use core::alloc::Layout;
+use core::ops::{Deref, DerefMut};
+use core::ptr::{self, NonNull};
use super::ffi;
+use crate::error::Error;
/// A pointer type for values on the garbage-collected heap.
pub struct Gc<T: ?Sized>(NonNull<T>);
@@ -296,9 +293,8 @@ impl<T: ?Sized> Drop for GcBox<T> {
mod test {
use core::cell::Cell;
- use crate::micropython::testutil::mpy_init;
-
use super::*;
+ use crate::micropython::testutil::mpy_init;
struct SignalDrop<'a>(&'a Cell<bool>);
diff --git a/core/embed/rust/src/micropython/iter.rs b/core/embed/rust/src/micropython/iter.rs
index 04071732..ea361458 100644
--- a/core/embed/rust/src/micropython/iter.rs
+++ b/core/embed/rust/src/micropython/iter.rs
@@ -1,8 +1,9 @@
use core::ptr;
-use crate::{error::Error, micropython::obj::Obj};
-
-use super::{ffi, runtime::catch_exception};
+use super::ffi;
+use super::runtime::catch_exception;
+use crate::error::Error;
+use crate::micropython::obj::Obj;
pub struct IterBuf {
iter_buf: ffi::mp_obj_iter_buf_t,
diff --git a/core/embed/rust/src/micropython/list.rs b/core/embed/rust/src/micropython/list.rs
index 3073adbc..bfa97950 100644
--- a/core/embed/rust/src/micropython/list.rs
+++ b/core/embed/rust/src/micropython/list.rs
@@ -1,14 +1,12 @@
-use core::{convert::TryFrom, ptr};
+use core::convert::TryFrom;
+use core::ptr;
+use super::ffi;
+use super::gc::{Gc, GcBox};
+use super::obj::Obj;
+use super::runtime::catch_exception;
use crate::error::Error;
-use super::{
- ffi,
- gc::{Gc, GcBox},
- obj::Obj,
- runtime::catch_exception,
-};
-
pub type List = ffi::mp_obj_list_t;
impl List {
@@ -149,10 +147,11 @@ impl TryFrom<Obj> for Gc<List> {
#[cfg(test)]
mod tests {
- use crate::micropython::{iter::IterBuf, testutil::mpy_init};
+ use heapless::Vec;
use super::*;
- use heapless::Vec;
+ use crate::micropython::iter::IterBuf;
+ use crate::micropython::testutil::mpy_init;
#[test]
fn list_from_iter() {
diff --git a/core/embed/rust/src/micropython/logging.rs b/core/embed/rust/src/micropython/logging.rs
index e485f7d1..aaff28a7 100644
--- a/core/embed/rust/src/micropython/logging.rs
+++ b/core/embed/rust/src/micropython/logging.rs
@@ -1,11 +1,12 @@
-use crate::micropython::{map::Map, module::Module, obj::Obj, qstr::Qstr};
-
-use crate::{
- error::Error,
- micropython::{buffer::StrBuffer, util},
- trezorhal::syslog::{syslog_start_record, syslog_write_chunk, LogLevel},
- util::logger::init_rust_logging,
-};
+use crate::error::Error;
+use crate::micropython::buffer::StrBuffer;
+use crate::micropython::map::Map;
+use crate::micropython::module::Module;
+use crate::micropython::obj::Obj;
+use crate::micropython::qstr::Qstr;
+use crate::micropython::util;
+use crate::trezorhal::syslog::{syslog_start_record, syslog_write_chunk, LogLevel};
+use crate::util::logger::init_rust_logging;
fn _log(level: LogLevel, args: &[Obj], kwargs: &Map) -> Result<Obj, Error> {
let [module, fmt, fmt_args @ ..] = args else {
diff --git a/core/embed/rust/src/micropython/macros.rs b/core/embed/rust/src/micropython/macros.rs
index 0e0804d2..a8415270 100644
--- a/core/embed/rust/src/micropython/macros.rs
+++ b/core/embed/rust/src/micropython/macros.rs
@@ -256,7 +256,6 @@ macro_rules! attr_tuple {
// required because they are used in expansion of macros below
pub(crate) use _obj_fn_make_fixed;
pub(crate) use _obj_fn_make_var;
-
pub(crate) use attr_tuple;
pub(crate) use obj_dict;
pub(crate) use obj_fn_0;
diff --git a/core/embed/rust/src/micropython/map.rs b/core/embed/rust/src/micropython/map.rs
index 3910a209..c1678766 100644
--- a/core/embed/rust/src/micropython/map.rs
+++ b/core/embed/rust/src/micropython/map.rs
@@ -1,11 +1,13 @@
-use core::{marker::PhantomData, mem::MaybeUninit, ops::Deref, ptr, slice};
-
-use crate::{
- error::Error,
- micropython::{obj::Obj, qstr::Qstr},
-};
-
-use super::{ffi, runtime::catch_exception};
+use core::marker::PhantomData;
+use core::mem::MaybeUninit;
+use core::ops::Deref;
+use core::{ptr, slice};
+
+use super::ffi;
+use super::runtime::catch_exception;
+use crate::error::Error;
+use crate::micropython::obj::Obj;
+use crate::micropython::qstr::Qstr;
pub type Map = ffi::mp_map_t;
pub type MapElem = ffi::mp_map_elem_t;
diff --git a/core/embed/rust/src/micropython/obj.rs b/core/embed/rust/src/micropython/obj.rs
index dc391edb..14bba424 100644
--- a/core/embed/rust/src/micropython/obj.rs
+++ b/core/embed/rust/src/micropython/obj.rs
@@ -1,12 +1,10 @@
-use core::{
- convert::{TryFrom, TryInto},
- ffi::CStr,
-};
+use core::convert::{TryFrom, TryInto};
+use core::ffi::CStr;
+use super::ffi;
+use super::runtime::catch_exception;
use crate::error::Error;
-use super::{ffi, runtime::catch_exception};
-
pub type Obj = ffi::mp_obj_t;
pub type ObjBase = ffi::mp_obj_base_t;
diff --git a/core/embed/rust/src/micropython/qstr.rs b/core/embed/rust/src/micropython/qstr.rs
index e50a18bc..bc431d9f 100644
--- a/core/embed/rust/src/micropython/qstr.rs
+++ b/core/embed/rust/src/micropython/qstr.rs
@@ -2,18 +2,21 @@
#![allow(non_upper_case_globals)]
#![allow(dead_code)]
-use core::{convert::TryFrom, slice, str::from_utf8};
+use core::convert::TryFrom;
+use core::slice;
+use core::str::from_utf8;
+use super::ffi;
+use super::obj::Obj;
use crate::error::Error;
-use super::{ffi, obj::Obj};
-
impl Qstr {
pub const fn to_obj(self) -> Obj {
// SAFETY:
// - Micropython compiled with `MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_A`.
- // micropython/py/obj.h #define MP_OBJ_NEW_QSTR(qst)
- // ((mp_obj_t)((((mp_uint_t)(qst)) << 3) | 2))
+ //
+ // micropython/py/obj.h
+ // #define MP_OBJ_NEW_QSTR(qst) ((mp_obj_t)((((mp_uint_t)(qst)) << 3) | 2))
let bits = (self.0 << 3) | 2;
unsafe { Obj::from_bits(bits) }
}
diff --git a/core/embed/rust/src/micropython/runtime.rs b/core/embed/rust/src/micropython/runtime.rs
index a2dced61..560d9051 100644
--- a/core/embed/rust/src/micropython/runtime.rs
+++ b/core/embed/rust/src/micropython/runtime.rs
@@ -1,8 +1,7 @@
use core::mem::MaybeUninit;
-use crate::error::Error;
-
use super::ffi;
+use crate::error::Error;
/// Raise a micropython exception via NLR jump.
/// Jumps directly out of the context without running any destructors,
diff --git a/core/embed/rust/src/micropython/simple_type.rs b/core/embed/rust/src/micropython/simple_type.rs
index a1142463..a348ab80 100644
--- a/core/embed/rust/src/micropython/simple_type.rs
+++ b/core/embed/rust/src/micropython/simple_type.rs
@@ -1,7 +1,5 @@
-use super::{
- obj::{Obj, ObjBase},
- typ::Type,
-};
+use super::obj::{Obj, ObjBase};
+use super::typ::Type;
/// Simple MicroPython object type builder.
///
diff --git a/core/embed/rust/src/micropython/typ.rs b/core/embed/rust/src/micropython/typ.rs
index 1a277deb..dee138fb 100644
--- a/core/embed/rust/src/micropython/typ.rs
+++ b/core/embed/rust/src/micropython/typ.rs
@@ -1,7 +1,5 @@
-use super::{
- ffi,
- obj::{Obj, ObjBase},
-};
+use super::ffi;
+use super::obj::{Obj, ObjBase};
pub type Type = ffi::mp_obj_type_t;
diff --git a/core/embed/rust/src/micropython/util.rs b/core/embed/rust/src/micropython/util.rs
index fdd5f239..5ef2b462 100644
--- a/core/embed/rust/src/micropython/util.rs
+++ b/core/embed/rust/src/micropython/util.rs
@@ -2,14 +2,12 @@ use core::slice;
use heapless::Vec;
-use super::{
- ffi,
- iter::IterBuf,
- map::{Map, MapElem},
- obj::Obj,
- qstr::Qstr,
- runtime::{catch_exception, raise_exception},
-};
+use super::ffi;
+use super::iter::IterBuf;
+use super::map::{Map, MapElem};
+use super::obj::Obj;
+use super::qstr::Qstr;
+use super::runtime::{catch_exception, raise_exception};
use crate::error::{value_error, Error};
/// Perform a call and convert errors into a raised MicroPython exception.
diff --git a/core/embed/rust/src/protobuf/decode.rs b/core/embed/rust/src/protobuf/decode.rs
index 5c4a2116..5a16a995 100644
--- a/core/embed/rust/src/protobuf/decode.rs
+++ b/core/embed/rust/src/protobuf/decode.rs
@@ -1,20 +1,17 @@
-use core::{
- convert::{TryFrom, TryInto},
- str,
-};
-
-use crate::{
- error::Error,
- io::InputStream,
- micropython::{buffer, gc::Gc, list::List, map::Map, obj::Obj, qstr::Qstr, util},
-};
-
-use super::{
- defs::{self, FieldDef, FieldType, MsgDef},
- error,
- obj::{MsgDefObj, MsgObj},
- zigzag,
-};
+use core::convert::{TryFrom, TryInto};
+use core::str;
+
+use super::defs::{self, FieldDef, FieldType, MsgDef};
+use super::obj::{MsgDefObj, MsgObj};
+use super::{error, zigzag};
+use crate::error::Error;
+use crate::io::InputStream;
+use crate::micropython::gc::Gc;
+use crate::micropython::list::List;
+use crate::micropython::map::Map;
+use crate::micropython::obj::Obj;
+use crate::micropython::qstr::Qstr;
+use crate::micropython::{buffer, util};
pub extern "C" fn protobuf_decode(buf: Obj, msg_def: Obj, enable_experimental: Obj) -> Obj {
let block = || {
diff --git a/core/embed/rust/src/protobuf/encode.rs b/core/embed/rust/src/protobuf/encode.rs
index cfc43a43..b1b87633 100644
--- a/core/embed/rust/src/protobuf/encode.rs
+++ b/core/embed/rust/src/protobuf/encode.rs
@@ -1,16 +1,15 @@
use core::convert::{TryFrom, TryInto};
-use crate::{
- error::Error,
- micropython::{buffer, gc::Gc, iter::IterBuf, list::List, obj::Obj, qstr::Qstr, util},
-};
-
-use super::{
- defs::{FieldDef, FieldType, MsgDef},
- error,
- obj::MsgObj,
- zigzag,
-};
+use super::defs::{FieldDef, FieldType, MsgDef};
+use super::obj::MsgObj;
+use super::{error, zigzag};
+use crate::error::Error;
+use crate::micropython::gc::Gc;
+use crate::micropython::iter::IterBuf;
+use crate::micropython::list::List;
+use crate::micropython::obj::Obj;
+use crate::micropython::qstr::Qstr;
+use crate::micropython::{buffer, util};
pub extern "C" fn protobuf_len(obj: Obj) -> Obj {
let block = || {
diff --git a/core/embed/rust/src/protobuf/error.rs b/core/embed/rust/src/protobuf/error.rs
index 23ea2ae8..47b2bc1f 100644
--- a/core/embed/rust/src/protobuf/error.rs
+++ b/core/embed/rust/src/protobuf/error.rs
@@ -1,7 +1,5 @@
-use crate::{
- error::{value_error, Error},
- micropython::qstr::Qstr,
-};
+use crate::error::{value_error, Error};
+use crate::micropython::qstr::Qstr;
pub const fn experimental_not_enabled() -> Error {
value_error!(c"Experimental features are disabled.")
diff --git a/core/embed/rust/src/protobuf/obj.rs b/core/embed/rust/src/protobuf/obj.rs
index cebe8eef..edadbc53 100644
--- a/core/embed/rust/src/protobuf/obj.rs
+++ b/core/embed/rust/src/protobuf/obj.rs
@@ -1,26 +1,18 @@
use core::convert::TryFrom;
-use crate::{
- error::Error,
- micropython::{
- dict::Dict,
- ffi,
- gc::Gc,
- macros::{obj_fn_1, obj_fn_2, obj_fn_3, obj_module, obj_type},
- map::Map,
- module::Module,
- obj::{Obj, ObjBase},
- qstr::Qstr,
- typ::Type,
- util,
- },
-};
-
-use super::{
- decode::{protobuf_decode, Decoder},
- defs::{find_name_by_msg_offset, get_msg, MsgDef},
- encode::{protobuf_encode, protobuf_len},
-};
+use super::decode::{protobuf_decode, Decoder};
+use super::defs::{find_name_by_msg_offset, get_msg, MsgDef};
+use super::encode::{protobuf_encode, protobuf_len};
+use crate::error::Error;
+use crate::micropython::dict::Dict;
+use crate::micropython::gc::Gc;
+use crate::micropython::macros::{obj_fn_1, obj_fn_2, obj_fn_3, obj_module, obj_type};
+use crate::micropython::map::Map;
+use crate::micropython::module::Module;
+use crate::micropython::obj::{Obj, ObjBase};
+use crate::micropython::qstr::Qstr;
+use crate::micropython::typ::Type;
+use crate::micropython::{ffi, util};
#[repr(C)]
pub struct MsgObj {
diff --git a/core/embed/rust/src/smp/api.rs b/core/embed/rust/src/smp/api.rs
index b44ecce2..e1ef6394 100644
--- a/core/embed/rust/src/smp/api.rs
+++ b/core/embed/rust/src/smp/api.rs
@@ -1,5 +1,4 @@
use super::{echo, image_info, process_rx_byte, reset, upload};
-
use crate::util::from_c_array;
#[no_mangle]
diff --git a/core/embed/rust/src/smp/echo.rs b/core/embed/rust/src/smp/echo.rs
index c696ad51..5c79394e 100644
--- a/core/embed/rust/src/smp/echo.rs
+++ b/core/embed/rust/src/smp/echo.rs
@@ -1,9 +1,11 @@
+use minicbor::data::Type;
+use minicbor::{decode, Decoder, Encoder};
+
use super::{
receiver_acquire, receiver_release, send_request, wait_for_response, MsgType, SmpBuffer,
SmpHeader, SMP_CMD_ID_ECHO, SMP_GROUP_OS, SMP_HEADER_SIZE, SMP_OP_READ,
};
use crate::time::Duration;
-use minicbor::{data::Type, decode, Decoder, Encoder};
pub fn send(text: &str) -> bool {
let mut cbor_data = [0u8; 64];
diff --git a/core/embed/rust/src/smp/image_info.rs b/core/embed/rust/src/smp/image_info.rs
index 27b4ee82..75839d6a 100644
--- a/core/embed/rust/src/smp/image_info.rs
+++ b/core/embed/rust/src/smp/image_info.rs
@@ -1,9 +1,11 @@
+use minicbor::data::Type;
+use minicbor::{decode, Decoder, Encoder};
+
use super::{
receiver_acquire, receiver_release, send_request, wait_for_response, MsgType, SmpBuffer,
SmpHeader, SMP_CMD_ID_IMAGE_STATE, SMP_GROUP_IMAGE, SMP_HEADER_SIZE, SMP_OP_READ,
};
use crate::time::Duration;
-use minicbor::{data::Type, decode, Decoder, Encoder};
/// MCUboot-compatible version structure matching image header format
#[derive(Clone, Copy, Debug)]
diff --git a/core/embed/rust/src/smp/mod.rs b/core/embed/rust/src/smp/mod.rs
index 697c239b..640691ec 100644
--- a/core/embed/rust/src/smp/mod.rs
+++ b/core/embed/rust/src/smp/mod.rs
@@ -6,18 +6,17 @@ mod image_info;
mod reset;
mod upload;
-use crate::{
- time::{Duration, Instant},
- trezorhal::{
- irq::{irq_lock, irq_unlock},
- nrf::send_data,
- },
-};
+use core::cell::UnsafeCell;
+use core::convert::Infallible;
+
use base64::{base64_decode, base64_encode};
-use core::{cell::UnsafeCell, convert::Infallible};
use crc16::crc16_itu_t;
use minicbor::encode::write::Write;
+use crate::time::{Duration, Instant};
+use crate::trezorhal::irq::{irq_lock, irq_unlock};
+use crate::trezorhal::nrf::send_data;
+
pub const SMP_HEADER_SIZE: usize = 8;
pub const SMP_GROUP_OS: u16 = 0;
diff --git a/core/embed/rust/src/smp/upload.rs b/core/embed/rust/src/smp/upload.rs
index 95f8034b..419a23be 100644
--- a/core/embed/rust/src/smp/upload.rs
+++ b/core/embed/rust/src/smp/upload.rs
@@ -1,9 +1,10 @@
+use minicbor::Encoder;
+
use super::{
receiver_acquire, receiver_release, send_request, wait_for_response, MsgType, SmpBuffer,
SmpHeader, SMP_CMD_ID_IMAGE_UPLOAD, SMP_GROUP_IMAGE, SMP_HEADER_SIZE, SMP_OP_WRITE,
};
use crate::time::Duration;
-use minicbor::Encoder;
const CHUNK_SIZE: usize = 256;
const MAX_PACKET_SIZE: usize = 512;
diff --git a/core/embed/rust/src/strutil.rs b/core/embed/rust/src/strutil.rs
index 5895129e..83d75482 100644
--- a/core/embed/rust/src/strutil.rs
+++ b/core/embed/rust/src/strutil.rs
@@ -2,10 +2,8 @@ use heapless::String;
#[cfg(feature = "micropython")]
use crate::error::Error;
-
#[cfg(feature = "micropython")]
use crate::micropython::{buffer::StrBuffer, obj::Obj};
-
#[cfg(feature = "translations")]
use crate::translations::TR;
diff --git a/core/embed/rust/src/thp/crypto.rs b/core/embed/rust/src/thp/crypto.rs
index 40903686..9b4d6fd8 100644
--- a/core/embed/rust/src/thp/crypto.rs
+++ b/core/embed/rust/src/thp/crypto.rs
@@ -1,8 +1,8 @@
use trezor_thp::channel::{Backend, Cipher, Hash, U8Array, DH};
-
use zeroize::{Zeroize, Zeroizing};
-use crate::crypto::{aesgcm, curve25519, memory::init_ctx, sha256};
+use crate::crypto::memory::init_ctx;
+use crate::crypto::{aesgcm, curve25519, sha256};
/// Array wrapper that zeroizes on `drop()`. Can't use zeroizing directly due to
/// the orphan rule.
diff --git a/core/embed/rust/src/thp/micropython.rs b/core/embed/rust/src/thp/micropython.rs
index 707f7d7e..3dfd8be5 100644
--- a/core/embed/rust/src/thp/micropython.rs
+++ b/core/embed/rust/src/thp/micropython.rs
@@ -2,25 +2,19 @@ use trezor_thp::channel::{
Phase, APP_HEADER_LEN, MAX_CREDENTIAL_LEN, MAX_DEVICE_PROPERTIES_LEN, SEND_BUFFER_OVERHEAD,
};
-use crate::{
- error::Error,
- micropython::{
- buffer::{get_buffer, get_buffer_mut},
- exception,
- macros::{
- attr_tuple, obj_fn_0, obj_fn_1, obj_fn_2, obj_fn_3, obj_fn_kw, obj_module, obj_type,
- },
- map::Map,
- module::Module,
- obj::Obj,
- qstr::Qstr,
- simple_type::SimpleTypeObj,
- typ::Type,
- util,
- },
-};
-
use super::{TrezorInResult, CANNOT_UNLOCK, THP_AUX, THP_CONTEXT};
+use crate::error::Error;
+use crate::micropython::buffer::{get_buffer, get_buffer_mut};
+use crate::micropython::macros::{
+ attr_tuple, obj_fn_0, obj_fn_1, obj_fn_2, obj_fn_3, obj_fn_kw, obj_module, obj_type,
+};
+use crate::micropython::map::Map;
+use crate::micropython::module::Module;
+use crate::micropython::obj::Obj;
+use crate::micropython::qstr::Qstr;
+use crate::micropython::simple_type::SimpleTypeObj;
+use crate::micropython::typ::Type;
+use crate::micropython::{exception, util};
extern "C" fn thp_init(iface_num: Obj, device_properties: Obj) -> Obj {
let block = || {
diff --git a/core/embed/rust/src/thp/mod.rs b/core/embed/rust/src/thp/mod.rs
index 9ff895ad..d87be055 100644
--- a/core/embed/rust/src/thp/mod.rs
+++ b/core/embed/rust/src/thp/mod.rs
@@ -4,31 +4,27 @@ pub mod micropython;
mod tests;
mod time;
-use crate::{error::Error, micropython::obj::Obj, time::Instant};
-
-use core::{mem::replace, num::NonZeroU16};
-
-use heapless::{
- deque::{Deque, DequeView},
- linear_map::{Entry, LinearMap, LinearMapView},
- Vec,
-};
-use spin::{Lazy, Mutex};
-
-use trezor_thp::{
- channel::{
- device::{Channel, ChannelIdAllocator, ChannelOpen, Mux},
- PacketInResult, PairingState, Phase, MAX_CREDENTIAL_LEN, MAX_RETRANSMISSION_COUNT,
- PUBKEY_LEN,
- },
- control_byte::ControlByte,
- credential::CredentialVerifier,
- error::TransportError,
- ChannelIO, Error as ThpError,
-};
+use core::mem::replace;
+use core::num::NonZeroU16;
use crypto::TrezorCrypto;
+use heapless::deque::{Deque, DequeView};
+use heapless::linear_map::{Entry, LinearMap, LinearMapView};
+use heapless::Vec;
+use spin::{Lazy, Mutex};
use time::{least_recently_used, ChannelTiming};
+use trezor_thp::channel::device::{Channel, ChannelIdAllocator, ChannelOpen, Mux};
+use trezor_thp::channel::{
+ PacketInResult, PairingState, Phase, MAX_CREDENTIAL_LEN, MAX_RETRANSMISSION_COUNT, PUBKEY_LEN,
+};
+use trezor_thp::control_byte::ControlByte;
+use trezor_thp::credential::CredentialVerifier;
+use trezor_thp::error::TransportError;
+use trezor_thp::{ChannelIO, Error as ThpError};
+
+use crate::error::Error;
+use crate::micropython::obj::Obj;
+use crate::time::Instant;
type TrezorMux = Mux<TrezorCrypto>;
type TrezorChannelOpen = ChannelOpen<TrezorCredentialVerifier, TrezorCrypto>;
diff --git a/core/embed/rust/src/thp/tests.rs b/core/embed/rust/src/thp/tests.rs
index cca18a2d..d0d60158 100644
--- a/core/embed/rust/src/thp/tests.rs
+++ b/core/embed/rust/src/thp/tests.rs
@@ -1,25 +1,22 @@
-use crate::micropython::{func::Func, macros::obj_fn_2, obj::Obj, testutil::mpy_init};
-
-use std::{
- assert_matches,
- collections::{HashMap, VecDeque},
- iter::repeat_n,
-};
+use std::assert_matches;
+use std::collections::{HashMap, VecDeque};
+use std::iter::repeat_n;
use spin::MutexGuard;
-
-use trezor_thp::{
- channel::{
- buffered::{Buffered, ChannelExt},
- host, ChannelIO, PacketInResult, PairingState, Phase, APP_HEADER_LEN, PRIVKEY_LEN, TAG_LEN,
- },
- credential::{CredentialStore, FoundCredential, NullCredentialStore},
- error::TransportError,
+use trezor_thp::channel::buffered::{Buffered, ChannelExt};
+use trezor_thp::channel::{
+ host, ChannelIO, PacketInResult, PairingState, Phase, APP_HEADER_LEN, PRIVKEY_LEN, TAG_LEN,
};
+use trezor_thp::credential::{CredentialStore, FoundCredential, NullCredentialStore};
+use trezor_thp::error::TransportError;
use super::{
Error, ThpAuxiliaryInfo, ThpContext, TrezorCrypto, TrezorInResult, THP_AUX, THP_CONTEXT,
};
+use crate::micropython::func::Func;
+use crate::micropython::macros::obj_fn_2;
+use crate::micropython::obj::Obj;
+use crate::micropython::testutil::mpy_init;
type HostChannel = host::Channel<TrezorCrypto>;
type HostChannelOpen<C> = host::ChannelOpen<C, TrezorCrypto>;
diff --git a/core/embed/rust/src/thp/time.rs b/core/embed/rust/src/thp/time.rs
index 0074a954..e98ab4a6 100644
--- a/core/embed/rust/src/thp/time.rs
+++ b/core/embed/rust/src/thp/time.rs
@@ -1,7 +1,7 @@
-use crate::time::{Duration, Instant};
-
use trezor_thp::channel::retransmit_after_ms;
+use crate::time::{Duration, Instant};
+
const MAX_LATENCY_MS: Duration = Duration::from_millis(800);
/// Timing data for THP channel.
@@ -103,10 +103,11 @@ pub fn least_recently_used(
#[cfg(test)]
mod tests {
- use super::*;
use heapless::Vec;
use trezor_thp::channel::MAX_RETRANSMISSION_COUNT;
+ use super::*;
+
fn make_map(channels: &[(u16, u32)]) -> Vec<(u16, ChannelTiming), 16> {
let mut chans = Vec::new();
for (ch, last_used) in channels {
diff --git a/core/embed/rust/src/time.rs b/core/embed/rust/src/time.rs
index 2a4a173d..5c3c77e8 100644
--- a/core/embed/rust/src/time.rs
+++ b/core/embed/rust/src/time.rs
@@ -1,7 +1,5 @@
-use core::{
- cmp::Ordering,
- ops::{Div, Mul},
-};
+use core::cmp::Ordering;
+use core::ops::{Div, Mul};
use crate::trezorhal::time;
diff --git a/core/embed/rust/src/translations/blob.rs b/core/embed/rust/src/translations/blob.rs
index b9ed0cd1..868fe1de 100644
--- a/core/embed/rust/src/translations/blob.rs
+++ b/core/embed/rust/src/translations/blob.rs
@@ -2,13 +2,12 @@ use core::{mem, str};
use heapless::Vec;
-use crate::{
- crypto::{cosi, ed25519, merkle::merkle_root, sha256},
- error::{value_error, Error},
- io::InputStream,
-};
-
-use super::{public_keys, translated_string::TranslatedString};
+use super::public_keys;
+use super::translated_string::TranslatedString;
+use crate::crypto::merkle::merkle_root;
+use crate::crypto::{cosi, ed25519, sha256};
+use crate::error::{value_error, Error};
+use crate::io::InputStream;
pub const MAX_HEADER_LEN: u16 = 1024;
pub const EMPTY_BYTE: u8 = 0xFF;
diff --git a/core/embed/rust/src/translations/flash.rs b/core/embed/rust/src/translations/flash.rs
index 238e41d7..e81abef9 100644
--- a/core/embed/rust/src/translations/flash.rs
+++ b/core/embed/rust/src/translations/flash.rs
@@ -1,11 +1,8 @@
use spin::{RwLock, RwLockReadGuard};
-use crate::{
- error::{value_error, Error},
- trezorhal::translations,
-};
-
use super::blob::Translations;
+use crate::error::{value_error, Error};
+use crate::trezorhal::translations;
static TRANSLATIONS_ON_FLASH: RwLock<Option<Translations>> = RwLock::new(None);
diff --git a/core/embed/rust/src/translations/obj.rs b/core/embed/rust/src/translations/obj.rs
index be844fb4..5c18d5c9 100644
--- a/core/embed/rust/src/translations/obj.rs
+++ b/core/embed/rust/src/translations/obj.rs
@@ -1,24 +1,18 @@
-use crate::{
- error::Error,
- io::InputStream,
- micropython::{
- buffer::get_buffer,
- ffi,
- macros::{
- attr_tuple, obj_dict, obj_fn_0, obj_fn_1, obj_fn_2, obj_map, obj_module, obj_type,
- },
- map::Map,
- module::Module,
- obj::Obj,
- qstr::Qstr,
- simple_type::SimpleTypeObj,
- typ::Type,
- util,
- },
- trezorhal::translations,
-};
-
use super::translated_string::TranslatedString;
+use crate::error::Error;
+use crate::io::InputStream;
+use crate::micropython::buffer::get_buffer;
+use crate::micropython::macros::{
+ attr_tuple, obj_dict, obj_fn_0, obj_fn_1, obj_fn_2, obj_map, obj_module, obj_type,
+};
+use crate::micropython::map::Map;
+use crate::micropython::module::Module;
+use crate::micropython::obj::Obj;
+use crate::micropython::qstr::Qstr;
+use crate::micropython::simple_type::SimpleTypeObj;
+use crate::micropython::typ::Type;
+use crate::micropython::{ffi, util};
+use crate::trezorhal::translations;
// SAFETY: Caller is supposed to be MicroPython, or copy MicroPython contracts
// about the meaning of arguments.
diff --git a/core/embed/rust/src/translations/translated_string.rs b/core/embed/rust/src/translations/translated_string.rs
index b23c9019..cdc82e9e 100644
--- a/core/embed/rust/src/translations/translated_string.rs
+++ b/core/embed/rust/src/translations/translated_string.rs
@@ -1,10 +1,8 @@
-use crate::strutil::TString;
-
use super::blob::{Translations, ENGLISH_CHUNK};
pub use super::generated::translated_string::TranslatedString;
-
#[cfg(feature = "micropython")]
use crate::micropython::qstr::Qstr;
+use crate::strutil::TString;
impl TranslatedString {
fn untranslated(self) -> &'static str {
diff --git a/core/embed/rust/src/trezorhal/bip39.rs b/core/embed/rust/src/trezorhal/bip39.rs
index 035ec4e9..a2a9e77f 100644
--- a/core/embed/rust/src/trezorhal/bip39.rs
+++ b/core/embed/rust/src/trezorhal/bip39.rs
@@ -1,4 +1,5 @@
-use super::{ffi, wordlist::Wordlist};
+use super::ffi;
+use super::wordlist::Wordlist;
pub fn complete_word(prefix: &str) -> Option<&'static str> {
if prefix.is_empty() {
diff --git a/core/embed/rust/src/trezorhal/bitblt.rs b/core/embed/rust/src/trezorhal/bitblt.rs
index 58715f3a..fc7774b0 100644
--- a/core/embed/rust/src/trezorhal/bitblt.rs
+++ b/core/embed/rust/src/trezorhal/bitblt.rs
@@ -1,12 +1,8 @@
use super::ffi;
-
-use crate::ui::{
- display::Color,
- geometry::Rect,
- shape::{Bitmap, BitmapFormat, BitmapView},
-};
-
use crate::trezorhal::display::{DISPLAY_RESX, DISPLAY_RESY};
+use crate::ui::display::Color;
+use crate::ui::geometry::Rect;
+use crate::ui::shape::{Bitmap, BitmapFormat, BitmapView};
/// Waits for the DMA2D peripheral transfer to complete.
pub fn wait_for_transfer() {
diff --git a/core/embed/rust/src/trezorhal/ble/micropython.rs b/core/embed/rust/src/trezorhal/ble/micropython.rs
index 4d4933f5..7bbc55b5 100644
--- a/core/embed/rust/src/trezorhal/ble/micropython.rs
+++ b/core/embed/rust/src/trezorhal/ble/micropython.rs
@@ -1,19 +1,16 @@
-use super::{super::model, *};
-use crate::{
- error::Error,
- micropython::{
- buffer::{get_buffer, get_buffer_mut, StrBuffer},
- list::List,
- macros::*,
- map::Map,
- module::Module,
- obj::Obj,
- qstr::Qstr,
- simple_type::SimpleTypeObj,
- typ::Type,
- util,
- },
-};
+use super::super::model;
+use super::*;
+use crate::error::Error;
+use crate::micropython::buffer::{get_buffer, get_buffer_mut, StrBuffer};
+use crate::micropython::list::List;
+use crate::micropython::macros::*;
+use crate::micropython::map::Map;
+use crate::micropython::module::Module;
+use crate::micropython::obj::Obj;
+use crate::micropython::qstr::Qstr;
+use crate::micropython::simple_type::SimpleTypeObj;
+use crate::micropython::typ::Type;
+use crate::micropython::util;
extern "C" fn py_erase_bonds() -> Obj {
let block = || {
diff --git a/core/embed/rust/src/trezorhal/ble/mod.rs b/core/embed/rust/src/trezorhal/ble/mod.rs
index c9b87038..6cc88cda 100644
--- a/core/embed/rust/src/trezorhal/ble/mod.rs
+++ b/core/embed/rust/src/trezorhal/ble/mod.rs
@@ -1,12 +1,13 @@
#[cfg(feature = "micropython")]
mod micropython;
-#[cfg(feature = "ui")]
-use crate::ui::event::BLEEvent;
+use core::ptr;
use super::ffi;
-use crate::{error::Error, trezorhal::ffi::bt_le_addr_t};
-use core::ptr;
+use crate::error::Error;
+use crate::trezorhal::ffi::bt_le_addr_t;
+#[cfg(feature = "ui")]
+use crate::ui::event::BLEEvent;
pub const ADV_NAME_LEN: usize = ffi::BLE_ADV_NAME_LEN as usize;
pub const BLE_MAX_BONDS: usize = ffi::BLE_MAX_BONDS as usize;
diff --git a/core/embed/rust/src/trezorhal/bootloader.rs b/core/embed/rust/src/trezorhal/bootloader.rs
index 64aa1ea4..d526fb38 100644
--- a/core/embed/rust/src/trezorhal/bootloader.rs
+++ b/core/embed/rust/src/trezorhal/bootloader.rs
@@ -1,7 +1,7 @@
-use super::ffi;
-
use num_traits::FromPrimitive;
+use super::ffi;
+
#[derive(PartialEq, Debug, Eq, Clone, Copy, FromPrimitive, ToPrimitive)]
pub enum BootloaderWFResult {
ErrorFatal = ffi::workflow_result_t_WF_ERROR_FATAL as _,
diff --git a/core/embed/rust/src/trezorhal/button.rs b/core/embed/rust/src/trezorhal/button.rs
index 1079c62b..9d4312f0 100644
--- a/core/embed/rust/src/trezorhal/button.rs
+++ b/core/embed/rust/src/trezorhal/button.rs
@@ -1,7 +1,7 @@
-use super::ffi;
-
use num_traits::FromPrimitive;
+use super::ffi;
+
#[derive(Copy, Clone, PartialEq, Eq, FromPrimitive)]
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum PhysicalButton {
diff --git a/core/embed/rust/src/trezorhal/display.rs b/core/embed/rust/src/trezorhal/display.rs
index ad65ecc3..18008a75 100644
--- a/core/embed/rust/src/trezorhal/display.rs
+++ b/core/embed/rust/src/trezorhal/display.rs
@@ -1,10 +1,10 @@
-use super::ffi;
-
#[cfg(feature = "framebuffer")]
use core::ptr;
use ffi::{DISPLAY_RESX_, DISPLAY_RESY_};
+use super::ffi;
+
pub const DISPLAY_RESX: u32 = DISPLAY_RESX_;
pub const DISPLAY_RESY: u32 = DISPLAY_RESY_;
diff --git a/core/embed/rust/src/trezorhal/irq.rs b/core/embed/rust/src/trezorhal/irq.rs
index 116bb3d2..0c6f508d 100644
--- a/core/embed/rust/src/trezorhal/irq.rs
+++ b/core/embed/rust/src/trezorhal/irq.rs
@@ -1,7 +1,7 @@
-use super::ffi;
-
pub use ffi::irq_key_t as IrqKey;
+use super::ffi;
+
pub fn irq_lock() -> IrqKey {
unsafe { ffi::irq_lock_fn() }
}
diff --git a/core/embed/rust/src/trezorhal/jpegdec.rs b/core/embed/rust/src/trezorhal/jpegdec.rs
index 53ab9aa2..02a0bf80 100644
--- a/core/embed/rust/src/trezorhal/jpegdec.rs
+++ b/core/embed/rust/src/trezorhal/jpegdec.rs
@@ -1,12 +1,9 @@
-use super::ffi;
-
-use crate::ui::{
- geometry::{Offset, Point, Rect},
- shape::{Bitmap, BitmapFormat, BitmapView},
-};
+use num_traits::FromPrimitive;
+use super::ffi;
use crate::io::BinaryData;
-use num_traits::FromPrimitive;
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape::{Bitmap, BitmapFormat, BitmapView};
pub const RGBA8888_BUFFER_SIZE: usize = ffi::JPEGDEC_RGBA8888_BUFFER_SIZE as _;
pub const MONO8_BUFFER_SIZE: usize = ffi::JPEGDEC_MONO8_BUFFER_SIZE as _;
diff --git a/core/embed/rust/src/trezorhal/layout_buf.rs b/core/embed/rust/src/trezorhal/layout_buf.rs
index 2aa9f3d1..109512c3 100644
--- a/core/embed/rust/src/trezorhal/layout_buf.rs
+++ b/core/embed/rust/src/trezorhal/layout_buf.rs
@@ -1,4 +1,6 @@
-use core::{marker::PhantomData, mem::MaybeUninit, ptr::NonNull};
+use core::marker::PhantomData;
+use core::mem::MaybeUninit;
+use core::ptr::NonNull;
pub use super::ffi::c_layout_t;
diff --git a/core/embed/rust/src/trezorhal/power_manager.rs b/core/embed/rust/src/trezorhal/power_manager.rs
index 3d0bbf82..644a8b96 100644
--- a/core/embed/rust/src/trezorhal/power_manager.rs
+++ b/core/embed/rust/src/trezorhal/power_manager.rs
@@ -1,6 +1,6 @@
-use super::ffi;
use core::ptr::null_mut;
+use super::ffi;
#[cfg(feature = "ui")]
use crate::ui::event::PMEvent;
diff --git a/core/embed/rust/src/trezorhal/secbool.rs b/core/embed/rust/src/trezorhal/secbool.rs
index a305e3f1..9bf8ab56 100644
--- a/core/embed/rust/src/trezorhal/secbool.rs
+++ b/core/embed/rust/src/trezorhal/secbool.rs
@@ -1,5 +1,5 @@
#![allow(unused_imports)]
-use super::ffi;
-
pub use ffi::{secbool, secfalse, sectrue};
+
+use super::ffi;
diff --git a/core/embed/rust/src/trezorhal/slip39.rs b/core/embed/rust/src/trezorhal/slip39.rs
index cc7e5686..dfa74cc6 100644
--- a/core/embed/rust/src/trezorhal/slip39.rs
+++ b/core/embed/rust/src/trezorhal/slip39.rs
@@ -1,4 +1,5 @@
-use core::{ffi::CStr, str};
+use core::ffi::CStr;
+use core::str;
use super::ffi;
diff --git a/core/embed/rust/src/trezorhal/storage.rs b/core/embed/rust/src/trezorhal/storage.rs
index 31c541e8..abe8aff4 100644
--- a/core/embed/rust/src/trezorhal/storage.rs
+++ b/core/embed/rust/src/trezorhal/storage.rs
@@ -1,11 +1,12 @@
#![allow(dead_code)]
-use super::ffi;
-use crate::error::{value_error, Error};
use core::ptr;
use num_traits::FromPrimitive;
+use super::ffi;
+use crate::error::{value_error, Error};
+
/// Result of PIN delay callback.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum PinCallbackResult {
diff --git a/core/embed/rust/src/trezorhal/sysevent.rs b/core/embed/rust/src/trezorhal/sysevent.rs
index 73631a46..d1d0ea43 100644
--- a/core/embed/rust/src/trezorhal/sysevent.rs
+++ b/core/embed/rust/src/trezorhal/sysevent.rs
@@ -1,33 +1,30 @@
#![allow(unused_imports)]
-use super::ffi;
use core::mem::{self, MaybeUninit};
-use crate::ui::component::Event;
pub use ffi::{sysevents_t, syshandle_t};
+use super::ffi;
#[cfg(feature = "ble")]
use crate::trezorhal::ble::ble_parse_event;
-#[cfg(feature = "ble")]
-use crate::ui::event::BLEEvent;
-
-#[cfg(feature = "touch")]
-use crate::trezorhal::touch::touch_get_event;
-#[cfg(feature = "touch")]
-use crate::ui::event::TouchEvent;
-
-#[cfg(feature = "power_manager")]
-use crate::trezorhal::power_manager::pm_parse_event;
-#[cfg(feature = "power_manager")]
-use crate::ui::event::PMEvent;
-
#[cfg(feature = "button")]
use crate::trezorhal::button::button_parse_event;
#[cfg(feature = "button")]
use crate::trezorhal::ffi::button_get_event;
+#[cfg(feature = "power_manager")]
+use crate::trezorhal::power_manager::pm_parse_event;
use crate::trezorhal::time::ticks_ms;
+#[cfg(feature = "touch")]
+use crate::trezorhal::touch::touch_get_event;
+use crate::ui::component::Event;
+#[cfg(feature = "ble")]
+use crate::ui::event::BLEEvent;
#[cfg(feature = "button")]
use crate::ui::event::ButtonEvent;
+#[cfg(feature = "power_manager")]
+use crate::ui::event::PMEvent;
+#[cfg(feature = "touch")]
+use crate::ui::event::TouchEvent;
#[derive(PartialEq, Debug, Eq, Clone, Copy)]
pub enum Syshandle {
diff --git a/core/embed/rust/src/trezorhal/time.rs b/core/embed/rust/src/trezorhal/time.rs
index 4c8034ba..92269f5a 100644
--- a/core/embed/rust/src/trezorhal/time.rs
+++ b/core/embed/rust/src/trezorhal/time.rs
@@ -1,6 +1,5 @@
-use crate::time::Duration;
-
use super::ffi;
+use crate::time::Duration;
/// Returns the current time in milliseconds since the device was reset.
/// Time is represented as a 32-bit number that wraps around every 49.7 days.
diff --git a/core/embed/rust/src/trezorhal/uzlib.rs b/core/embed/rust/src/trezorhal/uzlib.rs
index f3ae8af6..89770c9e 100644
--- a/core/embed/rust/src/trezorhal/uzlib.rs
+++ b/core/embed/rust/src/trezorhal/uzlib.rs
@@ -1,6 +1,10 @@
+use core::cell::RefCell;
+use core::marker::PhantomData;
+use core::mem::MaybeUninit;
+use core::ptr;
+
use super::ffi;
use crate::io::BinaryData;
-use core::{cell::RefCell, marker::PhantomData, mem::MaybeUninit, ptr};
pub const UZLIB_WINDOW_SIZE: usize = 1 << 10;
pub use ffi::uzlib_uncomp;
diff --git a/core/embed/rust/src/trezorhal/wordlist.rs b/core/embed/rust/src/trezorhal/wordlist.rs
index a68a4b56..477f36c9 100644
--- a/core/embed/rust/src/trezorhal/wordlist.rs
+++ b/core/embed/rust/src/trezorhal/wordlist.rs
@@ -1,5 +1,7 @@
+use core::cmp::Ordering;
+use core::ffi::CStr;
+
use super::ffi;
-use core::{cmp::Ordering, ffi::CStr};
/// Holds all the possible words with the possibility to interact
/// with the "list" - filtering it further, getting their count, etc.
diff --git a/core/embed/rust/src/ui/animation.rs b/core/embed/rust/src/ui/animation.rs
index af0709c8..f83c9bf7 100644
--- a/core/embed/rust/src/ui/animation.rs
+++ b/core/embed/rust/src/ui/animation.rs
@@ -1,7 +1,5 @@
-use crate::{
- time::{Duration, Instant},
- ui::lerp::{InvLerp, Lerp},
-};
+use crate::time::{Duration, Instant};
+use crate::ui::lerp::{InvLerp, Lerp};
/// Running, time-based linear progression of a value.
#[derive(Clone)]
diff --git a/core/embed/rust/src/ui/api/bootloader_c.rs b/core/embed/rust/src/ui/api/bootloader_c.rs
index f6db1206..930dfc5c 100644
--- a/core/embed/rust/src/ui/api/bootloader_c.rs
+++ b/core/embed/rust/src/ui/api/bootloader_c.rs
@@ -1,8 +1,7 @@
-use crate::{
- strutil::hexlify,
- ui::{ui_bootloader::BootloaderUI, ModelUI},
- util::{from_c_array, from_c_str},
-};
+use crate::strutil::hexlify;
+use crate::ui::ui_bootloader::BootloaderUI;
+use crate::ui::ModelUI;
+use crate::util::{from_c_array, from_c_str};
#[no_mangle]
extern "C" fn screen_welcome(ui_action_result: *mut u32) -> u32 {
diff --git a/core/embed/rust/src/ui/api/common_c.rs b/core/embed/rust/src/ui/api/common_c.rs
index 9b2e4227..801111b0 100644
--- a/core/embed/rust/src/ui/api/common_c.rs
+++ b/core/embed/rust/src/ui/api/common_c.rs
@@ -1,12 +1,10 @@
//! Reexporting the `screens` module according to the
//! current feature (Trezor model)
-use crate::ui::{CommonUI, ModelUI};
-
-use crate::{ui::shape, util::from_c_str};
-
#[cfg(feature = "ui_debug")]
use crate::ui::util::set_animation_disabled;
+use crate::ui::{shape, CommonUI, ModelUI};
+use crate::util::from_c_str;
#[no_mangle]
extern "C" fn display_rsod_rust(
diff --git a/core/embed/rust/src/ui/api/firmware_micropython.rs b/core/embed/rust/src/ui/api/firmware_micropython.rs
index ff3313da..962cf331 100644
--- a/core/embed/rust/src/ui/api/firmware_micropython.rs
+++ b/core/embed/rust/src/ui/api/firmware_micropython.rs
@@ -1,42 +1,33 @@
-use crate::{
- error::Error,
- io::BinaryData,
- micropython::{
- buffer::StrBuffer,
- gc::Gc,
- iter::IterBuf,
- list::List,
- macros::{obj_fn_0, obj_fn_1, obj_fn_kw, obj_module},
- map::Map,
- module::Module,
- obj::Obj,
- qstr::Qstr,
- util,
- },
- strutil::TString,
- trezorhal::model,
- ui::{
- backlight::BACKLIGHT_LEVELS_OBJ,
- component::Empty,
- layout::{
- base::LAYOUT_STATE,
- device_menu_result::DEVICE_MENU_RESULT,
- obj::{ComponentMsgObj, LayoutObj, ATTACH_TYPE_OBJ},
- result::{BACK, CANCELLED, CONFIRMED, INFO},
- util::{upy_disable_animation, RecoveryType},
- },
- notification::{Notification, NotificationLevel, NOTIFICATION_LEVEL_OBJ},
- ui_firmware::{
- FirmwareUI, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_PAIRED_DEVICES,
- MAX_WORD_QUIZ_ITEMS,
- },
- ModelUI,
- },
-};
use heapless::Vec;
+use crate::error::Error;
+use crate::io::BinaryData;
+use crate::micropython::buffer::StrBuffer;
+use crate::micropython::gc::Gc;
+use crate::micropython::iter::IterBuf;
+use crate::micropython::list::List;
+use crate::micropython::macros::{obj_fn_0, obj_fn_1, obj_fn_kw, obj_module};
+use crate::micropython::map::Map;
+use crate::micropython::module::Module;
+use crate::micropython::obj::Obj;
+use crate::micropython::qstr::Qstr;
+use crate::micropython::util;
+use crate::strutil::TString;
+use crate::trezorhal::model;
+use crate::ui::backlight::BACKLIGHT_LEVELS_OBJ;
+use crate::ui::component::Empty;
#[cfg(feature = "backlight")]
use crate::ui::display::{fade_backlight_duration, get_backlight, set_backlight};
+use crate::ui::layout::base::LAYOUT_STATE;
+use crate::ui::layout::device_menu_result::DEVICE_MENU_RESULT;
+use crate::ui::layout::obj::{ComponentMsgObj, LayoutObj, ATTACH_TYPE_OBJ};
+use crate::ui::layout::result::{BACK, CANCELLED, CONFIRMED, INFO};
+use crate::ui::layout::util::{upy_disable_animation, RecoveryType};
+use crate::ui::notification::{Notification, NotificationLevel, NOTIFICATION_LEVEL_OBJ};
+use crate::ui::ui_firmware::{
+ FirmwareUI, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_PAIRED_DEVICES, MAX_WORD_QUIZ_ITEMS,
+};
+use crate::ui::ModelUI;
/// Dummy implementation so that we can use `Empty` in a return type of
/// unimplemented trait function
diff --git a/core/embed/rust/src/ui/api/prodtest_c.rs b/core/embed/rust/src/ui/api/prodtest_c.rs
index 530c85d1..6a5c217e 100644
--- a/core/embed/rust/src/ui/api/prodtest_c.rs
+++ b/core/embed/rust/src/ui/api/prodtest_c.rs
@@ -1,23 +1,17 @@
-use crate::{
- trezorhal::{
- layout_buf::{c_layout_t, LayoutBuffer},
- sysevent::{parse_event, sysevents_t},
- },
- ui::{
- ui_prodtest::{ProdtestLayoutType, ProdtestUI},
- ModelUI,
- },
- util::from_c_array,
-};
+#[cfg(feature = "touch")]
+use cty::int16_t;
+#[cfg(feature = "touch")]
+use heapless::Vec;
+use crate::trezorhal::layout_buf::{c_layout_t, LayoutBuffer};
+use crate::trezorhal::sysevent::{parse_event, sysevents_t};
#[cfg(feature = "touch")]
use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::ui_prodtest::{ProdtestLayoutType, ProdtestUI};
+use crate::ui::ModelUI;
#[cfg(feature = "touch")]
use crate::ui::{event::TouchEvent, layout::simplified::touch_unpack};
-#[cfg(feature = "touch")]
-use cty::int16_t;
-#[cfg(feature = "touch")]
-use heapless::Vec;
+use crate::util::from_c_array;
#[no_mangle]
extern "C" fn screen_prodtest_event(layout: *mut c_layout_t, signalled: &sysevents_t) -> u32 {
diff --git a/core/embed/rust/src/ui/backlight.rs b/core/embed/rust/src/ui/backlight.rs
index 14bfa68b..d5415c6a 100644
--- a/core/embed/rust/src/ui/backlight.rs
+++ b/core/embed/rust/src/ui/backlight.rs
@@ -1,10 +1,11 @@
-use crate::{
- error::Error,
- micropython::{
- ffi, macros::obj_type, obj::Obj, qstr::Qstr, simple_type::SimpleTypeObj, typ::Type, util,
- },
- ui::{CommonUI, ModelUI},
-};
+use crate::error::Error;
+use crate::micropython::macros::obj_type;
+use crate::micropython::obj::Obj;
+use crate::micropython::qstr::Qstr;
+use crate::micropython::simple_type::SimpleTypeObj;
+use crate::micropython::typ::Type;
+use crate::micropython::{ffi, util};
+use crate::ui::{CommonUI, ModelUI};
/*
* This whole module should be removed, in favor of fully
diff --git a/core/embed/rust/src/ui/button_request.rs b/core/embed/rust/src/ui/button_request.rs
index 06dfdd77..478c2b79 100644
--- a/core/embed/rust/src/ui/button_request.rs
+++ b/core/embed/rust/src/ui/button_request.rs
@@ -1,6 +1,7 @@
-use crate::strutil::TString;
use num_traits::FromPrimitive;
+use crate::strutil::TString;
+
// ButtonRequestType from messages-common.proto
// Eventually this should be generated
#[derive(Clone, Copy, FromPrimitive, PartialEq, Eq)]
diff --git a/core/embed/rust/src/ui/component/bar.rs b/core/embed/rust/src/ui/component/bar.rs
index 36afe16d..60bdc8ac 100644
--- a/core/embed/rust/src/ui/component/bar.rs
+++ b/core/embed/rust/src/ui/component/bar.rs
@@ -1,10 +1,8 @@
-use crate::ui::{
- component::{Component, Event, EventCtx, Never},
- display::Color,
- geometry::Rect,
- shape,
- shape::Renderer,
-};
+use crate::ui::component::{Component, Event, EventCtx, Never};
+use crate::ui::display::Color;
+use crate::ui::geometry::Rect;
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
pub struct Bar {
area: Rect,
diff --git a/core/embed/rust/src/ui/component/base.rs b/core/embed/rust/src/ui/component/base.rs
index 102d0ac6..5dc14107 100644
--- a/core/embed/rust/src/ui/component/base.rs
+++ b/core/embed/rust/src/ui/component/base.rs
@@ -1,18 +1,11 @@
use heapless::Vec;
-use crate::{
- error::Error,
- strutil::{ShortString, TString},
- time::Duration,
- ui::{
- button_request::{ButtonRequest, ButtonRequestCode},
- component::{MsgMap, PageMap},
- geometry::{Offset, Rect},
- shape::Renderer,
- util::Pager,
- },
-};
-
+use super::Paginate;
+use crate::error::Error;
+use crate::strutil::{ShortString, TString};
+use crate::time::Duration;
+use crate::ui::button_request::{ButtonRequest, ButtonRequestCode};
+use crate::ui::component::{MsgMap, PageMap};
#[cfg(feature = "ble")]
use crate::ui::event::BLEEvent;
#[cfg(feature = "button")]
@@ -20,14 +13,15 @@ use crate::ui::event::ButtonEvent;
#[cfg(feature = "power_manager")]
use crate::ui::event::PMEvent;
use crate::ui::event::USBEvent;
+use crate::ui::geometry::{Offset, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::util::Pager;
#[cfg(feature = "touch")]
use crate::ui::{
event::{SwipeEvent, TouchEvent},
geometry::Direction,
};
-use super::Paginate;
-
/// Type used by components that do not return any messages.
///
/// Alternative to the yet-unstable `!`-type.
diff --git a/core/embed/rust/src/ui/component/ble.rs b/core/embed/rust/src/ui/component/ble.rs
index 7070cdcd..c1941a88 100644
--- a/core/embed/rust/src/ui/component/ble.rs
+++ b/core/embed/rust/src/ui/component/ble.rs
@@ -1,12 +1,9 @@
-use crate::ui::{
- component::{Component, Event, EventCtx},
- event::BLEEvent,
- geometry::Rect,
- shape::Renderer,
-};
-
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::event::BLEEvent;
+use crate::ui::geometry::Rect;
#[cfg(feature = "rgb_led")]
use crate::ui::led::{Effect, LedState};
+use crate::ui::shape::Renderer;
pub enum BLEHandlerMode {
/// Advertising without whitelist started, waiting for some host to respond
@@ -87,14 +84,10 @@ where
#[cfg(feature = "micropython")]
mod micropython {
use super::*;
- use crate::{
- error::Error,
- micropython::obj::Obj,
- ui::layout::{
- obj::ComponentMsgObj,
- result::{CANCELLED, CONFIRMED},
- },
- };
+ use crate::error::Error;
+ use crate::micropython::obj::Obj;
+ use crate::ui::layout::obj::ComponentMsgObj;
+ use crate::ui::layout::result::{CANCELLED, CONFIRMED};
impl<T> ComponentMsgObj for BLEHandler<T>
where
T: ComponentMsgObj,
diff --git a/core/embed/rust/src/ui/component/border.rs b/core/embed/rust/src/ui/component/border.rs
index 9882a5b5..7b62f3d7 100644
--- a/core/embed/rust/src/ui/component/border.rs
+++ b/core/embed/rust/src/ui/component/border.rs
@@ -1,8 +1,6 @@
use super::{Component, Event, EventCtx};
-use crate::ui::{
- geometry::{Insets, Rect},
- shape::Renderer,
-};
+use crate::ui::geometry::{Insets, Rect};
+use crate::ui::shape::Renderer;
pub struct Border<T> {
border: Insets,
@@ -55,7 +53,9 @@ where
#[cfg(feature = "micropython")]
mod micropython {
- use crate::{error::Error, micropython::obj::Obj, ui::layout::obj::ComponentMsgObj};
+ use crate::error::Error;
+ use crate::micropython::obj::Obj;
+ use crate::ui::layout::obj::ComponentMsgObj;
impl<T: ComponentMsgObj> ComponentMsgObj for super::Border<T> {
fn msg_try_into_obj(&self, msg: Self::Msg) -> Result<Obj, Error> {
self.inner().msg_try_into_obj(msg)
diff --git a/core/embed/rust/src/ui/component/button_request.rs b/core/embed/rust/src/ui/component/button_request.rs
index 8686d283..6c7d2d59 100644
--- a/core/embed/rust/src/ui/component/button_request.rs
+++ b/core/embed/rust/src/ui/component/button_request.rs
@@ -1,11 +1,8 @@
-use crate::ui::{
- button_request::ButtonRequest,
- component::{Component, Event, EventCtx},
- geometry::Rect,
-};
-
+use crate::ui::button_request::ButtonRequest;
#[cfg(all(feature = "micropython", feature = "touch"))]
use crate::ui::component::swipe_detect::SwipeConfig;
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::Rect;
/// Component that sends a ButtonRequest after receiving Event::Attach. The
/// request is either sent only once or on every Event::Attach configured by
diff --git a/core/embed/rust/src/ui/component/cached_jpeg.rs b/core/embed/rust/src/ui/component/cached_jpeg.rs
index 020538ad..8a238f1a 100644
--- a/core/embed/rust/src/ui/component/cached_jpeg.rs
+++ b/core/embed/rust/src/ui/component/cached_jpeg.rs
@@ -1,15 +1,10 @@
-use crate::{
- error::Error,
- io::BinaryData,
- ui::{
- component::{Component, Event, EventCtx, Never},
- display::image::ImageInfo,
- geometry::{Offset, Point, Rect},
- shape::{self, render_on_canvas, ImageBuffer, Renderer, Rgb565Canvas},
- },
-};
-
use super::paginated::SinglePage;
+use crate::error::Error;
+use crate::io::BinaryData;
+use crate::ui::component::{Component, Event, EventCtx, Never};
+use crate::ui::display::image::ImageInfo;
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape::{self, render_on_canvas, ImageBuffer, Renderer, Rgb565Canvas};
pub struct CachedJpeg {
area: Rect,
@@ -86,7 +81,9 @@ impl crate::trace::Trace for CachedJpeg {
#[cfg(feature = "micropython")]
mod micropython {
- use crate::{error::Error, micropython::obj::Obj, ui::layout::obj::ComponentMsgObj};
+ use crate::error::Error;
+ use crate::micropython::obj::Obj;
+ use crate::ui::layout::obj::ComponentMsgObj;
impl ComponentMsgObj for super::CachedJpeg {
fn msg_try_into_obj(&self, _msg: Self::Msg) -> Result<Obj, Error> {
unreachable!();
diff --git a/core/embed/rust/src/ui/component/connect.rs b/core/embed/rust/src/ui/component/connect.rs
index dab5760a..84bf8cc1 100644
--- a/core/embed/rust/src/ui/component/connect.rs
+++ b/core/embed/rust/src/ui/component/connect.rs
@@ -1,12 +1,8 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx, Never, Pad},
- display::{Color, Font},
- geometry::{Alignment, Offset, Rect},
- shape::{self, Renderer},
- },
-};
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx, Never, Pad};
+use crate::ui::display::{Color, Font};
+use crate::ui::geometry::{Alignment, Offset, Rect};
+use crate::ui::shape::{self, Renderer};
pub struct Connect {
fg: Color,
@@ -62,9 +58,10 @@ impl Component for Connect {
#[cfg(feature = "micropython")]
mod micropython {
- use crate::{error::Error, micropython::obj::Obj, ui::layout::obj::ComponentMsgObj};
-
use super::Connect;
+ use crate::error::Error;
+ use crate::micropython::obj::Obj;
+ use crate::ui::layout::obj::ComponentMsgObj;
impl ComponentMsgObj for Connect {
fn msg_try_into_obj(&self, _msg: Self::Msg) -> Result<Obj, Error> {
diff --git a/core/embed/rust/src/ui/component/empty.rs b/core/embed/rust/src/ui/component/empty.rs
index 8c559a3b..633dd84f 100644
--- a/core/embed/rust/src/ui/component/empty.rs
+++ b/core/embed/rust/src/ui/component/empty.rs
@@ -1,5 +1,6 @@
use super::{Component, Event, EventCtx, Never};
-use crate::ui::{geometry::Rect, shape::Renderer};
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
#[derive(Clone)]
pub struct Empty;
diff --git a/core/embed/rust/src/ui/component/image.rs b/core/embed/rust/src/ui/component/image.rs
index 9d38b9cc..033dedf9 100644
--- a/core/embed/rust/src/ui/component/image.rs
+++ b/core/embed/rust/src/ui/component/image.rs
@@ -1,13 +1,9 @@
-use crate::ui::{
- component::{Component, Event, EventCtx, Never},
- display::{
- toif::{Toif, ToifFormat},
- Color, Icon,
- },
- geometry::{Alignment2D, Offset, Point, Rect},
- shape,
- shape::Renderer,
-};
+use crate::ui::component::{Component, Event, EventCtx, Never};
+use crate::ui::display::toif::{Toif, ToifFormat};
+use crate::ui::display::{Color, Icon};
+use crate::ui::geometry::{Alignment2D, Offset, Point, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
#[derive(PartialEq, Eq, Clone, Copy)]
pub struct Image {
diff --git a/core/embed/rust/src/ui/component/jpeg.rs b/core/embed/rust/src/ui/component/jpeg.rs
index 44cb19d3..302eedf7 100644
--- a/core/embed/rust/src/ui/component/jpeg.rs
+++ b/core/embed/rust/src/ui/component/jpeg.rs
@@ -1,12 +1,8 @@
-use crate::{
- io::BinaryData,
- ui::{
- component::{Component, Event, EventCtx, Never},
- geometry::{Alignment2D, Rect},
- shape,
- shape::Renderer,
- },
-};
+use crate::io::BinaryData;
+use crate::ui::component::{Component, Event, EventCtx, Never};
+use crate::ui::geometry::{Alignment2D, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
pub struct Jpeg {
area: Rect,
@@ -53,7 +49,9 @@ impl crate::trace::Trace for Jpeg {
#[cfg(feature = "micropython")]
mod micropython {
- use crate::{error::Error, micropython::obj::Obj, ui::layout::obj::ComponentMsgObj};
+ use crate::error::Error;
+ use crate::micropython::obj::Obj;
+ use crate::ui::layout::obj::ComponentMsgObj;
impl ComponentMsgObj for super::Jpeg {
fn msg_try_into_obj(&self, _msg: Self::Msg) -> Result<Obj, Error> {
unreachable!();
diff --git a/core/embed/rust/src/ui/component/label.rs b/core/embed/rust/src/ui/component/label.rs
index f2a69568..ae662a06 100644
--- a/core/embed/rust/src/ui/component/label.rs
+++ b/core/embed/rust/src/ui/component/label.rs
@@ -1,14 +1,10 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx, Never},
- display::Font,
- geometry::{Alignment, Insets, Offset, Point, Rect},
- shape::Renderer,
- },
-};
-
-use super::{text::TextStyle, TextLayout};
+use super::text::TextStyle;
+use super::TextLayout;
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx, Never};
+use crate::ui::display::Font;
+use crate::ui::geometry::{Alignment, Insets, Offset, Point, Rect};
+use crate::ui::shape::Renderer;
#[derive(Clone)]
pub struct Label<'a> {
diff --git a/core/embed/rust/src/ui/component/map.rs b/core/embed/rust/src/ui/component/map.rs
index dfeda22b..e0cd50bb 100644
--- a/core/embed/rust/src/ui/component/map.rs
+++ b/core/embed/rust/src/ui/component/map.rs
@@ -1,8 +1,8 @@
use super::{Component, Event, EventCtx};
-use crate::ui::{geometry::Rect, shape::Renderer};
-
#[cfg(all(feature = "micropython", feature = "touch"))]
use crate::ui::component::swipe_detect::SwipeConfig;
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
pub struct MsgMap<T, F> {
inner: T,
diff --git a/core/embed/rust/src/ui/component/marquee.rs b/core/embed/rust/src/ui/component/marquee.rs
index 990665db..d7d40f2d 100644
--- a/core/embed/rust/src/ui/component/marquee.rs
+++ b/core/embed/rust/src/ui/component/marquee.rs
@@ -1,15 +1,11 @@
-use crate::{
- strutil::TString,
- time::{Duration, Instant},
- ui::{
- animation::Animation,
- component::{Component, Event, EventCtx, Never, Timer},
- display::{Color, Font},
- geometry::{Offset, Rect},
- shape::{self, Renderer},
- util::animation_disabled,
- },
-};
+use crate::strutil::TString;
+use crate::time::{Duration, Instant};
+use crate::ui::animation::Animation;
+use crate::ui::component::{Component, Event, EventCtx, Never, Timer};
+use crate::ui::display::{Color, Font};
+use crate::ui::geometry::{Offset, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::animation_disabled;
const ANIMATION_DURATION_MS: u32 = 2000;
const PAUSE_DURATION_MS: u32 = 1000;
diff --git a/core/embed/rust/src/ui/component/maybe.rs b/core/embed/rust/src/ui/component/maybe.rs
index ae341f3a..7008b2fb 100644
--- a/core/embed/rust/src/ui/component/maybe.rs
+++ b/core/embed/rust/src/ui/component/maybe.rs
@@ -1,9 +1,7 @@
-use crate::ui::{
- component::{Component, ComponentExt, Event, EventCtx, Pad},
- display::Color,
- geometry::Rect,
- shape::Renderer,
-};
+use crate::ui::component::{Component, ComponentExt, Event, EventCtx, Pad};
+use crate::ui::display::Color;
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
pub struct Maybe<T> {
inner: T,
diff --git a/core/embed/rust/src/ui/component/mod.rs b/core/embed/rust/src/ui/component/mod.rs
index a27ba692..a14b56ec 100644
--- a/core/embed/rust/src/ui/component/mod.rs
+++ b/core/embed/rust/src/ui/component/mod.rs
@@ -59,8 +59,6 @@ pub use qr_code::Qr;
pub use swipe::Swipe;
#[cfg(feature = "touch")]
pub use swipe_detect::SwipeDetect;
-pub use text::{
- formatted::FormattedText,
- layout::{LineBreaking, PageBreaking, TextLayout},
-};
+pub use text::formatted::FormattedText;
+pub use text::layout::{LineBreaking, PageBreaking, TextLayout};
pub use timeout::Timeout;
diff --git a/core/embed/rust/src/ui/component/pad.rs b/core/embed/rust/src/ui/component/pad.rs
index e51192cf..3cfcacb4 100644
--- a/core/embed/rust/src/ui/component/pad.rs
+++ b/core/embed/rust/src/ui/component/pad.rs
@@ -1,4 +1,7 @@
-use crate::ui::{display::Color, geometry::Rect, shape, shape::Renderer};
+use crate::ui::display::Color;
+use crate::ui::geometry::Rect;
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
pub struct Pad {
pub area: Rect,
diff --git a/core/embed/rust/src/ui/component/placed.rs b/core/embed/rust/src/ui/component/placed.rs
index 601bf256..7d30971f 100644
--- a/core/embed/rust/src/ui/component/placed.rs
+++ b/core/embed/rust/src/ui/component/placed.rs
@@ -1,10 +1,7 @@
-use crate::ui::{
- component::{Component, Event, EventCtx},
- geometry::{Alignment, Alignment2D, Axis, Grid, GridCellSpan, Insets, Offset, Rect},
- shape::Renderer,
-};
-
use super::paginated::SinglePage;
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::{Alignment, Alignment2D, Axis, Grid, GridCellSpan, Insets, Offset, Rect};
+use crate::ui::shape::Renderer;
pub struct GridPlaced<T> {
inner: T,
diff --git a/core/embed/rust/src/ui/component/qr_code.rs b/core/embed/rust/src/ui/component/qr_code.rs
index 6d173636..83702b93 100644
--- a/core/embed/rust/src/ui/component/qr_code.rs
+++ b/core/embed/rust/src/ui/component/qr_code.rs
@@ -1,18 +1,13 @@
use heapless::String;
use qrcodegen::{QrCode, QrCodeEcc, Version};
-use crate::{
- error::Error,
- ui::{
- component::{Component, Event, EventCtx, Never},
- display::Color,
- geometry::{Offset, Rect},
- shape,
- shape::Renderer,
- },
-};
-
use super::paginated::SinglePage;
+use crate::error::Error;
+use crate::ui::component::{Component, Event, EventCtx, Never};
+use crate::ui::display::Color;
+use crate::ui::geometry::{Offset, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
const NVERSIONS: usize = 10; // range of versions (=capacities) that we support
const THRESHOLDS_BINARY: [usize; NVERSIONS] = [14, 26, 42, 62, 84, 106, 122, 152, 180, 213];
@@ -137,7 +132,9 @@ impl crate::trace::Trace for Qr {
#[cfg(feature = "micropython")]
mod micropython {
- use crate::{error::Error, micropython::obj::Obj, ui::layout::obj::ComponentMsgObj};
+ use crate::error::Error;
+ use crate::micropython::obj::Obj;
+ use crate::ui::layout::obj::ComponentMsgObj;
impl ComponentMsgObj for super::Qr {
fn msg_try_into_obj(&self, _msg: Self::Msg) -> Result<Obj, Error> {
unreachable!();
diff --git a/core/embed/rust/src/ui/component/swipe.rs b/core/embed/rust/src/ui/component/swipe.rs
index 87d95762..dc866775 100644
--- a/core/embed/rust/src/ui/component/swipe.rs
+++ b/core/embed/rust/src/ui/component/swipe.rs
@@ -1,9 +1,7 @@
-use crate::ui::{
- component::{Component, Event, EventCtx},
- event::TouchEvent,
- geometry::{Direction, Point, Rect},
- shape::Renderer,
-};
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Direction, Point, Rect};
+use crate::ui::shape::Renderer;
#[derive(Clone)]
pub struct Swipe {
diff --git a/core/embed/rust/src/ui/component/swipe_detect.rs b/core/embed/rust/src/ui/component/swipe_detect.rs
index 0a6ebada..a0d7f64b 100644
--- a/core/embed/rust/src/ui/component/swipe_detect.rs
+++ b/core/embed/rust/src/ui/component/swipe_detect.rs
@@ -1,14 +1,10 @@
-use crate::{
- time::{Duration, Instant},
- ui::{
- animation::Animation,
- component::{Event, EventCtx},
- constant::screen,
- event::{SwipeEvent, TouchEvent},
- geometry::{Axis, Direction, Offset, Point},
- util::{animation_disabled, Pager},
- },
-};
+use crate::time::{Duration, Instant};
+use crate::ui::animation::Animation;
+use crate::ui::component::{Event, EventCtx};
+use crate::ui::constant::screen;
+use crate::ui::event::{SwipeEvent, TouchEvent};
+use crate::ui::geometry::{Axis, Direction, Offset, Point};
+use crate::ui::util::{animation_disabled, Pager};
#[derive(Copy, Clone)]
pub enum SwipeSettings {
diff --git a/core/embed/rust/src/ui/component/text/common.rs b/core/embed/rust/src/ui/component/text/common.rs
index e93e00f0..7560f380 100644
--- a/core/embed/rust/src/ui/component/text/common.rs
+++ b/core/embed/rust/src/ui/component/text/common.rs
@@ -1,7 +1,6 @@
-use crate::{
- strutil::ShortString,
- ui::{component::EventCtx, util::ResultExt},
-};
+use crate::strutil::ShortString;
+use crate::ui::component::EventCtx;
+use crate::ui::util::ResultExt;
/// Reified editing operations of `TextBox`.
///
diff --git a/core/embed/rust/src/ui/component/text/formatted.rs b/core/embed/rust/src/ui/component/text/formatted.rs
index 997b93ed..1e34e9ab 100644
--- a/core/embed/rust/src/ui/component/text/formatted.rs
+++ b/core/embed/rust/src/ui/component/text/formatted.rs
@@ -1,14 +1,9 @@
-use crate::ui::{
- component::{Component, Event, EventCtx, Never, Paginate},
- geometry::{Alignment, Offset, Rect},
- shape::Renderer,
- util::Pager,
-};
-
-use super::{
- layout::{LayoutFit, LayoutSink, TextNoOp, TextRenderer},
- op::OpTextLayout,
-};
+use super::layout::{LayoutFit, LayoutSink, TextNoOp, TextRenderer};
+use super::op::OpTextLayout;
+use crate::ui::component::{Component, Event, EventCtx, Never, Paginate};
+use crate::ui::geometry::{Alignment, Offset, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::util::Pager;
#[derive(Clone)]
pub struct FormattedText {
@@ -175,7 +170,9 @@ impl crate::trace::Trace for FormattedText {
#[cfg(feature = "micropython")]
mod micropython {
- use crate::{error::Error, micropython::obj::Obj, ui::layout::obj::ComponentMsgObj};
+ use crate::error::Error;
+ use crate::micropython::obj::Obj;
+ use crate::ui::layout::obj::ComponentMsgObj;
impl ComponentMsgObj for super::FormattedText {
fn msg_try_into_obj(&self, _msg: Self::Msg) -> Result<Obj, Error> {
unreachable!();
diff --git a/core/embed/rust/src/ui/component/text/layout.rs b/core/embed/rust/src/ui/component/text/layout.rs
index 150d665e..328a45cd 100644
--- a/core/embed/rust/src/ui/component/text/layout.rs
+++ b/core/embed/rust/src/ui/component/text/layout.rs
@@ -1,8 +1,7 @@
-use crate::ui::{
- display::{toif::Icon, Color, Font, GlyphMetrics},
- geometry::{Alignment, Alignment2D, Dimensions, Offset, Point, Rect},
- shape::{self, Renderer},
-};
+use crate::ui::display::toif::Icon;
+use crate::ui::display::{Color, Font, GlyphMetrics};
+use crate::ui::geometry::{Alignment, Alignment2D, Dimensions, Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
const ELLIPSIS: &str = "...";
@@ -581,9 +580,9 @@ where
#[cfg(feature = "ui_debug")]
pub mod trace {
- use crate::{trace::ListTracer, ui::geometry::Point};
-
use super::*;
+ use crate::trace::ListTracer;
+ use crate::ui::geometry::Point;
/// `LayoutSink` for debugging purposes.
pub struct TraceSink<'a>(pub &'a mut dyn ListTracer);
diff --git a/core/embed/rust/src/ui/component/text/op.rs b/core/embed/rust/src/ui/component/text/op.rs
index c8446a52..5f1bb58a 100644
--- a/core/embed/rust/src/ui/component/text/op.rs
+++ b/core/embed/rust/src/ui/component/text/op.rs
@@ -1,19 +1,12 @@
-use crate::{
- strutil::TString,
- ui::{
- display::{Color, Font},
- geometry::{Alignment, Offset, Rect},
- util::ResultExt,
- },
-};
-
-use super::{
- layout::{Chunks, LayoutFit, LayoutSink, TextLayout},
- LineBreaking, TextStyle,
-};
-
use heapless::Vec;
+use super::layout::{Chunks, LayoutFit, LayoutSink, TextLayout};
+use super::{LineBreaking, TextStyle};
+use crate::strutil::TString;
+use crate::ui::display::{Color, Font};
+use crate::ui::geometry::{Alignment, Offset, Rect};
+use crate::ui::util::ResultExt;
+
// So that there is only one implementation, and not multiple generic ones
// as would be via `const N: usize` generics.
const MAX_OPS: usize = 50;
diff --git a/core/embed/rust/src/ui/component/text/paragraphs.rs b/core/embed/rust/src/ui/component/text/paragraphs.rs
index 07c4dfd6..c41ecea9 100644
--- a/core/embed/rust/src/ui/component/text/paragraphs.rs
+++ b/core/embed/rust/src/ui/component/text/paragraphs.rs
@@ -1,17 +1,15 @@
use heapless::Vec;
-use crate::{
- strutil::TString,
- ui::{
- component::{paginated::SinglePage, Component, Event, EventCtx, Never, Paginate},
- display::{font::Font, toif::Icon, Color},
- geometry::{Alignment, Dimensions, Insets, LinearPlacement, Offset, Point, Rect},
- shape::{self, Renderer},
- util::Pager,
- },
-};
-
use super::layout::{LayoutFit, TextLayout, TextStyle};
+use crate::strutil::TString;
+use crate::ui::component::paginated::SinglePage;
+use crate::ui::component::{Component, Event, EventCtx, Never, Paginate};
+use crate::ui::display::font::Font;
+use crate::ui::display::toif::Icon;
+use crate::ui::display::Color;
+use crate::ui::geometry::{Alignment, Dimensions, Insets, LinearPlacement, Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::Pager;
/// Used as an upper bound of number of different styles we may render on single
/// page.
@@ -275,9 +273,8 @@ where
#[cfg(feature = "ui_debug")]
pub mod trace {
- use crate::ui::component::text::layout::trace::TraceSink;
-
use super::*;
+ use crate::ui::component::text::layout::trace::TraceSink;
impl<'a, T: ParagraphSource<'a>> crate::trace::Trace for Paragraphs<T> {
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
@@ -765,7 +762,9 @@ impl<'a, T: ParagraphSource<'a>> crate::trace::Trace for Checklist<T> {
#[cfg(feature = "micropython")]
mod micropython {
- use crate::{error::Error, micropython::obj::Obj, ui::layout::obj::ComponentMsgObj};
+ use crate::error::Error;
+ use crate::micropython::obj::Obj;
+ use crate::ui::layout::obj::ComponentMsgObj;
impl<'a, T: super::ParagraphSource<'a>> ComponentMsgObj for super::Checklist<T> {
fn msg_try_into_obj(&self, _msg: Self::Msg) -> Result<Obj, Error> {
unreachable!();
diff --git a/core/embed/rust/src/ui/component/text/util.rs b/core/embed/rust/src/ui/component/text/util.rs
index fe98e6b6..fd832e15 100644
--- a/core/embed/rust/src/ui/component/text/util.rs
+++ b/core/embed/rust/src/ui/component/text/util.rs
@@ -1,16 +1,9 @@
-use crate::{
- strutil::TString,
- ui::{
- display::{Color, Font},
- geometry::{Alignment, Rect},
- shape::Renderer,
- },
-};
-
-use super::{
- layout::{LayoutFit, TextLayout},
- TextStyle,
-};
+use super::layout::{LayoutFit, TextLayout};
+use super::TextStyle;
+use crate::strutil::TString;
+use crate::ui::display::{Color, Font};
+use crate::ui::geometry::{Alignment, Rect};
+use crate::ui::shape::Renderer;
/// Draws longer multiline texts inside an area.
/// Splits lines on word boundaries/whitespace.
diff --git a/core/embed/rust/src/ui/component/timeout.rs b/core/embed/rust/src/ui/component/timeout.rs
index 625f2c12..d464da26 100644
--- a/core/embed/rust/src/ui/component/timeout.rs
+++ b/core/embed/rust/src/ui/component/timeout.rs
@@ -1,11 +1,7 @@
-use crate::{
- time::Duration,
- ui::{
- component::{Component, Event, EventCtx, Timer},
- geometry::Rect,
- shape::Renderer,
- },
-};
+use crate::time::Duration;
+use crate::ui::component::{Component, Event, EventCtx, Timer};
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
pub struct Timeout {
time_ms: u32,
diff --git a/core/embed/rust/src/ui/display/font.rs b/core/embed/rust/src/ui/display/font.rs
index b6569195..dff280a6 100644
--- a/core/embed/rust/src/ui/display/font.rs
+++ b/core/embed/rust/src/ui/display/font.rs
@@ -3,16 +3,13 @@ use core::num::Saturating;
#[cfg(feature = "translations")]
use spin::RwLockReadGuard;
-use crate::ui::{
- constant,
- geometry::Offset,
- shape::{Bitmap, BitmapFormat},
-};
-
#[cfg(feature = "translations")]
use crate::translations::flash;
#[cfg(feature = "translations")]
use crate::translations::Translations;
+use crate::ui::constant;
+use crate::ui::geometry::Offset;
+use crate::ui::shape::{Bitmap, BitmapFormat};
#[cfg(feature = "ui_font_kerning")]
/// Two-level kerning lookup table.
diff --git a/core/embed/rust/src/ui/display/image.rs b/core/embed/rust/src/ui/display/image.rs
index 34e0ef5d..b5ab3c22 100644
--- a/core/embed/rust/src/ui/display/image.rs
+++ b/core/embed/rust/src/ui/display/image.rs
@@ -1,4 +1,5 @@
-use crate::{io::BinaryData, ui::geometry::Offset};
+use crate::io::BinaryData;
+use crate::ui::geometry::Offset;
impl<'a> BinaryData<'a> {
fn read_u8(&self, ofs: usize) -> Option<u8> {
diff --git a/core/embed/rust/src/ui/display/mod.rs b/core/embed/rust/src/ui/display/mod.rs
index e4b937b2..1f5f36a4 100644
--- a/core/embed/rust/src/ui/display/mod.rs
+++ b/core/embed/rust/src/ui/display/mod.rs
@@ -3,24 +3,21 @@ pub mod font;
pub mod image;
pub mod toif;
-use super::geometry::{Offset, Point, Rect};
-
-#[cfg(feature = "backlight")]
-use crate::{time::Duration, trezorhal::time};
-
-use crate::{strutil::TString, trezorhal::display};
+pub use color::Color;
+pub use font::{Font, Glyph, GlyphMetrics};
+use super::geometry::{Offset, Point, Rect};
+use crate::strutil::TString;
+use crate::trezorhal::display;
+// Reexports
+pub use crate::ui::display::toif::Icon;
#[cfg(feature = "backlight")]
use crate::ui::lerp::Lerp;
-
+#[cfg(feature = "backlight")]
+use crate::{time::Duration, trezorhal::time};
#[cfg(feature = "backlight")]
use crate::{time::Stopwatch, ui::util::animation_disabled};
-// Reexports
-pub use crate::ui::display::toif::Icon;
-pub use color::Color;
-pub use font::{Font, Glyph, GlyphMetrics};
-
pub const LOADER_MIN: u16 = 0;
pub const LOADER_MAX: u16 = 1000;
diff --git a/core/embed/rust/src/ui/display/toif.rs b/core/embed/rust/src/ui/display/toif.rs
index 43fff5d0..f3750229 100644
--- a/core/embed/rust/src/ui/display/toif.rs
+++ b/core/embed/rust/src/ui/display/toif.rs
@@ -1,7 +1,5 @@
-use crate::{
- error::{value_error, Error},
- ui::geometry::Offset,
-};
+use crate::error::{value_error, Error};
+use crate::ui::geometry::Offset;
const TOIF_HEADER_LENGTH: usize = 12;
diff --git a/core/embed/rust/src/ui/event/button.rs b/core/embed/rust/src/ui/event/button.rs
index 54cf99d1..ea5d4698 100644
--- a/core/embed/rust/src/ui/event/button.rs
+++ b/core/embed/rust/src/ui/event/button.rs
@@ -1,5 +1,4 @@
use crate::error::Error;
-
pub use crate::trezorhal::button::PhysicalButton;
use crate::trezorhal::button::PhysicalButtonEvent;
diff --git a/core/embed/rust/src/ui/event/mod.rs b/core/embed/rust/src/ui/event/mod.rs
index d917163c..03a6c4a0 100644
--- a/core/embed/rust/src/ui/event/mod.rs
+++ b/core/embed/rust/src/ui/event/mod.rs
@@ -19,5 +19,4 @@ pub use button::{ButtonEvent, PhysicalButton};
pub use power_manager::PMEvent;
#[cfg(feature = "touch")]
pub use touch::{SwipeEvent, TouchEvent};
-
pub use usb::USBEvent;
diff --git a/core/embed/rust/src/ui/event/touch.rs b/core/embed/rust/src/ui/event/touch.rs
index b99310eb..9bde3283 100644
--- a/core/embed/rust/src/ui/event/touch.rs
+++ b/core/embed/rust/src/ui/event/touch.rs
@@ -1,7 +1,5 @@
-use crate::{
- error::Error,
- ui::geometry::{Direction, Point},
-};
+use crate::error::Error;
+use crate::ui::geometry::{Direction, Point};
#[derive(Copy, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
diff --git a/core/embed/rust/src/ui/flow/base.rs b/core/embed/rust/src/ui/flow/base.rs
index f17f96c2..a0a261f6 100644
--- a/core/embed/rust/src/ui/flow/base.rs
+++ b/core/embed/rust/src/ui/flow/base.rs
@@ -1,10 +1,8 @@
-use crate::ui::{
- component::{base::AttachType, swipe_detect::SwipeConfig},
- geometry::Direction,
- util::Pager,
-};
-
+use crate::ui::component::base::AttachType;
+use crate::ui::component::swipe_detect::SwipeConfig;
pub use crate::ui::component::FlowMsg;
+use crate::ui::geometry::Direction;
+use crate::ui::util::Pager;
pub trait Swipable {
fn get_swipe_config(&self) -> SwipeConfig;
diff --git a/core/embed/rust/src/ui/flow/mod.rs b/core/embed/rust/src/ui/flow/mod.rs
index a464c8f7..8e4db948 100644
--- a/core/embed/rust/src/ui/flow/mod.rs
+++ b/core/embed/rust/src/ui/flow/mod.rs
@@ -2,7 +2,8 @@ pub mod base;
pub mod page;
mod swipe;
-pub use crate::ui::component::FlowMsg;
pub use base::{FlowController, Swipable};
pub use page::SwipePage;
pub use swipe::SwipeFlow;
+
+pub use crate::ui::component::FlowMsg;
diff --git a/core/embed/rust/src/ui/flow/page.rs b/core/embed/rust/src/ui/flow/page.rs
index 1e25f3be..2e89bdd4 100644
--- a/core/embed/rust/src/ui/flow/page.rs
+++ b/core/embed/rust/src/ui/flow/page.rs
@@ -1,10 +1,8 @@
-use crate::ui::{
- component::{Component, Event, EventCtx, Paginate},
- event::SwipeEvent,
- geometry::{Axis, Direction, Rect},
- shape::Renderer,
- util::Pager,
-};
+use crate::ui::component::{Component, Event, EventCtx, Paginate};
+use crate::ui::event::SwipeEvent;
+use crate::ui::geometry::{Axis, Direction, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::util::Pager;
/// Allows any implementor of `Paginate` to be part of `Swipable` UI flow.
/// Renders sliding animation when changing pages.
diff --git a/core/embed/rust/src/ui/flow/swipe.rs b/core/embed/rust/src/ui/flow/swipe.rs
index 8593bb75..b44b925e 100644
--- a/core/embed/rust/src/ui/flow/swipe.rs
+++ b/core/embed/rust/src/ui/flow/swipe.rs
@@ -1,30 +1,23 @@
-use crate::{
- error::{self, Error},
- maybe_trace::MaybeTrace,
- micropython::{
- gc::{self, GcBox},
- obj::Obj,
- },
- ui::{
- component::{
- base::AttachType::{self, Swipe},
- Component, Event, EventCtx, FlowMsg, SwipeDetect,
- },
- display::Color,
- event::SwipeEvent,
- flow::{base::Decision, FlowController},
- geometry::{Direction, Rect},
- layout::base::{Layout, LayoutState},
- shape::{render_on_display, ConcreteRenderer, Renderer, ScopedRenderer},
- util::animation_disabled,
- CommonUI, ModelUI,
- },
-};
-
-use super::{base::FlowState, Swipable};
-
use heapless::Vec;
+use super::base::FlowState;
+use super::Swipable;
+use crate::error::{self, Error};
+use crate::maybe_trace::MaybeTrace;
+use crate::micropython::gc::{self, GcBox};
+use crate::micropython::obj::Obj;
+use crate::ui::component::base::AttachType::{self, Swipe};
+use crate::ui::component::{Component, Event, EventCtx, FlowMsg, SwipeDetect};
+use crate::ui::display::Color;
+use crate::ui::event::SwipeEvent;
+use crate::ui::flow::base::Decision;
+use crate::ui::flow::FlowController;
+use crate::ui::geometry::{Direction, Rect};
+use crate::ui::layout::base::{Layout, LayoutState};
+use crate::ui::shape::{render_on_display, ConcreteRenderer, Renderer, ScopedRenderer};
+use crate::ui::util::animation_disabled;
+use crate::ui::{CommonUI, ModelUI};
+
/// Component-like proto-object-safe trait.
///
/// This copies the Component interface, but it is parametrized by a concrete
diff --git a/core/embed/rust/src/ui/geometry.rs b/core/embed/rust/src/ui/geometry.rs
index b9f53bc8..76489623 100644
--- a/core/embed/rust/src/ui/geometry.rs
+++ b/core/embed/rust/src/ui/geometry.rs
@@ -1,6 +1,7 @@
-use crate::ui::lerp::Lerp;
use core::ops::{Add, Mul, Neg, Sub};
+use crate::ui::lerp::Lerp;
+
const fn min(a: i16, b: i16) -> i16 {
if a < b {
a
diff --git a/core/embed/rust/src/ui/layout/base.rs b/core/embed/rust/src/ui/layout/base.rs
index eacc1682..d42c0de9 100644
--- a/core/embed/rust/src/ui/layout/base.rs
+++ b/core/embed/rust/src/ui/layout/base.rs
@@ -1,9 +1,7 @@
-use crate::ui::{
- button_request::ButtonRequest,
- component::{base::AttachType, Event, EventCtx},
-};
-
use crate::error::Error;
+use crate::ui::button_request::ButtonRequest;
+use crate::ui::component::base::AttachType;
+use crate::ui::component::{Event, EventCtx};
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum LayoutState {
@@ -22,15 +20,12 @@ pub trait Layout<T> {
#[cfg(feature = "micropython")]
mod micropython {
- use crate::micropython::{
- macros::{obj_dict, obj_map, obj_type},
- obj::Obj,
- qstr::Qstr,
- simple_type::SimpleTypeObj,
- typ::Type,
- };
-
use super::LayoutState;
+ use crate::micropython::macros::{obj_dict, obj_map, obj_type};
+ use crate::micropython::obj::Obj;
+ use crate::micropython::qstr::Qstr;
+ use crate::micropython::simple_type::SimpleTypeObj;
+ use crate::micropython::typ::Type;
static STATE_INITIAL_TYPE: Type = obj_type! {
name: Qstr::MP_QSTR_INITIAL,
diff --git a/core/embed/rust/src/ui/layout/device_menu_result.rs b/core/embed/rust/src/ui/layout/device_menu_result.rs
index 29d016ff..a31471e6 100644
--- a/core/embed/rust/src/ui/layout/device_menu_result.rs
+++ b/core/embed/rust/src/ui/layout/device_menu_result.rs
@@ -1,9 +1,10 @@
-use crate::{
- error::Error,
- micropython::{
- ffi, macros::obj_type, obj::Obj, qstr::Qstr, simple_type::SimpleTypeObj, typ::Type, util,
- },
-};
+use crate::error::Error;
+use crate::micropython::macros::obj_type;
+use crate::micropython::obj::Obj;
+use crate::micropython::qstr::Qstr;
+use crate::micropython::simple_type::SimpleTypeObj;
+use crate::micropython::typ::Type;
+use crate::micropython::{ffi, util};
#[derive(Copy, Clone)]
pub enum DeviceMenuMsg {
diff --git a/core/embed/rust/src/ui/layout/obj.rs b/core/embed/rust/src/ui/layout/obj.rs
index a1ff12c2..09eb5852 100644
--- a/core/embed/rust/src/ui/layout/obj.rs
+++ b/core/embed/rust/src/ui/layout/obj.rs
@@ -1,60 +1,48 @@
-use core::{
- cell::{RefCell, RefMut},
- convert::{TryFrom, TryInto},
- marker::PhantomData,
- ops::{Deref, DerefMut},
-};
-use num_traits::FromPrimitive;
+use core::cell::{RefCell, RefMut};
+use core::convert::{TryFrom, TryInto};
+use core::marker::PhantomData;
+use core::ops::{Deref, DerefMut};
-#[cfg(feature = "touch")]
-use crate::ui::{event::TouchEvent, geometry::Direction};
+use num_traits::FromPrimitive;
#[cfg(feature = "touch")]
use num_traits::ToPrimitive;
+use super::base::{Layout, LayoutState};
+use crate::error::Error;
+use crate::maybe_trace::MaybeTrace;
+use crate::micropython::buffer::StrBuffer;
+use crate::micropython::gc::{self, Gc, GcBox};
+use crate::micropython::macros::{
+ obj_dict, obj_fn_1, obj_fn_2, obj_fn_3, obj_fn_var, obj_map, obj_type,
+};
+use crate::micropython::map::Map;
+use crate::micropython::obj::{Obj, ObjBase};
+use crate::micropython::qstr::Qstr;
+use crate::micropython::simple_type::SimpleTypeObj;
+use crate::micropython::typ::Type;
+use crate::micropython::util;
+use crate::time::Duration;
+use crate::ui::button_request::ButtonRequest;
+use crate::ui::component::base::{AttachType, TimerToken};
+use crate::ui::component::{Component, Event, EventCtx, Never};
+use crate::ui::display::{self, Color};
#[cfg(feature = "ble")]
use crate::ui::event::BLEEvent;
-
+#[cfg(feature = "power_manager")]
+use crate::ui::event::PMEvent;
+use crate::ui::event::USBEvent;
+use crate::ui::shape::render_on_display;
+#[cfg(any(feature = "rgb_led", feature = "ui_debug"))]
+use crate::ui::shape::Renderer;
+#[cfg(feature = "touch")]
+use crate::ui::{event::TouchEvent, geometry::Direction};
+use crate::ui::{CommonUI, ModelUI};
#[cfg(feature = "button")]
use crate::{
trezorhal::button::{PhysicalButton, PhysicalButtonEvent},
ui::event::ButtonEvent,
};
-#[cfg(feature = "power_manager")]
-use crate::ui::event::PMEvent;
-
-use super::base::{Layout, LayoutState};
-use crate::{
- error::Error,
- maybe_trace::MaybeTrace,
- micropython::{
- buffer::StrBuffer,
- gc::{self, Gc, GcBox},
- macros::{obj_dict, obj_fn_1, obj_fn_2, obj_fn_3, obj_fn_var, obj_map, obj_type},
- map::Map,
- obj::{Obj, ObjBase},
- qstr::Qstr,
- simple_type::SimpleTypeObj,
- typ::Type,
- util,
- },
- time::Duration,
- ui::{
- button_request::ButtonRequest,
- component::{
- base::{AttachType, TimerToken},
- Component, Event, EventCtx, Never,
- },
- display::{self, Color},
- event::USBEvent,
- shape::render_on_display,
- CommonUI, ModelUI,
- },
-};
-
-#[cfg(any(feature = "rgb_led", feature = "ui_debug"))]
-use crate::ui::shape::Renderer;
-
impl AttachType {
fn to_obj(self) -> Obj {
match self {
diff --git a/core/embed/rust/src/ui/layout/result.rs b/core/embed/rust/src/ui/layout/result.rs
index ff35b9cd..4e3f470c 100644
--- a/core/embed/rust/src/ui/layout/result.rs
+++ b/core/embed/rust/src/ui/layout/result.rs
@@ -1,4 +1,7 @@
-use crate::micropython::{macros::obj_type, qstr::Qstr, simple_type::SimpleTypeObj, typ::Type};
+use crate::micropython::macros::obj_type;
+use crate::micropython::qstr::Qstr;
+use crate::micropython::simple_type::SimpleTypeObj;
+use crate::micropython::typ::Type;
static CONFIRMED_TYPE: Type = obj_type! { name: Qstr::MP_QSTR_CONFIRMED, };
static CANCELLED_TYPE: Type = obj_type! { name: Qstr::MP_QSTR_CANCELLED, };
diff --git a/core/embed/rust/src/ui/layout/simplified.rs b/core/embed/rust/src/ui/layout/simplified.rs
index ea9a4f29..19a72007 100644
--- a/core/embed/rust/src/ui/layout/simplified.rs
+++ b/core/embed/rust/src/ui/layout/simplified.rs
@@ -1,17 +1,16 @@
+use num_traits::ToPrimitive;
+
#[cfg(feature = "button")]
use crate::trezorhal::button::button_get_event;
+use crate::ui::component::base::AttachType;
+use crate::ui::component::{Component, Event, EventCtx, Never};
+use crate::ui::display::color::Color;
#[cfg(feature = "button")]
use crate::ui::event::ButtonEvent;
#[cfg(feature = "touch")]
use crate::ui::event::TouchEvent;
-use crate::ui::{
- component::{base::AttachType, Component, EventCtx, Never},
- display, CommonUI, ModelUI,
-};
-
-use crate::ui::{component::Event, display::color::Color, shape::render_on_display};
-
-use num_traits::ToPrimitive;
+use crate::ui::shape::render_on_display;
+use crate::ui::{display, CommonUI, ModelUI};
pub trait ReturnToC {
fn return_to_c(self) -> u32;
diff --git a/core/embed/rust/src/ui/layout/util.rs b/core/embed/rust/src/ui/layout/util.rs
index 289f8cf6..caa18d37 100644
--- a/core/embed/rust/src/ui/layout/util.rs
+++ b/core/embed/rust/src/ui/layout/util.rs
@@ -1,23 +1,15 @@
-use crate::{
- error::{value_error, Error},
- io::BinaryData,
- micropython::{
- buffer::{hexlify_bytes, StrBuffer},
- gc::Gc,
- list::List,
- obj::Obj,
- util::{iter_into_array, try_or_raise},
- },
- storage::{get_avatar_len, load_avatar},
- strutil::TString,
- ui::{
- component::text::{
- paragraphs::{Paragraph, ParagraphSource},
- TextStyle,
- },
- util::set_animation_disabled,
- },
-};
+use crate::error::{value_error, Error};
+use crate::io::BinaryData;
+use crate::micropython::buffer::{hexlify_bytes, StrBuffer};
+use crate::micropython::gc::Gc;
+use crate::micropython::list::List;
+use crate::micropython::obj::Obj;
+use crate::micropython::util::{iter_into_array, try_or_raise};
+use crate::storage::{get_avatar_len, load_avatar};
+use crate::strutil::TString;
+use crate::ui::component::text::paragraphs::{Paragraph, ParagraphSource};
+use crate::ui::component::text::TextStyle;
+use crate::ui::util::set_animation_disabled;
cfg_if::cfg_if! {
if #[cfg(feature = "layout_bolt")] {
diff --git a/core/embed/rust/src/ui/layout_bolt/bootloader/connect.rs b/core/embed/rust/src/ui/layout_bolt/bootloader/connect.rs
index a4b08999..ec97914e 100644
--- a/core/embed/rust/src/ui/layout_bolt/bootloader/connect.rs
+++ b/core/embed/rust/src/ui/layout_bolt/bootloader/connect.rs
@@ -1,21 +1,14 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx, Pad},
- display::{Color, Font, Icon},
- geometry::{Alignment, Insets, Offset, Point, Rect},
- shape::{self, Renderer},
- },
-};
-
-use super::super::{
- component::{Button, ButtonMsg},
- constant::WIDTH,
- theme::bootloader::{
- button_bld, button_bld_menu, button_initial, BLD_BG, BUTTON_AREA_START, BUTTON_HEIGHT,
- CONTENT_PADDING, CORNER_BUTTON_AREA, MENU32, WELCOME_COLOR,
- },
+use super::super::component::{Button, ButtonMsg};
+use super::super::constant::WIDTH;
+use super::super::theme::bootloader::{
+ button_bld, button_bld_menu, button_initial, BLD_BG, BUTTON_AREA_START, BUTTON_HEIGHT,
+ CONTENT_PADDING, CORNER_BUTTON_AREA, MENU32, WELCOME_COLOR,
};
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx, Pad};
+use crate::ui::display::{Color, Font, Icon};
+use crate::ui::geometry::{Alignment, Insets, Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
#[repr(u32)]
#[derive(Copy, Clone, ToPrimitive)]
diff --git a/core/embed/rust/src/ui/layout_bolt/bootloader/intro.rs b/core/embed/rust/src/ui/layout_bolt/bootloader/intro.rs
index 091743c0..db1f82f5 100644
--- a/core/embed/rust/src/ui/layout_bolt/bootloader/intro.rs
+++ b/core/embed/rust/src/ui/layout_bolt/bootloader/intro.rs
@@ -1,22 +1,16 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx, Label, Pad},
- constant::screen,
- display::Icon,
- geometry::{Alignment, Insets, Point, Rect},
- shape::Renderer,
- },
-};
-
-use super::super::{
- component::{Button, ButtonMsg::Clicked},
- constant::WIDTH,
- theme::bootloader::{
- button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_AREA_START, BUTTON_HEIGHT,
- CONTENT_PADDING, CORNER_BUTTON_AREA, MENU32, TEXT_NORMAL, TEXT_WARNING, TITLE_AREA,
- },
+use super::super::component::Button;
+use super::super::component::ButtonMsg::Clicked;
+use super::super::constant::WIDTH;
+use super::super::theme::bootloader::{
+ button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_AREA_START, BUTTON_HEIGHT,
+ CONTENT_PADDING, CORNER_BUTTON_AREA, MENU32, TEXT_NORMAL, TEXT_WARNING, TITLE_AREA,
};
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx, Label, Pad};
+use crate::ui::constant::screen;
+use crate::ui::display::Icon;
+use crate::ui::geometry::{Alignment, Insets, Point, Rect};
+use crate::ui::shape::Renderer;
#[repr(u32)]
#[derive(Copy, Clone, ToPrimitive)]
diff --git a/core/embed/rust/src/ui/layout_bolt/bootloader/menu.rs b/core/embed/rust/src/ui/layout_bolt/bootloader/menu.rs
index 5c8f3fe1..3c4157de 100644
--- a/core/embed/rust/src/ui/layout_bolt/bootloader/menu.rs
+++ b/core/embed/rust/src/ui/layout_bolt/bootloader/menu.rs
@@ -1,18 +1,14 @@
-use crate::ui::{
- component::{Component, Event, EventCtx, Label, Pad},
- constant::{screen, WIDTH},
- display::Icon,
- geometry::{Insets, Point, Rect},
- shape::Renderer,
-};
-
-use super::super::{
- component::{Button, ButtonMsg::Clicked, IconText},
- theme::bootloader::{
- button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_HEIGHT, CONTENT_PADDING,
- CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, FIRE24, REFRESH24, TITLE_AREA, X32,
- },
+use super::super::component::ButtonMsg::Clicked;
+use super::super::component::{Button, IconText};
+use super::super::theme::bootloader::{
+ button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_HEIGHT, CONTENT_PADDING,
+ CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, FIRE24, REFRESH24, TITLE_AREA, X32,
};
+use crate::ui::component::{Component, Event, EventCtx, Label, Pad};
+use crate::ui::constant::{screen, WIDTH};
+use crate::ui::display::Icon;
+use crate::ui::geometry::{Insets, Point, Rect};
+use crate::ui::shape::Renderer;
const BUTTON_AREA_START: i16 = 56;
const BUTTON_SPACING: i16 = 8;
diff --git a/core/embed/rust/src/ui/layout_bolt/bootloader/mod.rs b/core/embed/rust/src/ui/layout_bolt/bootloader/mod.rs
index e642e4a9..9d0d2e64 100644
--- a/core/embed/rust/src/ui/layout_bolt/bootloader/mod.rs
+++ b/core/embed/rust/src/ui/layout_bolt/bootloader/mod.rs
@@ -7,52 +7,41 @@ pub mod welcome;
pub mod pairing_finalization;
use heapless::String;
-use ufmt::uwrite;
-
-use super::{
- bootloader::{connect::Connect, welcome::Welcome},
- component::{
- bl_confirm::{Confirm, ConfirmTitle},
- Button, ResultScreen, WelcomeScreen,
- },
- cshape::{render_loader, LoaderRange},
- fonts,
- theme::{
- self,
- bootloader::{
- button_bld, button_bld_menu, button_confirm, button_wipe_cancel, button_wipe_confirm,
- BLD_BG, BLD_FG, BLD_TITLE_COLOR, BLD_WARN_COLOR, BLD_WIPE_COLOR, CHECK24, CHECK40,
- DOWNLOAD32, FIRE32, FIRE40, RESULT_FW_INSTALL, RESULT_INITIAL, RESULT_WIPE, TEXT_BOLD,
- TEXT_NORMAL, TEXT_WIPE_BOLD, TEXT_WIPE_NORMAL, WARNING40, WELCOME_COLOR, X24,
- },
- FG,
- },
- UIBolt,
-};
-use crate::{
- bootloader::run,
- time::Duration,
- trezorhal::time,
- ui::{
- component::Label,
- display::{self, toif::Toif, Color, Icon, LOADER_MAX},
- geometry::{Alignment, Alignment2D, Offset, Point, Rect},
- layout::simplified::show,
- shape::{self, render_on_display},
- ui_bootloader::BootloaderUI,
- util::animation_disabled,
- CommonUI,
- },
-};
use intro::Intro;
use menu::Menu;
+use ufmt::uwrite;
+use super::bootloader::connect::Connect;
+use super::bootloader::welcome::Welcome;
+use super::component::bl_confirm::{Confirm, ConfirmTitle};
+use super::component::{Button, ResultScreen, WelcomeScreen};
+use super::cshape::{render_loader, LoaderRange};
+use super::theme::bootloader::{
+ button_bld, button_bld_menu, button_confirm, button_wipe_cancel, button_wipe_confirm, BLD_BG,
+ BLD_FG, BLD_TITLE_COLOR, BLD_WARN_COLOR, BLD_WIPE_COLOR, CHECK24, CHECK40, DOWNLOAD32, FIRE32,
+ FIRE40, RESULT_FW_INSTALL, RESULT_INITIAL, RESULT_WIPE, TEXT_BOLD, TEXT_NORMAL, TEXT_WIPE_BOLD,
+ TEXT_WIPE_NORMAL, WARNING40, WELCOME_COLOR, X24,
+};
+use super::theme::{self, FG};
#[cfg(feature = "ble")]
use super::{
bootloader::pairing_finalization::PairingFinalization,
component::{confirm_pairing::ConfirmPairing, pairing_mode::PairingMode},
theme::bootloader::{button_confirm_initial, button_initial},
};
+use super::{fonts, UIBolt};
+use crate::bootloader::run;
+use crate::time::Duration;
+use crate::trezorhal::time;
+use crate::ui::component::Label;
+use crate::ui::display::toif::Toif;
+use crate::ui::display::{self, Color, Icon, LOADER_MAX};
+use crate::ui::geometry::{Alignment, Alignment2D, Offset, Point, Rect};
+use crate::ui::layout::simplified::show;
+use crate::ui::shape::{self, render_on_display};
+use crate::ui::ui_bootloader::BootloaderUI;
+use crate::ui::util::animation_disabled;
+use crate::ui::CommonUI;
pub type BootloaderString = String<128>;
diff --git a/core/embed/rust/src/ui/layout_bolt/bootloader/pairing_finalization.rs b/core/embed/rust/src/ui/layout_bolt/bootloader/pairing_finalization.rs
index ec68711f..187612b7 100644
--- a/core/embed/rust/src/ui/layout_bolt/bootloader/pairing_finalization.rs
+++ b/core/embed/rust/src/ui/layout_bolt/bootloader/pairing_finalization.rs
@@ -1,19 +1,12 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx, Pad},
- display::{Color, Font},
- event::BLEEvent,
- geometry::{Alignment, Offset, Point, Rect},
- shape::{self, Renderer},
- },
-};
-
-use super::super::{
- component::{Button, ButtonMsg},
- constant::WIDTH,
- theme::bootloader::{BUTTON_AREA_START, BUTTON_HEIGHT, CONTENT_PADDING},
-};
+use super::super::component::{Button, ButtonMsg};
+use super::super::constant::WIDTH;
+use super::super::theme::bootloader::{BUTTON_AREA_START, BUTTON_HEIGHT, CONTENT_PADDING};
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx, Pad};
+use crate::ui::display::{Color, Font};
+use crate::ui::event::BLEEvent;
+use crate::ui::geometry::{Alignment, Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
#[repr(u32)]
#[derive(Copy, Clone, ToPrimitive)]
diff --git a/core/embed/rust/src/ui/layout_bolt/bootloader/welcome.rs b/core/embed/rust/src/ui/layout_bolt/bootloader/welcome.rs
index bcc33eec..bd1aab12 100644
--- a/core/embed/rust/src/ui/layout_bolt/bootloader/welcome.rs
+++ b/core/embed/rust/src/ui/layout_bolt/bootloader/welcome.rs
@@ -1,25 +1,17 @@
-use super::super::{
- fonts,
- theme::{
- bootloader::{START_URL, WELCOME_COLOR},
- GREY_MEDIUM, WHITE,
- },
-};
-use crate::ui::{
- component::{Component, Event, EventCtx, Pad},
- constant::screen,
- display::{toif::Toif, Icon},
- geometry::{Alignment, Alignment2D, Insets, Offset, Rect},
- shape::{self, Renderer},
-};
-
-use super::super::{
- component::Button,
- theme::bootloader::{button_initial, CORNER_BUTTON_AREA, MENU32},
-};
-
+use super::super::component::Button;
#[cfg(feature = "power_manager")]
use super::super::component::ButtonMsg::Clicked;
+use super::super::fonts;
+use super::super::theme::bootloader::{
+ button_initial, CORNER_BUTTON_AREA, MENU32, START_URL, WELCOME_COLOR,
+};
+use super::super::theme::{GREY_MEDIUM, WHITE};
+use crate::ui::component::{Component, Event, EventCtx, Pad};
+use crate::ui::constant::screen;
+use crate::ui::display::toif::Toif;
+use crate::ui::display::Icon;
+use crate::ui::geometry::{Alignment, Alignment2D, Insets, Offset, Rect};
+use crate::ui::shape::{self, Renderer};
#[repr(u32)]
#[derive(Copy, Clone, ToPrimitive)]
diff --git a/core/embed/rust/src/ui/layout_bolt/component/address_details.rs b/core/embed/rust/src/ui/layout_bolt/component/address_details.rs
index dfda7582..3dd132c6 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/address_details.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/address_details.rs
@@ -1,23 +1,18 @@
use heapless::Vec;
-use crate::{
- error::Error,
- micropython::buffer::StrBuffer,
- strutil::TString,
- translations::TR,
- ui::{
- component::{
- text::paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt},
- Component, Event, EventCtx, Paginate, Qr,
- },
- geometry::Rect,
- layout::util::MAX_XPUBS,
- shape::Renderer,
- util::Pager,
- },
-};
-
use super::{theme, Frame, FrameMsg};
+use crate::error::Error;
+use crate::micropython::buffer::StrBuffer;
+use crate::strutil::TString;
+use crate::translations::TR;
+use crate::ui::component::text::paragraphs::{
+ Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt,
+};
+use crate::ui::component::{Component, Event, EventCtx, Paginate, Qr};
+use crate::ui::geometry::Rect;
+use crate::ui::layout::util::MAX_XPUBS;
+use crate::ui::shape::Renderer;
+use crate::ui::util::Pager;
pub struct AddressDetails {
qr_code: Frame<Qr>,
diff --git a/core/embed/rust/src/ui/layout_bolt/component/bl_confirm.rs b/core/embed/rust/src/ui/layout_bolt/component/bl_confirm.rs
index acc45b81..5c3d32b1 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/bl_confirm.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/bl_confirm.rs
@@ -1,31 +1,18 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Child, Component, ComponentExt, Event, EventCtx, Label, Pad},
- constant,
- constant::screen,
- display::{Color, Icon},
- geometry::{Alignment2D, Insets, Offset, Point, Rect},
- shape,
- shape::Renderer,
- },
-};
-
-use super::{
- super::{
- constant::WIDTH,
- theme::{
- bootloader::{
- text_fingerprint, text_title, BUTTON_AREA_START, BUTTON_HEIGHT, CONTENT_PADDING,
- CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, INFO32, TITLE_AREA, X32,
- },
- WHITE,
- },
- },
- Button,
- ButtonMsg::Clicked,
- ButtonStyleSheet,
+use super::super::constant::WIDTH;
+use super::super::theme::bootloader::{
+ text_fingerprint, text_title, BUTTON_AREA_START, BUTTON_HEIGHT, CONTENT_PADDING,
+ CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, INFO32, TITLE_AREA, X32,
};
+use super::super::theme::WHITE;
+use super::ButtonMsg::Clicked;
+use super::{Button, ButtonStyleSheet};
+use crate::strutil::TString;
+use crate::ui::component::{Child, Component, ComponentExt, Event, EventCtx, Label, Pad};
+use crate::ui::constant::screen;
+use crate::ui::display::{Color, Icon};
+use crate::ui::geometry::{Alignment2D, Insets, Offset, Point, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::{constant, shape};
const ICON_TOP: i16 = 17;
const CONTENT_START: i16 = 72;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/button.rs b/core/embed/rust/src/ui/layout_bolt/component/button.rs
index 71a09a07..b299aa5f 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/button.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/button.rs
@@ -1,22 +1,18 @@
+use super::theme;
+use crate::strutil::TString;
+use crate::time::ShortDuration;
#[cfg(feature = "haptic")]
use crate::trezorhal::haptic::{self, HapticEffect};
-use crate::{
- strutil::TString,
- time::ShortDuration,
- ui::{
- component::{
- Component, ComponentExt, Event, EventCtx, FixedHeightBar, MsgMap, Split, Timer,
- },
- constant,
- display::{toif::Icon, Color, Font},
- event::TouchEvent,
- geometry::{Alignment2D, Insets, Offset, Point, Rect},
- shape::{self, Renderer},
- util::split_two_lines,
- },
+use crate::ui::component::{
+ Component, ComponentExt, Event, EventCtx, FixedHeightBar, MsgMap, Split, Timer,
};
-
-use super::theme;
+use crate::ui::constant;
+use crate::ui::display::toif::Icon;
+use crate::ui::display::{Color, Font};
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Alignment2D, Insets, Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::split_two_lines;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum ButtonMsg {
diff --git a/core/embed/rust/src/ui/layout_bolt/component/coinjoin_progress.rs b/core/embed/rust/src/ui/layout_bolt/component/coinjoin_progress.rs
index 22843dec..33b156ca 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/coinjoin_progress.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/coinjoin_progress.rs
@@ -1,23 +1,18 @@
use core::mem;
-use crate::{
- error::Error,
- maybe_trace::MaybeTrace,
- strutil::TString,
- translations::TR,
- ui::{
- component::{
- base::Never, Bar, Child, Component, ComponentExt, Empty, Event, EventCtx, Label, Split,
- },
- constant,
- geometry::{Insets, Offset, Rect},
- shape,
- shape::Renderer,
- util::animation_disabled,
- },
-};
-
use super::{theme, Frame};
+use crate::error::Error;
+use crate::maybe_trace::MaybeTrace;
+use crate::strutil::TString;
+use crate::translations::TR;
+use crate::ui::component::base::Never;
+use crate::ui::component::{
+ Bar, Child, Component, ComponentExt, Empty, Event, EventCtx, Label, Split,
+};
+use crate::ui::geometry::{Insets, Offset, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::util::animation_disabled;
+use crate::ui::{constant, shape};
const RECTANGLE_HEIGHT: i16 = 56;
const LABEL_TOP: i16 = 135;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/confirm_pairing.rs b/core/embed/rust/src/ui/layout_bolt/component/confirm_pairing.rs
index c6c1617a..0f77e6a8 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/confirm_pairing.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/confirm_pairing.rs
@@ -1,25 +1,18 @@
-use super::{
- super::{
- constant::WIDTH,
- theme::bootloader::{BUTTON_AREA_START, BUTTON_HEIGHT, CONTENT_PADDING, TITLE_AREA},
- },
- Button,
- ButtonMsg::Clicked,
+use super::super::constant::WIDTH;
+use super::super::fonts;
+use super::super::theme::bootloader::{
+ BUTTON_AREA_START, BUTTON_HEIGHT, CONTENT_PADDING, TITLE_AREA,
};
-use crate::{
- strutil::format_i64,
- ui::{
- component::{Child, Component, Event, EventCtx, Label, Pad},
- constant,
- display::Color,
- event::BLEEvent,
- geometry::{Offset, Point, Rect},
- shape,
- shape::Renderer,
- },
-};
-
-use super::{super::fonts, theme::WHITE};
+use super::theme::WHITE;
+use super::Button;
+use super::ButtonMsg::Clicked;
+use crate::strutil::format_i64;
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Pad};
+use crate::ui::display::Color;
+use crate::ui::event::BLEEvent;
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::{constant, shape};
const ICON_TOP: i16 = 17;
const CONTENT_START: i16 = 72;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/dialog.rs b/core/embed/rust/src/ui/layout_bolt/component/dialog.rs
index 77409553..b26b6e79 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/dialog.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/dialog.rs
@@ -1,20 +1,13 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{
- image::BlendedImage,
- text::{
- paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt},
- TextStyle,
- },
- Child, Component, Event, EventCtx, Never,
- },
- geometry::{Insets, LinearPlacement, Rect},
- shape::Renderer,
- },
-};
-
use super::theme;
+use crate::strutil::TString;
+use crate::ui::component::image::BlendedImage;
+use crate::ui::component::text::paragraphs::{
+ Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt,
+};
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{Child, Component, Event, EventCtx, Never};
+use crate::ui::geometry::{Insets, LinearPlacement, Rect};
+use crate::ui::shape::Renderer;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum DialogMsg<T, U> {
diff --git a/core/embed/rust/src/ui/layout_bolt/component/error.rs b/core/embed/rust/src/ui/layout_bolt/component/error.rs
index 5941cb04..f71cfb8d 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/error.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/error.rs
@@ -1,23 +1,14 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Child, Component, Event, EventCtx, Label, Never, Pad},
- constant::screen,
- geometry::{Alignment2D, Point, Rect},
- shape,
- shape::Renderer,
- },
-};
-
-use super::{
- super::{
- constant::WIDTH,
- theme::{
- self, FATAL_ERROR_COLOR, ICON_WARNING40, RESULT_FOOTER_START, RESULT_PADDING, WHITE,
- },
- },
- ResultFooter, ResultStyle,
+use super::super::constant::WIDTH;
+use super::super::theme::{
+ self, FATAL_ERROR_COLOR, ICON_WARNING40, RESULT_FOOTER_START, RESULT_PADDING, WHITE,
};
+use super::{ResultFooter, ResultStyle};
+use crate::strutil::TString;
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Never, Pad};
+use crate::ui::constant::screen;
+use crate::ui::geometry::{Alignment2D, Point, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
const ICON_TOP: i16 = 23;
const TITLE_AREA_START: i16 = 70;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/fido.rs b/core/embed/rust/src/ui/layout_bolt/component/fido.rs
index cf2100a7..1f4eab12 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/fido.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/fido.rs
@@ -1,26 +1,17 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{
- image::Image,
- text::paragraphs::{Paragraph, ParagraphSource, Paragraphs},
- Child, Component, Event, EventCtx, Label, Paginate,
- },
- display,
- geometry::{Insets, Rect},
- shape::{self, Renderer},
- util::Pager,
- },
-};
-
-use super::{
- fido_icons::get_fido_icon_data,
- swipe::{Swipe, SwipeDirection},
- theme, CancelConfirmMsg, ScrollBar,
-};
-
use core::cell::Cell;
+use super::fido_icons::get_fido_icon_data;
+use super::swipe::{Swipe, SwipeDirection};
+use super::{theme, CancelConfirmMsg, ScrollBar};
+use crate::strutil::TString;
+use crate::ui::component::image::Image;
+use crate::ui::component::text::paragraphs::{Paragraph, ParagraphSource, Paragraphs};
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Paginate};
+use crate::ui::display;
+use crate::ui::geometry::{Insets, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::Pager;
+
const ICON_HEIGHT: i16 = 70;
const SCROLLBAR_INSET_TOP: i16 = 5;
const SCROLLBAR_HEIGHT: i16 = 10;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/frame.rs b/core/embed/rust/src/ui/layout_bolt/component/frame.rs
index 091a42e8..74059540 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/frame.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/frame.rs
@@ -1,17 +1,12 @@
-use super::theme;
-use crate::{
- strutil::TString,
- ui::{
- component::{
- base::ComponentExt, label::Label, text::TextStyle, Child, Component, Event, EventCtx,
- },
- display::Icon,
- geometry::{Alignment, Insets, Offset, Rect},
- shape::Renderer,
- },
-};
-
-use super::{Button, ButtonMsg, CancelInfoConfirmMsg};
+use super::{theme, Button, ButtonMsg, CancelInfoConfirmMsg};
+use crate::strutil::TString;
+use crate::ui::component::base::ComponentExt;
+use crate::ui::component::label::Label;
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{Child, Component, Event, EventCtx};
+use crate::ui::display::Icon;
+use crate::ui::geometry::{Alignment, Insets, Offset, Rect};
+use crate::ui::shape::Renderer;
pub struct Frame<T> {
border: Insets,
diff --git a/core/embed/rust/src/ui/layout_bolt/component/homescreen.rs b/core/embed/rust/src/ui/layout_bolt/component/homescreen.rs
index d7864eab..4761b59a 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/homescreen.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/homescreen.rs
@@ -1,30 +1,22 @@
-use crate::{
- io::BinaryData,
- strutil::TString,
- time::{Duration, Instant},
- translations::TR,
- trezorhal::usb::usb_configured,
- ui::{
- component::{text::TextStyle, Component, Event, EventCtx, Pad, Timer},
- display::{
- image::{ImageInfo, ToifFormat},
- toif::Icon,
- Color,
- },
- event::TouchEvent,
- geometry::{Alignment, Alignment2D, Insets, Offset, Point, Rect},
- layout::util::get_user_custom_image,
- notification::{Notification, NotificationLevel},
- shape::{self, Renderer},
- },
-};
-
+use super::super::theme::IMAGE_HOMESCREEN;
+use super::super::{constant, fonts};
+use super::{theme, Loader, LoaderMsg};
+use crate::io::BinaryData;
+use crate::strutil::TString;
+use crate::time::{Duration, Instant};
+use crate::translations::TR;
+use crate::trezorhal::usb::usb_configured;
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{Component, Event, EventCtx, Pad, Timer};
use crate::ui::constant::{HEIGHT, WIDTH};
-
-use super::{
- super::{constant, fonts, theme::IMAGE_HOMESCREEN},
- theme, Loader, LoaderMsg,
-};
+use crate::ui::display::image::{ImageInfo, ToifFormat};
+use crate::ui::display::toif::Icon;
+use crate::ui::display::Color;
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Alignment, Alignment2D, Insets, Offset, Point, Rect};
+use crate::ui::layout::util::get_user_custom_image;
+use crate::ui::notification::{Notification, NotificationLevel};
+use crate::ui::shape::{self, Renderer};
const AREA: Rect = constant::screen();
const TOP_CENTER: Point = AREA.top_center();
diff --git a/core/embed/rust/src/ui/layout_bolt/component/keyboard/bip39.rs b/core/embed/rust/src/ui/layout_bolt/component/keyboard/bip39.rs
index bff9298b..fd7dfaff 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/keyboard/bip39.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/keyboard/bip39.rs
@@ -1,21 +1,13 @@
-use crate::{
- trezorhal::bip39,
- ui::{
- component::{text::common::TextBox, Component, Event, EventCtx},
- geometry::{Alignment2D, Offset, Rect},
- shape,
- shape::Renderer,
- },
-};
-
-use super::super::{
- super::theme,
- keyboard::{
- common::{render_pending_marker, MultiTapKeyboard},
- mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
- },
- Button, ButtonContent, ButtonMsg,
-};
+use super::super::super::theme;
+use super::super::keyboard::common::{render_pending_marker, MultiTapKeyboard};
+use super::super::keyboard::mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT};
+use super::super::{Button, ButtonContent, ButtonMsg};
+use crate::trezorhal::bip39;
+use crate::ui::component::text::common::TextBox;
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::{Alignment2D, Offset, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
const MAX_LENGTH: usize = 8;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/keyboard/common.rs b/core/embed/rust/src/ui/layout_bolt/component/keyboard/common.rs
index c695da51..58a6f5c6 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/keyboard/common.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/keyboard/common.rs
@@ -1,13 +1,10 @@
-use crate::{
- time::Duration,
- ui::{
- component::{text::common::TextEdit, Event, EventCtx, Timer},
- display::{Color, Font},
- geometry::{Offset, Point, Rect},
- shape,
- shape::Renderer,
- },
-};
+use crate::time::Duration;
+use crate::ui::component::text::common::TextEdit;
+use crate::ui::component::{Event, EventCtx, Timer};
+use crate::ui::display::{Color, Font};
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
/// Contains state commonly used in implementations multi-tap keyboards.
pub struct MultiTapKeyboard {
diff --git a/core/embed/rust/src/ui/layout_bolt/component/keyboard/mnemonic.rs b/core/embed/rust/src/ui/layout_bolt/component/keyboard/mnemonic.rs
index b63e01d0..05dd34d2 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/keyboard/mnemonic.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/keyboard/mnemonic.rs
@@ -1,13 +1,9 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Child, Component, Event, EventCtx, Label, Maybe},
- geometry::{Alignment2D, Grid, Offset, Rect},
- shape::Renderer,
- },
-};
-
-use super::super::{super::theme, Button, ButtonMsg, Swipe, SwipeDirection};
+use super::super::super::theme;
+use super::super::{Button, ButtonMsg, Swipe, SwipeDirection};
+use crate::strutil::TString;
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Maybe};
+use crate::ui::geometry::{Alignment2D, Grid, Offset, Rect};
+use crate::ui::shape::Renderer;
pub const MNEMONIC_KEY_COUNT: usize = 9;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/keyboard/passphrase.rs b/core/embed/rust/src/ui/layout_bolt/component/keyboard/passphrase.rs
index 982953bd..70656caf 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/keyboard/passphrase.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/keyboard/passphrase.rs
@@ -1,33 +1,24 @@
-use crate::{
- strutil::{ShortString, TString},
- time::Duration,
- ui::{
- component::{
- base::ComponentExt,
- text::{
- common::TextBox,
- layout::{LayoutFit, LineBreaking},
- TextStyle,
- },
- Child, Component, Event, EventCtx, Never, Pad, Paginate, TextLayout, Timer,
- },
- display,
- event::TouchEvent,
- geometry::{Alignment, Grid, Insets, Offset, Rect},
- shape::{Bar, Renderer, Text},
- util::{DisplayStyle, Pager},
- },
-};
+use core::cell::Cell;
-use super::super::{
- super::constant::SCREEN,
- button::{Button, ButtonContent, ButtonMsg},
- keyboard::common::{render_pending_marker, MultiTapKeyboard},
- swipe::{Swipe, SwipeDirection},
- theme, ScrollBar,
+use super::super::super::constant::SCREEN;
+use super::super::button::{Button, ButtonContent, ButtonMsg};
+use super::super::keyboard::common::{render_pending_marker, MultiTapKeyboard};
+use super::super::swipe::{Swipe, SwipeDirection};
+use super::super::{theme, ScrollBar};
+use crate::strutil::{ShortString, TString};
+use crate::time::Duration;
+use crate::ui::component::base::ComponentExt;
+use crate::ui::component::text::common::TextBox;
+use crate::ui::component::text::layout::{LayoutFit, LineBreaking};
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{
+ Child, Component, Event, EventCtx, Never, Pad, Paginate, TextLayout, Timer,
};
-
-use core::cell::Cell;
+use crate::ui::display;
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Alignment, Grid, Insets, Offset, Rect};
+use crate::ui::shape::{Bar, Renderer, Text};
+use crate::ui::util::{DisplayStyle, Pager};
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum PassphraseKeyboardMsg {
diff --git a/core/embed/rust/src/ui/layout_bolt/component/keyboard/pin.rs b/core/embed/rust/src/ui/layout_bolt/component/keyboard/pin.rs
index de74fc42..deac75da 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/keyboard/pin.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/keyboard/pin.rs
@@ -1,29 +1,19 @@
use core::mem;
-use crate::{
- strutil::{ShortString, TString},
- time::Duration,
- trezorhal::random,
- ui::{
- component::{
- base::ComponentExt, text::TextStyle, Child, Component, Event, EventCtx, Label, Maybe,
- Never, Pad, Timer,
- },
- event::TouchEvent,
- geometry::{Alignment, Alignment2D, Grid, Insets, Offset, Rect},
- shape::{Renderer, Text, ToifImage},
- util::DisplayStyle,
- },
-};
-
-use super::super::{
- super::fonts,
- button::{
- Button, ButtonContent,
- ButtonMsg::{self, Clicked},
- },
- theme,
-};
+use super::super::super::fonts;
+use super::super::button::ButtonMsg::{self, Clicked};
+use super::super::button::{Button, ButtonContent};
+use super::super::theme;
+use crate::strutil::{ShortString, TString};
+use crate::time::Duration;
+use crate::trezorhal::random;
+use crate::ui::component::base::ComponentExt;
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Maybe, Never, Pad, Timer};
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Alignment, Alignment2D, Grid, Insets, Offset, Rect};
+use crate::ui::shape::{Renderer, Text, ToifImage};
+use crate::ui::util::DisplayStyle;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum PinKeyboardMsg {
diff --git a/core/embed/rust/src/ui/layout_bolt/component/keyboard/slip39.rs b/core/embed/rust/src/ui/layout_bolt/component/keyboard/slip39.rs
index 8edea7b7..0059ebea 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/keyboard/slip39.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/keyboard/slip39.rs
@@ -1,27 +1,16 @@
use core::iter;
-use crate::{
- strutil::ShortString,
- trezorhal::slip39,
- ui::{
- component::{
- text::common::{TextBox, TextEdit},
- Component, Event, EventCtx,
- },
- geometry::{Alignment2D, Offset, Rect},
- shape::{self, Renderer},
- util::ResultExt,
- },
-};
-
-use super::super::{
- super::theme,
- keyboard::{
- common::{render_pending_marker, MultiTapKeyboard},
- mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
- },
- Button, ButtonContent, ButtonMsg,
-};
+use super::super::super::theme;
+use super::super::keyboard::common::{render_pending_marker, MultiTapKeyboard};
+use super::super::keyboard::mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT};
+use super::super::{Button, ButtonContent, ButtonMsg};
+use crate::strutil::ShortString;
+use crate::trezorhal::slip39;
+use crate::ui::component::text::common::{TextBox, TextEdit};
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::{Alignment2D, Offset, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::ResultExt;
const MAX_LENGTH: usize = 8;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/keyboard/word_count.rs b/core/embed/rust/src/ui/layout_bolt/component/keyboard/word_count.rs
index c5c97bdd..65618fc4 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/keyboard/word_count.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/keyboard/word_count.rs
@@ -1,19 +1,12 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx},
- geometry::{Grid, GridCellSpan, Rect},
- shape::Renderer,
- },
-};
-
-use super::super::{
- super::theme,
- button::{Button, ButtonMsg},
-};
-
use heapless::Vec;
+use super::super::super::theme;
+use super::super::button::{Button, ButtonMsg};
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::{Grid, GridCellSpan, Rect};
+use crate::ui::shape::Renderer;
+
#[derive(Copy, Clone)]
pub enum SelectWordCountMsg {
Selected(u32),
diff --git a/core/embed/rust/src/ui/layout_bolt/component/loader.rs b/core/embed/rust/src/ui/layout_bolt/component/loader.rs
index 36cee28f..e3a9fcf3 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/loader.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/loader.rs
@@ -1,22 +1,16 @@
-use super::{
- super::cshape::{render_loader, LoaderRange},
- theme,
-};
+use super::super::constant;
+use super::super::cshape::{render_loader, LoaderRange};
+use super::theme;
+use crate::time::{Duration, Instant};
#[cfg(feature = "haptic")]
use crate::trezorhal::haptic::{self, HapticEffect};
-use crate::{
- time::{Duration, Instant},
- ui::{
- animation::Animation,
- component::{Component, Event, EventCtx, Pad},
- display::{self, toif::Icon, Color, LOADER_MAX},
- geometry::{Alignment2D, Offset, Rect},
- shape::{self, Renderer},
- util::animation_disabled,
- },
-};
-
-use super::super::constant;
+use crate::ui::animation::Animation;
+use crate::ui::component::{Component, Event, EventCtx, Pad};
+use crate::ui::display::toif::Icon;
+use crate::ui::display::{self, Color, LOADER_MAX};
+use crate::ui::geometry::{Alignment2D, Offset, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::animation_disabled;
const GROWING_DURATION_MS: u32 = 1000;
const SHRINKING_DURATION_MS: u32 = 500;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/mod.rs b/core/embed/rust/src/ui/layout_bolt/component/mod.rs
index feda2a47..0ffcd538 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/mod.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/mod.rs
@@ -49,14 +49,12 @@ pub use fido::{FidoConfirm, FidoMsg};
pub use frame::{Frame, FrameMsg};
#[cfg(feature = "micropython")]
pub use homescreen::{check_homescreen_format, Homescreen, HomescreenMsg, Lockscreen};
-pub use keyboard::{
- bip39::Bip39Input,
- mnemonic::{MnemonicInput, MnemonicKeyboard, MnemonicKeyboardMsg},
- passphrase::{PassphraseKeyboard, PassphraseKeyboardMsg},
- pin::{PinKeyboard, PinKeyboardMsg},
- slip39::Slip39Input,
- word_count::{SelectWordCount, SelectWordCountLayout, SelectWordCountMsg},
-};
+pub use keyboard::bip39::Bip39Input;
+pub use keyboard::mnemonic::{MnemonicInput, MnemonicKeyboard, MnemonicKeyboardMsg};
+pub use keyboard::passphrase::{PassphraseKeyboard, PassphraseKeyboardMsg};
+pub use keyboard::pin::{PinKeyboard, PinKeyboardMsg};
+pub use keyboard::slip39::Slip39Input;
+pub use keyboard::word_count::{SelectWordCount, SelectWordCountLayout, SelectWordCountMsg};
pub use loader::{Loader, LoaderMsg, LoaderStyle, LoaderStyleSheet};
#[cfg(feature = "translations")]
pub use number_input::{NumberInputDialog, NumberInputDialogMsg};
diff --git a/core/embed/rust/src/ui/layout_bolt/component/number_input.rs b/core/embed/rust/src/ui/layout_bolt/component/number_input.rs
index b34e80ff..ec4f1d2d 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/number_input.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/number_input.rs
@@ -1,19 +1,13 @@
-use crate::{
- error::Error,
- strutil::{self, TString},
- translations::TR,
- ui::{
- component::{
- base::ComponentExt,
- text::paragraphs::{Paragraph, Paragraphs},
- Child, Component, Event, EventCtx, Pad,
- },
- geometry::{Alignment, Grid, Insets, Offset, Rect},
- shape::{self, Renderer},
- },
-};
-
-use super::{super::fonts, theme, Button, ButtonMsg};
+use super::super::fonts;
+use super::{theme, Button, ButtonMsg};
+use crate::error::Error;
+use crate::strutil::{self, TString};
+use crate::translations::TR;
+use crate::ui::component::base::ComponentExt;
+use crate::ui::component::text::paragraphs::{Paragraph, Paragraphs};
+use crate::ui::component::{Child, Component, Event, EventCtx, Pad};
+use crate::ui::geometry::{Alignment, Grid, Insets, Offset, Rect};
+use crate::ui::shape::{self, Renderer};
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum NumberInputDialogMsg {
diff --git a/core/embed/rust/src/ui/layout_bolt/component/number_input_slider.rs b/core/embed/rust/src/ui/layout_bolt/component/number_input_slider.rs
index eee4df82..b47c3ecc 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/number_input_slider.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/number_input_slider.rs
@@ -1,12 +1,10 @@
-use crate::ui::{
- component::{base::ComponentExt, Child, Component, Event, EventCtx},
- constant::screen,
- event::TouchEvent,
- geometry::{Grid, Insets, Point, Rect},
- shape::{self, Renderer},
-};
-
use super::{theme, Button, ButtonMsg};
+use crate::ui::component::base::ComponentExt;
+use crate::ui::component::{Child, Component, Event, EventCtx};
+use crate::ui::constant::screen;
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Grid, Insets, Point, Rect};
+use crate::ui::shape::{self, Renderer};
pub enum NumberInputSliderDialogMsg {
Changed(u8),
diff --git a/core/embed/rust/src/ui/layout_bolt/component/page.rs b/core/embed/rust/src/ui/layout_bolt/component/page.rs
index e857fde5..e5f73667 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/page.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/page.rs
@@ -1,24 +1,20 @@
-use crate::{
- error::Error,
- strutil::TString,
- time::Instant,
- translations::TR,
- ui::{
- component::{paginated::PageMsg, Component, ComponentExt, Event, EventCtx, Pad, Paginate},
- constant,
- display::{self, Color},
- geometry::{Insets, Rect},
- shape::Renderer,
- util::{animation_disabled, Pager},
- },
-};
+use core::cell::Cell;
use super::{
theme, Button, ButtonContent, ButtonMsg, ButtonStyleSheet, Loader, LoaderMsg, ScrollBar, Swipe,
SwipeDirection,
};
-
-use core::cell::Cell;
+use crate::error::Error;
+use crate::strutil::TString;
+use crate::time::Instant;
+use crate::translations::TR;
+use crate::ui::component::paginated::PageMsg;
+use crate::ui::component::{Component, ComponentExt, Event, EventCtx, Pad, Paginate};
+use crate::ui::constant;
+use crate::ui::display::{self, Color};
+use crate::ui::geometry::{Insets, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::util::{animation_disabled, Pager};
/// Allows pagination of inner component. Shows scroll bar, confirm & cancel
/// buttons. Optionally handles hold-to-confirm with loader.
@@ -466,16 +462,12 @@ impl PageLayout {
#[cfg(test)]
mod tests {
- use crate::{
- trace::tests::trace,
- ui::{
- component::text::paragraphs::{Paragraph, Paragraphs},
- event::TouchEvent,
- geometry::Point,
- },
- };
-
- use super::{super::super::constant, *};
+ use super::super::super::constant;
+ use super::*;
+ use crate::trace::tests::trace;
+ use crate::ui::component::text::paragraphs::{Paragraph, Paragraphs};
+ use crate::ui::event::TouchEvent;
+ use crate::ui::geometry::Point;
const SCREEN: Rect = constant::screen().inset(theme::borders());
diff --git a/core/embed/rust/src/ui/layout_bolt/component/pairing_mode.rs b/core/embed/rust/src/ui/layout_bolt/component/pairing_mode.rs
index fca5193f..fe9cbecd 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/pairing_mode.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/pairing_mode.rs
@@ -1,16 +1,11 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx, Pad},
- display::{Color, Font},
- event::BLEEvent,
- geometry::{Alignment, Offset, Rect},
- layout::simplified::ReturnToC,
- shape::{self, Renderer},
- },
-};
-
use super::{Button, ButtonMsg};
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx, Pad};
+use crate::ui::display::{Color, Font};
+use crate::ui::event::BLEEvent;
+use crate::ui::geometry::{Alignment, Offset, Rect};
+use crate::ui::layout::simplified::ReturnToC;
+use crate::ui::shape::{self, Renderer};
#[repr(u32)]
pub enum PairingMsg {
diff --git a/core/embed/rust/src/ui/layout_bolt/component/progress.rs b/core/embed/rust/src/ui/layout_bolt/component/progress.rs
index d5c7c7d6..44cf69a6 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/progress.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/progress.rs
@@ -1,25 +1,16 @@
use core::mem;
-use super::{
- super::cshape::{render_loader, LoaderRange},
- theme,
-};
-use crate::{
- strutil::TString,
- ui::{
- component::{
- base::ComponentExt,
- text::paragraphs::{Paragraph, Paragraphs},
- Child, Component, Event, EventCtx, Label, Never, Pad,
- },
- display::LOADER_MAX,
- geometry::{Insets, Offset, Rect},
- shape::Renderer,
- util::animation_disabled,
- },
-};
-
+use super::super::cshape::{render_loader, LoaderRange};
use super::super::{constant, fonts};
+use super::theme;
+use crate::strutil::TString;
+use crate::ui::component::base::ComponentExt;
+use crate::ui::component::text::paragraphs::{Paragraph, Paragraphs};
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Never, Pad};
+use crate::ui::display::LOADER_MAX;
+use crate::ui::geometry::{Insets, Offset, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::util::animation_disabled;
pub struct Progress {
title: Child<Label<'static>>,
diff --git a/core/embed/rust/src/ui/layout_bolt/component/result.rs b/core/embed/rust/src/ui/layout_bolt/component/result.rs
index 1752cf4f..0cbbcfbb 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/result.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/result.rs
@@ -1,20 +1,14 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{text::TextStyle, Child, Component, Event, EventCtx, Label, Never, Pad},
- constant::screen,
- display::{Color, Icon},
- geometry::{Alignment2D, Insets, Offset, Point, Rect},
- shape,
- shape::Renderer,
- },
-};
-
-use super::super::{
- constant::WIDTH,
- fonts,
- theme::{FG, RESULT_FOOTER_START, RESULT_PADDING},
-};
+use super::super::constant::WIDTH;
+use super::super::fonts;
+use super::super::theme::{FG, RESULT_FOOTER_START, RESULT_PADDING};
+use crate::strutil::TString;
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Never, Pad};
+use crate::ui::constant::screen;
+use crate::ui::display::{Color, Icon};
+use crate::ui::geometry::{Alignment2D, Insets, Offset, Point, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
const MESSAGE_AREA_START: i16 = 97;
const ICON_CENTER_Y: i16 = 62;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/scroll.rs b/core/embed/rust/src/ui/layout_bolt/component/scroll.rs
index 24b3c72f..0af9adfc 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/scroll.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/scroll.rs
@@ -1,12 +1,9 @@
-use crate::ui::{
- component::{Component, Event, EventCtx, Never, Paginate},
- display::toif::Icon,
- geometry::{Alignment2D, Axis, LinearPlacement, Offset, Rect},
- shape::{self, Renderer},
- util::Pager,
-};
-
use super::theme;
+use crate::ui::component::{Component, Event, EventCtx, Never, Paginate};
+use crate::ui::display::toif::Icon;
+use crate::ui::geometry::{Alignment2D, Axis, LinearPlacement, Offset, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::Pager;
pub struct ScrollBar {
area: Rect,
diff --git a/core/embed/rust/src/ui/layout_bolt/component/set_brightness.rs b/core/embed/rust/src/ui/layout_bolt/component/set_brightness.rs
index dd644f29..6407116f 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/set_brightness.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/set_brightness.rs
@@ -1,18 +1,11 @@
-use crate::{
- storage,
- trezorhal::display,
- ui::{
- component::{Component, Event, EventCtx},
- geometry::Rect,
- shape::Renderer,
- },
-};
-
-use super::{
- super::theme,
- number_input_slider::{NumberInputSliderDialog, NumberInputSliderDialogMsg},
- CancelConfirmMsg,
-};
+use super::super::theme;
+use super::number_input_slider::{NumberInputSliderDialog, NumberInputSliderDialogMsg};
+use super::CancelConfirmMsg;
+use crate::storage;
+use crate::trezorhal::display;
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
pub struct SetBrightnessDialog(NumberInputSliderDialog);
diff --git a/core/embed/rust/src/ui/layout_bolt/component/share_words.rs b/core/embed/rust/src/ui/layout_bolt/component/share_words.rs
index 989f9441..bd3dc661 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/share_words.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/share_words.rs
@@ -1,20 +1,15 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx, Never, Paginate},
- display::Font,
- geometry::{Offset, Rect},
- shape::{self, Renderer},
- util::Pager,
- },
-};
-
-use super::super::{fonts, theme};
-
use heapless::Vec;
#[cfg(feature = "ui_debug")]
use ufmt::uwrite;
+use super::super::{fonts, theme};
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx, Never, Paginate};
+use crate::ui::display::Font;
+use crate::ui::geometry::{Offset, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::Pager;
+
const WORDS_PER_PAGE: usize = 4;
const TOP_PADDING_OFFSET: i16 = 13;
const WORD_FONT: Font = fonts::FONT_MONO;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/simple_page.rs b/core/embed/rust/src/ui/layout_bolt/component/simple_page.rs
index 2d15871d..cdd4f0f2 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/simple_page.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/simple_page.rs
@@ -1,12 +1,11 @@
-use crate::ui::{
- component::{base::ComponentExt, Component, Event, EventCtx, Pad, PageMsg, Paginate},
- display::{self, Color},
- geometry::{Axis, Insets, Rect},
- shape::Renderer,
-};
+use core::cell::Cell;
use super::{theme, ScrollBar, Swipe, SwipeDirection};
-use core::cell::Cell;
+use crate::ui::component::base::ComponentExt;
+use crate::ui::component::{Component, Event, EventCtx, Pad, PageMsg, Paginate};
+use crate::ui::display::{self, Color};
+use crate::ui::geometry::{Axis, Insets, Rect};
+use crate::ui::shape::Renderer;
const SCROLLBAR_HEIGHT: i16 = 18;
const SCROLLBAR_BORDER: i16 = 4;
diff --git a/core/embed/rust/src/ui/layout_bolt/component/swipe.rs b/core/embed/rust/src/ui/layout_bolt/component/swipe.rs
index 37807afc..e81e47ee 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/swipe.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/swipe.rs
@@ -1,12 +1,9 @@
-use crate::ui::{
- component::{Component, Event, EventCtx},
- display,
- event::TouchEvent,
- geometry::{Point, Rect},
- shape::Renderer,
-};
-
use super::super::theme::backlight;
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::display;
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Point, Rect};
+use crate::ui::shape::Renderer;
pub enum SwipeDirection {
Up,
diff --git a/core/embed/rust/src/ui/layout_bolt/component/welcome_screen.rs b/core/embed/rust/src/ui/layout_bolt/component/welcome_screen.rs
index 9ff91589..6ec4c6e7 100644
--- a/core/embed/rust/src/ui/layout_bolt/component/welcome_screen.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component/welcome_screen.rs
@@ -1,17 +1,14 @@
-use crate::ui::{
- component::{Component, Event, EventCtx, Never},
- geometry::{Alignment2D, Offset, Rect},
- shape,
- shape::Renderer,
-};
-
#[cfg(not(feature = "bootloader"))]
use super::super::fonts;
use super::theme;
#[cfg(feature = "bootloader")]
use super::theme::bootloader::DEVICE_NAME;
+use crate::ui::component::{Component, Event, EventCtx, Never};
#[cfg(feature = "bootloader")]
use crate::ui::display::toif::Toif;
+use crate::ui::geometry::{Alignment2D, Offset, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
const TEXT_BOTTOM_MARGIN: i16 = 24; // matching the homescreen label margin
const ICON_TOP_MARGIN: i16 = 48;
diff --git a/core/embed/rust/src/ui/layout_bolt/component_msg_obj.rs b/core/embed/rust/src/ui/layout_bolt/component_msg_obj.rs
index e5cc4f71..a85f07d9 100644
--- a/core/embed/rust/src/ui/layout_bolt/component_msg_obj.rs
+++ b/core/embed/rust/src/ui/layout_bolt/component_msg_obj.rs
@@ -7,26 +7,17 @@ use super::component::{
NumberInputDialogMsg, PassphraseKeyboard, PassphraseKeyboardMsg, PinKeyboard, PinKeyboardMsg,
Progress, SelectWordCountMsg, SelectWordMsg, SetBrightnessDialog, SimplePage,
};
-use crate::{
- error::Error,
- micropython::obj::Obj,
- strutil::TString,
- ui::{
- component::{
- paginated::PageMsg,
- placed::GridPlaced,
- text::paragraphs::{ParagraphSource, Paragraphs},
- Component, FormattedText, Never, Paginate,
- },
- layout::{
- obj::ComponentMsgObj,
- result::{CANCELLED, CONFIRMED, INFO},
- },
- },
-};
-
+use crate::error::Error;
+use crate::micropython::obj::Obj;
+use crate::strutil::TString;
+use crate::ui::component::paginated::PageMsg;
+use crate::ui::component::placed::GridPlaced;
+use crate::ui::component::text::paragraphs::{ParagraphSource, Paragraphs};
#[cfg(not(feature = "clippy"))]
use crate::ui::component::Timeout;
+use crate::ui::component::{Component, FormattedText, Never, Paginate};
+use crate::ui::layout::obj::ComponentMsgObj;
+use crate::ui::layout::result::{CANCELLED, CONFIRMED, INFO};
impl TryFrom<CancelConfirmMsg> for Obj {
type Error = Error;
diff --git a/core/embed/rust/src/ui/layout_bolt/constant.rs b/core/embed/rust/src/ui/layout_bolt/constant.rs
index b2f6bf95..88ade771 100644
--- a/core/embed/rust/src/ui/layout_bolt/constant.rs
+++ b/core/embed/rust/src/ui/layout_bolt/constant.rs
@@ -1,6 +1,5 @@
-use crate::ui::geometry::{Offset, Point, Rect};
-
use crate::trezorhal::display::{DISPLAY_RESX, DISPLAY_RESY};
+use crate::ui::geometry::{Offset, Point, Rect};
pub const WIDTH: i16 = DISPLAY_RESX as _;
pub const HEIGHT: i16 = DISPLAY_RESY as _;
diff --git a/core/embed/rust/src/ui/layout_bolt/cshape/loader.rs b/core/embed/rust/src/ui/layout_bolt/cshape/loader.rs
index 84adbd9a..e7437123 100644
--- a/core/embed/rust/src/ui/layout_bolt/cshape/loader.rs
+++ b/core/embed/rust/src/ui/layout_bolt/cshape/loader.rs
@@ -1,4 +1,7 @@
-use crate::ui::{constant, display::Color, geometry::Point, shape, shape::Renderer};
+use crate::ui::display::Color;
+use crate::ui::geometry::Point;
+use crate::ui::shape::Renderer;
+use crate::ui::{constant, shape};
pub enum LoaderRange {
Full,
diff --git a/core/embed/rust/src/ui/layout_bolt/mod.rs b/core/embed/rust/src/ui/layout_bolt/mod.rs
index d466f46b..689093db 100644
--- a/core/embed/rust/src/ui/layout_bolt/mod.rs
+++ b/core/embed/rust/src/ui/layout_bolt/mod.rs
@@ -1,13 +1,11 @@
-use super::{geometry::Rect, CommonUI};
-
+use super::geometry::Rect;
#[cfg(any(feature = "ui_debug_overlay", feature = "ui_performance_overlay"))]
use super::shape;
-
-#[cfg(feature = "ui_debug_overlay")]
-use super::{display::Color, geometry::Offset};
-
+use super::CommonUI;
#[cfg(feature = "ui_performance_overlay")]
use super::PerformanceOverlay;
+#[cfg(feature = "ui_debug_overlay")]
+use super::{display::Color, geometry::Offset};
#[cfg(feature = "bootloader")]
pub mod bootloader;
@@ -23,10 +21,10 @@ use theme::backlight;
pub mod component_msg_obj;
pub mod cshape;
-use crate::ui::layout::simplified::show;
-
use component::{ErrorScreen, WelcomeScreen};
+use crate::ui::layout::simplified::show;
+
pub struct UIBolt;
#[cfg(feature = "micropython")]
diff --git a/core/embed/rust/src/ui/layout_bolt/prodtest/mod.rs b/core/embed/rust/src/ui/layout_bolt/prodtest/mod.rs
index 222808ca..94f99d02 100644
--- a/core/embed/rust/src/ui/layout_bolt/prodtest/mod.rs
+++ b/core/embed/rust/src/ui/layout_bolt/prodtest/mod.rs
@@ -1,23 +1,19 @@
mod welcome;
-use crate::ui::{
- component::Event,
- constant::screen,
- display,
- display::Color,
- event::{
- TouchEvent,
- TouchEvent::{TouchEnd, TouchMove, TouchStart},
- },
- geometry::{Alignment, Offset, Rect},
- layout::simplified::{process_frame_event, show},
- shape,
- shape::render_on_display,
- ui_prodtest::{ProdtestLayoutType, ProdtestUI},
-};
use heapless::Vec;
-use super::{fonts, prodtest::welcome::Welcome, UIBolt};
+use super::prodtest::welcome::Welcome;
+use super::{fonts, UIBolt};
+use crate::ui::component::Event;
+use crate::ui::constant::screen;
+use crate::ui::display::Color;
+use crate::ui::event::TouchEvent;
+use crate::ui::event::TouchEvent::{TouchEnd, TouchMove, TouchStart};
+use crate::ui::geometry::{Alignment, Offset, Rect};
+use crate::ui::layout::simplified::{process_frame_event, show};
+use crate::ui::shape::render_on_display;
+use crate::ui::ui_prodtest::{ProdtestLayoutType, ProdtestUI};
+use crate::ui::{display, shape};
#[allow(clippy::large_enum_variant)]
pub enum ProdtestLayout {
diff --git a/core/embed/rust/src/ui/layout_bolt/prodtest/welcome.rs b/core/embed/rust/src/ui/layout_bolt/prodtest/welcome.rs
index 0d6a9069..0df6d23f 100644
--- a/core/embed/rust/src/ui/layout_bolt/prodtest/welcome.rs
+++ b/core/embed/rust/src/ui/layout_bolt/prodtest/welcome.rs
@@ -1,13 +1,10 @@
-use super::super::{
- fonts,
- theme::{bootloader::WELCOME_COLOR, WHITE},
-};
-use crate::ui::{
- component::{Component, Event, EventCtx, Never, Pad, Qr},
- constant::screen,
- geometry::{Alignment, Offset, Point, Rect},
- shape::{self, Renderer},
-};
+use super::super::fonts;
+use super::super::theme::bootloader::WELCOME_COLOR;
+use super::super::theme::WHITE;
+use crate::ui::component::{Component, Event, EventCtx, Never, Pad, Qr};
+use crate::ui::constant::screen;
+use crate::ui::geometry::{Alignment, Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
#[cfg(feature = "power_manager")]
use crate::{
strutil::format_i64,
diff --git a/core/embed/rust/src/ui/layout_bolt/theme/bootloader.rs b/core/embed/rust/src/ui/layout_bolt/theme/bootloader.rs
index 9d4cb8b7..e62b70d4 100644
--- a/core/embed/rust/src/ui/layout_bolt/theme/bootloader.rs
+++ b/core/embed/rust/src/ui/layout_bolt/theme/bootloader.rs
@@ -1,17 +1,13 @@
-use super::super::{
- component::{ButtonStyle, ButtonStyleSheet, ResultStyle},
- fonts,
- theme::{BLACK, FG, GREY_DARK, GREY_LIGHT, WHITE},
-};
-use crate::ui::{
- component::{text::TextStyle, LineBreaking::BreakWordsNoHyphen},
- constant::{HEIGHT, WIDTH},
- display::Color,
- geometry::{Offset, Point, Rect},
- util::include_res,
-};
-
+use super::super::component::{ButtonStyle, ButtonStyleSheet, ResultStyle};
+use super::super::fonts;
+use super::super::theme::{BLACK, FG, GREY_DARK, GREY_LIGHT, WHITE};
use super::GREY_MEDIUM;
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::LineBreaking::BreakWordsNoHyphen;
+use crate::ui::constant::{HEIGHT, WIDTH};
+use crate::ui::display::Color;
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::util::include_res;
pub const BLD_BG: Color = Color::rgb(0x00, 0x1E, 0xAD);
pub const BLD_FG: Color = WHITE;
diff --git a/core/embed/rust/src/ui/layout_bolt/theme/mod.rs b/core/embed/rust/src/ui/layout_bolt/theme/mod.rs
index fe961d6b..b83b342d 100644
--- a/core/embed/rust/src/ui/layout_bolt/theme/mod.rs
+++ b/core/embed/rust/src/ui/layout_bolt/theme/mod.rs
@@ -1,26 +1,16 @@
pub mod backlight;
pub mod bootloader;
-use crate::{
- time::ShortDuration,
- ui::{
- component::{
- text::{
- layout::Chunks, paragraphs::PARAGRAPH_BOTTOM_SPACE, LineBreaking, PageBreaking,
- TextStyle,
- },
- FixedHeightBar,
- },
- display::Color,
- geometry::{Insets, Offset},
- util::{include_icon, include_res},
- },
-};
-
-use super::{
- component::{ButtonStyle, ButtonStyleSheet, LoaderStyle, LoaderStyleSheet, ResultStyle},
- fonts,
-};
+use super::component::{ButtonStyle, ButtonStyleSheet, LoaderStyle, LoaderStyleSheet, ResultStyle};
+use super::fonts;
+use crate::time::ShortDuration;
+use crate::ui::component::text::layout::Chunks;
+use crate::ui::component::text::paragraphs::PARAGRAPH_BOTTOM_SPACE;
+use crate::ui::component::text::{LineBreaking, PageBreaking, TextStyle};
+use crate::ui::component::FixedHeightBar;
+use crate::ui::display::Color;
+use crate::ui::geometry::{Insets, Offset};
+use crate::ui::util::{include_icon, include_res};
pub const ERASE_HOLD_DURATION: ShortDuration = ShortDuration::from_millis(1500);
diff --git a/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs b/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs
index f687fd5d..888815fa 100644
--- a/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs
+++ b/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs
@@ -1,49 +1,41 @@
use core::cmp::Ordering;
-use crate::{
- error::{value_error, Error},
- io::BinaryData,
- micropython::{buffer::StrBuffer, gc::Gc, iter::IterBuf, list::List, obj::Obj, util},
- storage,
- strutil::TString,
- translations::TR,
- ui::{
- component::{
- image::BlendedImage,
- text::{
- op::OpTextLayout,
- paragraphs::{
- Checklist, Paragraph, ParagraphSource, ParagraphVecLong, ParagraphVecShort,
- Paragraphs, VecExt,
- },
- TextStyle,
- },
- Border, ComponentExt, Empty, FormattedText, Jpeg, Label, Never, Timeout,
- },
- geometry,
- layout::{
- obj::{LayoutMaybeTrace, LayoutObj, RootComponent},
- util::{ConfirmValueParams, PropsList, RecoveryType},
- },
- notification::Notification,
- ui_firmware::{
- FirmwareUI, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_MENU_ITEMS,
- MAX_PAIRED_DEVICES, MAX_WORD_QUIZ_ITEMS,
- },
- ModelUI,
- },
+use super::component::{
+ check_homescreen_format, AddressDetails, Bip39Input, Button, ButtonMsg, ButtonPage,
+ ButtonStyleSheet, CancelConfirmMsg, CoinJoinProgress, Dialog, FidoConfirm, Frame, Homescreen,
+ IconDialog, Lockscreen, MnemonicKeyboard, NumberInputDialog, PassphraseKeyboard, PinKeyboard,
+ Progress, SelectWordCount, SelectWordCountLayout, SetBrightnessDialog, ShareWords, SimplePage,
+ Slip39Input,
};
-
-use super::{
- component::{
- check_homescreen_format, AddressDetails, Bip39Input, Button, ButtonMsg, ButtonPage,
- ButtonStyleSheet, CancelConfirmMsg, CoinJoinProgress, Dialog, FidoConfirm, Frame,
- Homescreen, IconDialog, Lockscreen, MnemonicKeyboard, NumberInputDialog,
- PassphraseKeyboard, PinKeyboard, Progress, SelectWordCount, SelectWordCountLayout,
- SetBrightnessDialog, ShareWords, SimplePage, Slip39Input,
- },
- fonts, theme, UIBolt,
+use super::{fonts, theme, UIBolt};
+use crate::error::{value_error, Error};
+use crate::io::BinaryData;
+use crate::micropython::buffer::StrBuffer;
+use crate::micropython::gc::Gc;
+use crate::micropython::iter::IterBuf;
+use crate::micropython::list::List;
+use crate::micropython::obj::Obj;
+use crate::micropython::util;
+use crate::storage;
+use crate::strutil::TString;
+use crate::translations::TR;
+use crate::ui::component::image::BlendedImage;
+use crate::ui::component::text::op::OpTextLayout;
+use crate::ui::component::text::paragraphs::{
+ Checklist, Paragraph, ParagraphSource, ParagraphVecLong, ParagraphVecShort, Paragraphs, VecExt,
+};
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{
+ Border, ComponentExt, Empty, FormattedText, Jpeg, Label, Never, Timeout,
};
+use crate::ui::layout::obj::{LayoutMaybeTrace, LayoutObj, RootComponent};
+use crate::ui::layout::util::{ConfirmValueParams, PropsList, RecoveryType};
+use crate::ui::notification::Notification;
+use crate::ui::ui_firmware::{
+ FirmwareUI, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_MENU_ITEMS, MAX_PAIRED_DEVICES,
+ MAX_WORD_QUIZ_ITEMS,
+};
+use crate::ui::{geometry, ModelUI};
impl FirmwareUI for UIBolt {
fn confirm_action(
@@ -1492,15 +1484,12 @@ impl ConfirmValue {
mod tests {
use serde_json;
- use crate::{
- trace::tests::trace,
- ui::{
- component::{text::op::OpTextLayout, Component},
- geometry::Rect,
- },
- };
-
- use super::{super::constant, *};
+ use super::super::constant;
+ use super::*;
+ use crate::trace::tests::trace;
+ use crate::ui::component::text::op::OpTextLayout;
+ use crate::ui::component::Component;
+ use crate::ui::geometry::Rect;
const SCREEN: Rect = constant::screen().inset(theme::borders());
diff --git a/core/embed/rust/src/ui/layout_caesar/bootloader/connect.rs b/core/embed/rust/src/ui/layout_caesar/bootloader/connect.rs
index 771fb382..bdfbd4f0 100644
--- a/core/embed/rust/src/ui/layout_caesar/bootloader/connect.rs
+++ b/core/embed/rust/src/ui/layout_caesar/bootloader/connect.rs
@@ -1,17 +1,10 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx, Pad},
- display::{Color, Font},
- geometry::{Alignment, Offset, Rect},
- shape::{self, Renderer},
- },
-};
-
-use super::super::{
- component::{ButtonController, ButtonControllerMsg, ButtonLayout, ButtonPos},
- theme::{BUTTON_HEIGHT, TITLE_AREA_HEIGHT},
-};
+use super::super::component::{ButtonController, ButtonControllerMsg, ButtonLayout, ButtonPos};
+use super::super::theme::{BUTTON_HEIGHT, TITLE_AREA_HEIGHT};
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx, Pad};
+use crate::ui::display::{Color, Font};
+use crate::ui::geometry::{Alignment, Offset, Rect};
+use crate::ui::shape::{self, Renderer};
#[repr(u32)]
#[derive(Copy, Clone, ToPrimitive)]
diff --git a/core/embed/rust/src/ui/layout_caesar/bootloader/intro.rs b/core/embed/rust/src/ui/layout_caesar/bootloader/intro.rs
index 8e05a1e1..6adc711d 100644
--- a/core/embed/rust/src/ui/layout_caesar/bootloader/intro.rs
+++ b/core/embed/rust/src/ui/layout_caesar/bootloader/intro.rs
@@ -1,21 +1,13 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Child, Component, Event, EventCtx, Label, Pad},
- geometry::{Alignment, Alignment2D, Rect},
- layout::simplified::ReturnToC,
- shape,
- shape::Renderer,
- },
-};
-
-use super::super::{
- component::{ButtonController, ButtonControllerMsg::Triggered, ButtonLayout, ButtonPos},
- theme::{
- bootloader::{BLD_BG, BLD_FG, TEXT_NORMAL},
- BUTTON_HEIGHT, ICON_WARN_TITLE, TITLE_AREA_HEIGHT,
- },
-};
+use super::super::component::ButtonControllerMsg::Triggered;
+use super::super::component::{ButtonController, ButtonLayout, ButtonPos};
+use super::super::theme::bootloader::{BLD_BG, BLD_FG, TEXT_NORMAL};
+use super::super::theme::{BUTTON_HEIGHT, ICON_WARN_TITLE, TITLE_AREA_HEIGHT};
+use crate::strutil::TString;
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Pad};
+use crate::ui::geometry::{Alignment, Alignment2D, Rect};
+use crate::ui::layout::simplified::ReturnToC;
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
const LEFT_BUTTON_TEXT: &str = "Init connection";
const RIGHT_BUTTON_TEXT: &str = "MENU";
diff --git a/core/embed/rust/src/ui/layout_caesar/bootloader/menu.rs b/core/embed/rust/src/ui/layout_caesar/bootloader/menu.rs
index d58c7948..ff72b55c 100644
--- a/core/embed/rust/src/ui/layout_caesar/bootloader/menu.rs
+++ b/core/embed/rust/src/ui/layout_caesar/bootloader/menu.rs
@@ -1,20 +1,15 @@
+use super::super::component::{ButtonLayout, Choice, ChoiceFactory, ChoiceMsg, ChoicePage};
+use super::super::fonts;
+use super::super::theme::bootloader::{BLD_BG, BLD_FG, ICON_EXIT, ICON_REDO, ICON_TRASH};
#[cfg(feature = "ui_debug")]
use crate::trace::{Trace, Tracer};
-use crate::ui::{
- component::{Child, Component, Event, EventCtx, Pad},
- constant::screen,
- display::Icon,
- geometry::{Alignment, Alignment2D, Offset, Point, Rect},
- layout::simplified::ReturnToC,
- shape,
- shape::Renderer,
-};
-
-use super::super::{
- component::{ButtonLayout, Choice, ChoiceFactory, ChoiceMsg, ChoicePage},
- fonts,
- theme::bootloader::{BLD_BG, BLD_FG, ICON_EXIT, ICON_REDO, ICON_TRASH},
-};
+use crate::ui::component::{Child, Component, Event, EventCtx, Pad};
+use crate::ui::constant::screen;
+use crate::ui::display::Icon;
+use crate::ui::geometry::{Alignment, Alignment2D, Offset, Point, Rect};
+use crate::ui::layout::simplified::ReturnToC;
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
#[repr(u32)]
#[derive(Copy, Clone)]
diff --git a/core/embed/rust/src/ui/layout_caesar/bootloader/mod.rs b/core/embed/rust/src/ui/layout_caesar/bootloader/mod.rs
index 189a1f8c..6debf2da 100644
--- a/core/embed/rust/src/ui/layout_caesar/bootloader/mod.rs
+++ b/core/embed/rust/src/ui/layout_caesar/bootloader/mod.rs
@@ -1,49 +1,38 @@
use heapless::String;
-
-use crate::ui::{
- component::{Label, LineBreaking::BreakWordsNoHyphen},
- constant::{self, HEIGHT, SCREEN},
- display::{self, Color, Icon},
- geometry::{Alignment2D, Offset, Point},
- layout::simplified::{show, ReturnToC},
-};
-
-use super::{
- component::{
- bl_confirm::{Confirm, ConfirmMsg},
- ResultScreen, WelcomeScreen,
- },
- cshape, fonts,
- theme::{
- bootloader::{BLD_BG, BLD_FG, ICON_ALERT, ICON_SPINNER, ICON_SUCCESS},
- ICON_ARM_LEFT, ICON_ARM_RIGHT, TEXT_BOLD, TEXT_NORMAL,
- },
- UICaesar,
-};
-
-use crate::{
- bootloader::run,
- ui::{display::toif::Toif, geometry::Alignment, shape, shape::render_on_display},
-};
-
use ufmt::uwrite;
+use super::component::bl_confirm::{Confirm, ConfirmMsg};
+use super::component::{ResultScreen, WelcomeScreen};
+use super::theme::bootloader::{BLD_BG, BLD_FG, ICON_ALERT, ICON_SPINNER, ICON_SUCCESS};
+use super::theme::{ICON_ARM_LEFT, ICON_ARM_RIGHT, TEXT_BOLD, TEXT_NORMAL};
+use super::{cshape, fonts, UICaesar};
+use crate::bootloader::run;
+use crate::ui::component::Label;
+use crate::ui::component::LineBreaking::BreakWordsNoHyphen;
+use crate::ui::constant::{self, HEIGHT, SCREEN};
+use crate::ui::display::toif::Toif;
+use crate::ui::display::{self, Color, Icon};
+use crate::ui::geometry::{Alignment, Alignment2D, Offset, Point};
+use crate::ui::layout::simplified::{show, ReturnToC};
+use crate::ui::shape;
+use crate::ui::shape::render_on_display;
+
mod intro;
mod menu;
mod welcome;
mod connect;
-use crate::{
- time::Duration,
- trezorhal::time,
- ui::{ui_bootloader::BootloaderUI, util::animation_disabled},
-};
use connect::Connect;
use intro::Intro;
use menu::Menu;
use welcome::Welcome;
+use crate::time::Duration;
+use crate::trezorhal::time;
+use crate::ui::ui_bootloader::BootloaderUI;
+use crate::ui::util::animation_disabled;
+
pub type BootloaderString = String<128>;
impl ReturnToC for ConfirmMsg {
diff --git a/core/embed/rust/src/ui/layout_caesar/bootloader/welcome.rs b/core/embed/rust/src/ui/layout_caesar/bootloader/welcome.rs
index 6bd167e1..6c77b8af 100644
--- a/core/embed/rust/src/ui/layout_caesar/bootloader/welcome.rs
+++ b/core/embed/rust/src/ui/layout_caesar/bootloader/welcome.rs
@@ -1,14 +1,9 @@
-use crate::ui::{
- component::{Component, Event, EventCtx, Never, Pad},
- geometry::{Alignment, Offset, Rect},
- shape,
- shape::Renderer,
-};
-
-use super::{
- super::theme::bootloader::{BLD_BG, BLD_FG},
- fonts,
-};
+use super::super::theme::bootloader::{BLD_BG, BLD_FG};
+use super::fonts;
+use crate::ui::component::{Component, Event, EventCtx, Never, Pad};
+use crate::ui::geometry::{Alignment, Offset, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
pub struct Welcome {
bg: Pad,
diff --git a/core/embed/rust/src/ui/layout_caesar/component/address_details.rs b/core/embed/rust/src/ui/layout_caesar/component/address_details.rs
index 0b2330d7..abc8f516 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/address_details.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/address_details.rs
@@ -1,24 +1,19 @@
use heapless::Vec;
-use crate::{
- error::Error,
- micropython::buffer::StrBuffer,
- strutil::TString,
- translations::TR,
- ui::{
- component::{
- text::paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt},
- Child, Component, Event, EventCtx, Pad, Paginate, Qr,
- },
- geometry::Rect,
- layout::util::MAX_XPUBS,
- shape::Renderer,
- },
-};
-
use super::{
theme, ButtonController, ButtonControllerMsg, ButtonDetails, ButtonLayout, ButtonPos, Frame,
};
+use crate::error::Error;
+use crate::micropython::buffer::StrBuffer;
+use crate::strutil::TString;
+use crate::translations::TR;
+use crate::ui::component::text::paragraphs::{
+ Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt,
+};
+use crate::ui::component::{Child, Component, Event, EventCtx, Pad, Paginate, Qr};
+use crate::ui::geometry::Rect;
+use crate::ui::layout::util::MAX_XPUBS;
+use crate::ui::shape::Renderer;
const QR_BORDER: i16 = 3;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/bl_confirm.rs b/core/embed/rust/src/ui/layout_caesar/component/bl_confirm.rs
index c63372fb..2b0d0ca2 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/bl_confirm.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/bl_confirm.rs
@@ -1,17 +1,10 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, ComponentExt, Event, EventCtx, Label, Pad},
- display::Color,
- geometry::Rect,
- shape::Renderer,
- },
-};
-
-use super::{
- theme::{BUTTON_HEIGHT, TEXT_BOLD, TITLE_AREA_HEIGHT},
- ButtonController, ButtonControllerMsg, ButtonLayout, ButtonPos,
-};
+use super::theme::{BUTTON_HEIGHT, TEXT_BOLD, TITLE_AREA_HEIGHT};
+use super::{ButtonController, ButtonControllerMsg, ButtonLayout, ButtonPos};
+use crate::strutil::TString;
+use crate::ui::component::{Component, ComponentExt, Event, EventCtx, Label, Pad};
+use crate::ui::display::Color;
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
const ALERT_AREA_START: i16 = 39;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/button.rs b/core/embed/rust/src/ui/layout_caesar/component/button.rs
index e44ed0bd..d459e78c 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/button.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/button.rs
@@ -1,18 +1,14 @@
-use crate::{
- strutil::TString,
- time::Duration,
- ui::{
- component::{Component, Event, EventCtx, Never},
- constant,
- display::{Font, Icon},
- event::PhysicalButton,
- geometry::{Alignment2D, Offset, Point, Rect},
- shape,
- shape::Renderer,
- },
-};
-
-use super::{super::fonts, loader::DEFAULT_DURATION_MS, theme};
+use super::super::fonts;
+use super::loader::DEFAULT_DURATION_MS;
+use super::theme;
+use crate::strutil::TString;
+use crate::time::Duration;
+use crate::ui::component::{Component, Event, EventCtx, Never};
+use crate::ui::display::{Font, Icon};
+use crate::ui::event::PhysicalButton;
+use crate::ui::geometry::{Alignment2D, Offset, Point, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::{constant, shape};
const HALF_SCREEN_BUTTON_WIDTH: i16 = constant::WIDTH / 2 - 1;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/button_controller.rs b/core/embed/rust/src/ui/layout_caesar/component/button_controller.rs
index 8547d836..7eca8967 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/button_controller.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/button_controller.rs
@@ -1,15 +1,12 @@
use super::{
theme, Button, ButtonDetails, ButtonLayout, ButtonPos, HoldToConfirm, HoldToConfirmMsg,
};
-use crate::{
- time::{Duration, Instant},
- ui::{
- component::{base::Event, Component, EventCtx, Pad, Timer},
- event::{ButtonEvent, PhysicalButton},
- geometry::Rect,
- shape::Renderer,
- },
-};
+use crate::time::{Duration, Instant};
+use crate::ui::component::base::Event;
+use crate::ui::component::{Component, EventCtx, Pad, Timer};
+use crate::ui::event::{ButtonEvent, PhysicalButton};
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
/// All possible states buttons (left and right) can be at.
#[derive(Copy, Clone, PartialEq, Eq)]
diff --git a/core/embed/rust/src/ui/layout_caesar/component/changing_text.rs b/core/embed/rust/src/ui/layout_caesar/component/changing_text.rs
index bb662d9e..9c0f3991 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/changing_text.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/changing_text.rs
@@ -1,15 +1,11 @@
-use crate::{
- strutil::ShortString,
- ui::{
- component::{Component, Event, EventCtx, Never, Pad},
- display::Font,
- geometry::{Alignment, Point, Rect},
- shape::{self, Renderer},
- util::long_line_content_with_ellipsis,
- },
-};
-
-use super::{super::fonts, theme};
+use super::super::fonts;
+use super::theme;
+use crate::strutil::ShortString;
+use crate::ui::component::{Component, Event, EventCtx, Never, Pad};
+use crate::ui::display::Font;
+use crate::ui::geometry::{Alignment, Point, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::long_line_content_with_ellipsis;
/// Component that allows for "allocating" a standalone line of text anywhere
/// on the screen and updating it arbitrarily - without affecting the rest
diff --git a/core/embed/rust/src/ui/layout_caesar/component/coinjoin_progress.rs b/core/embed/rust/src/ui/layout_caesar/component/coinjoin_progress.rs
index 34a27ce7..f77b5b11 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/coinjoin_progress.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/coinjoin_progress.rs
@@ -1,22 +1,15 @@
use core::mem;
-use crate::{
- strutil::TString,
- translations::TR,
- ui::{
- component::{
- base::Never,
- text::util::{text_multiline, text_multiline_bottom},
- Component, Event, EventCtx,
- },
- geometry::{Alignment, Alignment2D, Insets, Offset, Rect},
- shape,
- shape::Renderer,
- util::animation_disabled,
- },
-};
-
use super::super::{cshape, fonts, theme};
+use crate::strutil::TString;
+use crate::translations::TR;
+use crate::ui::component::base::Never;
+use crate::ui::component::text::util::{text_multiline, text_multiline_bottom};
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::{Alignment, Alignment2D, Insets, Offset, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
+use crate::ui::util::animation_disabled;
const FOOTER_TEXT_MARGIN: i16 = 8;
const LOADER_OFFSET: i16 = -15;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/error.rs b/core/embed/rust/src/ui/layout_caesar/component/error.rs
index 647f62ee..026fb87a 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/error.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/error.rs
@@ -1,18 +1,11 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Child, Component, Event, EventCtx, Label, Never, Pad},
- constant::{screen, WIDTH},
- geometry::{Alignment2D, Offset, Point, Rect},
- shape,
- shape::Renderer,
- },
-};
-
-use super::super::{
- cshape, theme,
- theme::{BG, FG, TITLE_AREA_HEIGHT},
-};
+use super::super::theme::{BG, FG, TITLE_AREA_HEIGHT};
+use super::super::{cshape, theme};
+use crate::strutil::TString;
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Never, Pad};
+use crate::ui::constant::{screen, WIDTH};
+use crate::ui::geometry::{Alignment2D, Offset, Point, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
const FOOTER_AREA_HEIGHT: i16 = 20;
const DIVIDER_POSITION: i16 = 43;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/flow.rs b/core/embed/rust/src/ui/layout_caesar/component/flow.rs
index 685c83b3..b640ff7d 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/flow.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/flow.rs
@@ -1,17 +1,14 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Child, Component, ComponentExt, Event, EventCtx, Pad, Paginate},
- constant::SCREEN,
- geometry::Rect,
- shape::Renderer,
- },
-};
-
+use super::scrollbar::SCROLLBAR_SPACE;
+use super::title::Title;
use super::{
- scrollbar::SCROLLBAR_SPACE, theme, title::Title, ButtonAction, ButtonController,
- ButtonControllerMsg, ButtonLayout, ButtonPos, CancelInfoConfirmMsg, FlowPages, Page, ScrollBar,
+ theme, ButtonAction, ButtonController, ButtonControllerMsg, ButtonLayout, ButtonPos,
+ CancelInfoConfirmMsg, FlowPages, Page, ScrollBar,
};
+use crate::strutil::TString;
+use crate::ui::component::{Child, Component, ComponentExt, Event, EventCtx, Pad, Paginate};
+use crate::ui::constant::SCREEN;
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
pub struct Flow<F>
where
diff --git a/core/embed/rust/src/ui/layout_caesar/component/flow_pages.rs b/core/embed/rust/src/ui/layout_caesar/component/flow_pages.rs
index 52b3e92d..18edbe17 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/flow_pages.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/flow_pages.rs
@@ -1,14 +1,10 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{base::Component, FormattedText, Paginate},
- geometry::Rect,
- shape::Renderer,
- util::Pager,
- },
-};
-
use super::{ButtonActions, ButtonDetails, ButtonLayout};
+use crate::strutil::TString;
+use crate::ui::component::base::Component;
+use crate::ui::component::{FormattedText, Paginate};
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
+use crate::ui::util::Pager;
// So that there is only one implementation, and not multiple generic ones
// as would be via `const N: usize` generics.
@@ -184,8 +180,9 @@ impl Paginate for Page {
#[cfg(feature = "ui_debug")]
impl crate::trace::Trace for Page {
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
- use crate::ui::component::text::layout::LayoutFit;
use core::cell::Cell;
+
+ use crate::ui::component::text::layout::LayoutFit;
let fit: Cell<Option<LayoutFit>> = Cell::new(None);
t.component("Page");
if let Some(title) = &self.title {
diff --git a/core/embed/rust/src/ui/layout_caesar/component/frame.rs b/core/embed/rust/src/ui/layout_caesar/component/frame.rs
index ffe422d0..41264134 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/frame.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/frame.rs
@@ -1,14 +1,12 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Child, Component, ComponentExt, Event, EventCtx, Paginate},
- geometry::{Insets, Rect},
- shape::Renderer,
- util::Pager,
- },
-};
-
-use super::{super::constant, scrollbar::SCROLLBAR_SPACE, theme, title::Title, ScrollBar};
+use super::super::constant;
+use super::scrollbar::SCROLLBAR_SPACE;
+use super::title::Title;
+use super::{theme, ScrollBar};
+use crate::strutil::TString;
+use crate::ui::component::{Child, Component, ComponentExt, Event, EventCtx, Paginate};
+use crate::ui::geometry::{Insets, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::util::Pager;
/// Component for holding another component and displaying a title.
pub struct Frame<T>
diff --git a/core/embed/rust/src/ui/layout_caesar/component/hold_to_confirm.rs b/core/embed/rust/src/ui/layout_caesar/component/hold_to_confirm.rs
index f341dd8e..22fec66b 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/hold_to_confirm.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/hold_to_confirm.rs
@@ -1,17 +1,10 @@
-use crate::{
- time::{Duration, Instant},
- ui::{
- component::{Component, Event, EventCtx},
- event::ButtonEvent,
- geometry::Rect,
- shape::Renderer,
- },
-};
-
-use super::{
- loader::{Loader, DEFAULT_DURATION_MS},
- theme, ButtonContent, ButtonDetails, LoaderMsg, LoaderStyleSheet,
-};
+use super::loader::{Loader, DEFAULT_DURATION_MS};
+use super::{theme, ButtonContent, ButtonDetails, LoaderMsg, LoaderStyleSheet};
+use crate::time::{Duration, Instant};
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::event::ButtonEvent;
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
pub enum HoldToConfirmMsg {
Confirmed,
diff --git a/core/embed/rust/src/ui/layout_caesar/component/homescreen.rs b/core/embed/rust/src/ui/layout_caesar/component/homescreen.rs
index 568b8d50..766f648c 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/homescreen.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/homescreen.rs
@@ -1,27 +1,20 @@
-use crate::{
- io::BinaryData,
- strutil::TString,
- translations::TR,
- trezorhal::usb::usb_configured,
- ui::{
- component::{Child, Component, Event, EventCtx, Label},
- constant::{HEIGHT, WIDTH},
- display::{
- image::{ImageInfo, ToifFormat},
- Font, Icon,
- },
- geometry::{Alignment, Alignment2D, Insets, Offset, Point, Rect},
- layout::util::get_user_custom_image,
- notification::Notification,
- shape::{self, Renderer},
- },
-};
-
+use super::super::{constant, fonts};
use super::{
- super::{constant, fonts},
theme, ButtonController, ButtonControllerMsg, ButtonLayout, ButtonPos, CancelConfirmMsg,
LoaderMsg, ProgressLoader,
};
+use crate::io::BinaryData;
+use crate::strutil::TString;
+use crate::translations::TR;
+use crate::trezorhal::usb::usb_configured;
+use crate::ui::component::{Child, Component, Event, EventCtx, Label};
+use crate::ui::constant::{HEIGHT, WIDTH};
+use crate::ui::display::image::{ImageInfo, ToifFormat};
+use crate::ui::display::{Font, Icon};
+use crate::ui::geometry::{Alignment, Alignment2D, Insets, Offset, Point, Rect};
+use crate::ui::layout::util::get_user_custom_image;
+use crate::ui::notification::Notification;
+use crate::ui::shape::{self, Renderer};
const AREA: Rect = constant::screen();
const TOP_CENTER: Point = AREA.top_center();
diff --git a/core/embed/rust/src/ui/layout_caesar/component/input_methods/choice.rs b/core/embed/rust/src/ui/layout_caesar/component/input_methods/choice.rs
index bdd455d7..eba27ab8 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/input_methods/choice.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/input_methods/choice.rs
@@ -1,13 +1,10 @@
-use crate::ui::{
- component::{Child, Component, Event, EventCtx, Pad},
- geometry::{Offset, Rect},
- shape::Renderer,
- util::animation_disabled,
-};
-
use super::super::{
constant, theme, AutomaticMover, ButtonController, ButtonControllerMsg, ButtonLayout, ButtonPos,
};
+use crate::ui::component::{Child, Component, Event, EventCtx, Pad};
+use crate::ui::geometry::{Offset, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::util::animation_disabled;
const DEFAULT_ITEMS_DISTANCE: i16 = 10;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/input_methods/choice_item.rs b/core/embed/rust/src/ui/layout_caesar/component/input_methods/choice_item.rs
index f84edb3f..2b2c5354 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/input_methods/choice_item.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/input_methods/choice_item.rs
@@ -1,17 +1,13 @@
-use crate::{
- strutil::ShortString,
- ui::{
- component::text::{layout::Lines, TextStyle},
- constant::screen,
- display::Icon,
- geometry::{Alignment2D, Offset, Point, Rect},
- shape::{self, Renderer},
- },
-};
-
use heapless::{String, Vec};
use super::super::{theme, ButtonDetails, ButtonLayout, Choice};
+use crate::strutil::ShortString;
+use crate::ui::component::text::layout::Lines;
+use crate::ui::component::text::TextStyle;
+use crate::ui::constant::screen;
+use crate::ui::display::Icon;
+use crate::ui::geometry::{Alignment2D, Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
const ICON_RIGHT_PADDING: i16 = 2;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/input_methods/number_input.rs b/core/embed/rust/src/ui/layout_caesar/component/input_methods/number_input.rs
index f4c644a1..54e7ae12 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/input_methods/number_input.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/input_methods/number_input.rs
@@ -1,14 +1,9 @@
-use crate::{
- strutil::ShortString,
- translations::TR,
- ui::{
- component::{Component, Event, EventCtx},
- geometry::Rect,
- shape::Renderer,
- },
-};
-
use super::super::{ButtonLayout, ChoiceFactory, ChoiceItem, ChoiceMsg, ChoicePage};
+use crate::strutil::ShortString;
+use crate::translations::TR;
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
struct ChoiceFactoryNumberInput {
min: u32,
diff --git a/core/embed/rust/src/ui/layout_caesar/component/input_methods/passphrase.rs b/core/embed/rust/src/ui/layout_caesar/component/input_methods/passphrase.rs
index 8431bd22..c44c5c70 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/input_methods/passphrase.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/input_methods/passphrase.rs
@@ -1,20 +1,16 @@
-use crate::{
- strutil::{ShortString, TString},
- translations::TR,
- trezorhal::random,
- ui::{
- component::{text::common::TextBox, Child, Component, ComponentExt, Event, EventCtx},
- display::Icon,
- geometry::Rect,
- shape::Renderer,
- util::char_to_string,
- },
-};
-
use super::super::{
theme, ButtonDetails, ButtonLayout, CancelConfirmMsg, ChangingTextLine, ChoiceControls,
ChoiceFactory, ChoiceItem, ChoiceMsg, ChoicePage,
};
+use crate::strutil::{ShortString, TString};
+use crate::translations::TR;
+use crate::trezorhal::random;
+use crate::ui::component::text::common::TextBox;
+use crate::ui::component::{Child, Component, ComponentExt, Event, EventCtx};
+use crate::ui::display::Icon;
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
+use crate::ui::util::char_to_string;
/// Defines the choices currently available on the screen
#[derive(PartialEq, Clone, Copy)]
diff --git a/core/embed/rust/src/ui/layout_caesar/component/input_methods/pin.rs b/core/embed/rust/src/ui/layout_caesar/component/input_methods/pin.rs
index d51291b7..3552be97 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/input_methods/pin.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/input_methods/pin.rs
@@ -1,22 +1,18 @@
-use crate::{
- strutil::{ShortString, TString},
- time::Duration,
- translations::TR,
- trezorhal::random,
- ui::{
- component::{
- text::common::TextBox, Child, Component, ComponentExt, Event, EventCtx, Timer,
- },
- display::Icon,
- geometry::Rect,
- shape::Renderer,
- },
-};
-
+use super::super::super::fonts;
+use super::super::title::Title;
use super::super::{
- super::fonts, theme, title::Title, ButtonDetails, ButtonLayout, CancelConfirmMsg,
- ChangingTextLine, ChoiceControls, ChoiceFactory, ChoiceItem, ChoiceMsg, ChoicePage,
+ theme, ButtonDetails, ButtonLayout, CancelConfirmMsg, ChangingTextLine, ChoiceControls,
+ ChoiceFactory, ChoiceItem, ChoiceMsg, ChoicePage,
};
+use crate::strutil::{ShortString, TString};
+use crate::time::Duration;
+use crate::translations::TR;
+use crate::trezorhal::random;
+use crate::ui::component::text::common::TextBox;
+use crate::ui::component::{Child, Component, ComponentExt, Event, EventCtx, Timer};
+use crate::ui::display::Icon;
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
#[derive(Clone, Copy)]
enum PinAction {
diff --git a/core/embed/rust/src/ui/layout_caesar/component/input_methods/simple_choice.rs b/core/embed/rust/src/ui/layout_caesar/component/input_methods/simple_choice.rs
index 91c40592..d1c693bc 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/input_methods/simple_choice.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/input_methods/simple_choice.rs
@@ -1,16 +1,12 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx},
- geometry::Rect,
- shape::Renderer,
- },
-};
+use heapless::Vec;
use super::super::{
ButtonDetails, ButtonLayout, ChoiceControls, ChoiceFactory, ChoiceItem, ChoiceMsg, ChoicePage,
};
-use heapless::Vec;
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
// So that there is only one implementation, and not multiple generic ones
// as would be via `const N: usize` generics.
@@ -154,14 +150,10 @@ impl Component for SimpleChoice {
#[cfg(feature = "micropython")]
mod micropython {
use super::SimpleChoice;
- use crate::{
- error::Error,
- micropython::obj::Obj,
- ui::layout::{
- obj::ComponentMsgObj,
- result::{CANCELLED, CONFIRMED},
- },
- };
+ use crate::error::Error;
+ use crate::micropython::obj::Obj;
+ use crate::ui::layout::obj::ComponentMsgObj;
+ use crate::ui::layout::result::{CANCELLED, CONFIRMED};
impl ComponentMsgObj for SimpleChoice {
fn msg_try_into_obj(&self, msg: Self::Msg) -> Result<Obj, Error> {
diff --git a/core/embed/rust/src/ui/layout_caesar/component/input_methods/wordlist.rs b/core/embed/rust/src/ui/layout_caesar/component/input_methods/wordlist.rs
index 2c99bb82..ba90db58 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/input_methods/wordlist.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/input_methods/wordlist.rs
@@ -1,19 +1,17 @@
-use crate::{
- translations::TR,
- trezorhal::{random, wordlist::Wordlist},
- ui::{
- component::{text::common::TextBox, Child, Component, ComponentExt, Event, EventCtx},
- geometry::Rect,
- shape::Renderer,
- util::char_to_string,
- },
-};
+use heapless::Vec;
use super::super::{
theme, ButtonLayout, ChangingTextLine, ChoiceControls, ChoiceFactory, ChoiceItem, ChoiceMsg,
ChoicePage,
};
-use heapless::Vec;
+use crate::translations::TR;
+use crate::trezorhal::random;
+use crate::trezorhal::wordlist::Wordlist;
+use crate::ui::component::text::common::TextBox;
+use crate::ui::component::{Child, Component, ComponentExt, Event, EventCtx};
+use crate::ui::geometry::Rect;
+use crate::ui::shape::Renderer;
+use crate::ui::util::char_to_string;
enum WordlistAction {
Letter(char),
diff --git a/core/embed/rust/src/ui/layout_caesar/component/loader.rs b/core/embed/rust/src/ui/layout_caesar/component/loader.rs
index 582c6263..6445d1fc 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/loader.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/loader.rs
@@ -1,19 +1,13 @@
-use crate::{
- strutil::TString,
- time::{Duration, Instant},
- ui::{
- animation::Animation,
- component::{Child, Component, Event, EventCtx},
- constant,
- display::{self, Color, Font, LOADER_MAX},
- geometry::{Offset, Point, Rect},
- shape,
- shape::Renderer,
- util::animation_disabled,
- },
-};
-
use super::{theme, Progress};
+use crate::strutil::TString;
+use crate::time::{Duration, Instant};
+use crate::ui::animation::Animation;
+use crate::ui::component::{Child, Component, Event, EventCtx};
+use crate::ui::display::{self, Color, Font, LOADER_MAX};
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::util::animation_disabled;
+use crate::ui::{constant, shape};
pub const DEFAULT_DURATION_MS: u32 = 1000;
pub const SHRINKING_DURATION_MS: u32 = 500;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/mod.rs b/core/embed/rust/src/ui/layout_caesar/component/mod.rs
index 7e5c0c04..d90f266f 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/mod.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/mod.rs
@@ -8,7 +8,6 @@ mod loader;
mod result;
mod welcome_screen;
-use super::{common_messages, constant, theme};
pub use button::{
Button, ButtonAction, ButtonActions, ButtonContent, ButtonDetails, ButtonLayout, ButtonPos,
};
@@ -16,14 +15,14 @@ pub use button_controller::{AutomaticMover, ButtonController, ButtonControllerMs
pub use common_messages::CancelConfirmMsg;
pub use error::ErrorScreen;
pub use hold_to_confirm::{HoldToConfirm, HoldToConfirmMsg};
-pub use input_methods::{
- choice::{Choice, ChoiceControls, ChoiceFactory, ChoiceMsg, ChoicePage},
- choice_item::ChoiceItem,
-};
+pub use input_methods::choice::{Choice, ChoiceControls, ChoiceFactory, ChoiceMsg, ChoicePage};
+pub use input_methods::choice_item::ChoiceItem;
pub use loader::{Loader, LoaderMsg, LoaderStyle, LoaderStyleSheet, ProgressLoader};
pub use result::ResultScreen;
pub use welcome_screen::WelcomeScreen;
+use super::{common_messages, constant, theme};
+
#[cfg(all(feature = "micropython", feature = "translations"))]
mod address_details;
mod changing_text;
@@ -45,7 +44,6 @@ mod title;
#[cfg(all(feature = "micropython", feature = "translations"))]
pub use address_details::AddressDetails;
-
pub use changing_text::ChangingTextLine;
#[cfg(feature = "translations")]
pub use coinjoin_progress::CoinJoinProgress;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/page.rs b/core/embed/rust/src/ui/layout_caesar/component/page.rs
index 69f566ae..3ac1a565 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/page.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/page.rs
@@ -1,17 +1,14 @@
-use crate::{
- translations::TR,
- ui::{
- component::{Child, Component, ComponentExt, Event, EventCtx, Pad, PageMsg, Paginate},
- display::Color,
- geometry::{Insets, Rect},
- shape::Renderer,
- util::Pager,
- },
-};
-
use super::{
constant, theme, ButtonController, ButtonControllerMsg, ButtonDetails, ButtonLayout, ButtonPos,
};
+use crate::translations::TR;
+use crate::ui::component::{
+ Child, Component, ComponentExt, Event, EventCtx, Pad, PageMsg, Paginate,
+};
+use crate::ui::display::Color;
+use crate::ui::geometry::{Insets, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::util::Pager;
pub struct ButtonPage<T>
where
diff --git a/core/embed/rust/src/ui/layout_caesar/component/progress.rs b/core/embed/rust/src/ui/layout_caesar/component/progress.rs
index 397e2013..1e553341 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/progress.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/progress.rs
@@ -1,22 +1,14 @@
use core::mem;
-use crate::{
- strutil::TString,
- ui::{
- component::{
- text::paragraphs::{Paragraph, Paragraphs},
- Child, Component, Event, EventCtx, Label, Never, Pad,
- },
- constant,
- display::{Icon, LOADER_MAX},
- geometry::{Alignment2D, Offset, Rect},
- shape,
- shape::Renderer,
- util::animation_disabled,
- },
-};
-
use super::super::{cshape, fonts, theme};
+use crate::strutil::TString;
+use crate::ui::component::text::paragraphs::{Paragraph, Paragraphs};
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Never, Pad};
+use crate::ui::display::{Icon, LOADER_MAX};
+use crate::ui::geometry::{Alignment2D, Offset, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::util::animation_disabled;
+use crate::ui::{constant, shape};
const BOTTOM_DESCRIPTION_MARGIN: i16 = 11;
const LOADER_Y_OFFSET_TITLE: i16 = -10;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/result.rs b/core/embed/rust/src/ui/layout_caesar/component/result.rs
index 1956ed52..fc5e4cb3 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/result.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/result.rs
@@ -1,11 +1,9 @@
-use crate::ui::{
- component::{Child, Component, Event, EventCtx, Label, Never, Pad},
- constant::{screen, HEIGHT, WIDTH},
- display::{Color, Icon},
- geometry::{Alignment2D, Offset, Point, Rect},
- shape,
- shape::Renderer,
-};
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Never, Pad};
+use crate::ui::constant::{screen, HEIGHT, WIDTH};
+use crate::ui::display::{Color, Icon};
+use crate::ui::geometry::{Alignment2D, Offset, Point, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
const MESSAGE_AREA_START: i16 = 24 + 11;
const MESSAGE_AREA_START_2L: i16 = 24 + 7;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/scrollbar.rs b/core/embed/rust/src/ui/layout_caesar/component/scrollbar.rs
index cc75d305..314c216b 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/scrollbar.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/scrollbar.rs
@@ -1,13 +1,10 @@
-use crate::ui::{
- component::{Component, Event, EventCtx, Never, Pad, Paginate},
- geometry::{Offset, Point, Rect},
- shape::{self, Renderer},
- util::Pager,
-};
+use heapless::Vec;
use super::super::theme;
-
-use heapless::Vec;
+use crate::ui::component::{Component, Event, EventCtx, Never, Pad, Paginate};
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::Pager;
/// Scrollbar to be painted horizontally at the top right of the screen.
pub struct ScrollBar {
diff --git a/core/embed/rust/src/ui/layout_caesar/component/share_words.rs b/core/embed/rust/src/ui/layout_caesar/component/share_words.rs
index db9c06bf..59b17a94 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/share_words.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/share_words.rs
@@ -1,22 +1,18 @@
-use crate::{
- strutil::{ShortString, TString},
- translations::TR,
- ui::{
- component::{
- text::util::text_multiline, Child, Component, Event, EventCtx, Never, Paginate,
- },
- display::Font,
- geometry::{Alignment, Offset, Rect},
- shape::{self, Renderer},
- util::Pager,
- },
-};
-
use heapless::Vec;
#[cfg(feature = "ui_debug")]
use ufmt::uwrite;
-use super::{super::fonts, scrollbar::SCROLLBAR_SPACE, theme, ScrollBar};
+use super::super::fonts;
+use super::scrollbar::SCROLLBAR_SPACE;
+use super::{theme, ScrollBar};
+use crate::strutil::{ShortString, TString};
+use crate::translations::TR;
+use crate::ui::component::text::util::text_multiline;
+use crate::ui::component::{Child, Component, Event, EventCtx, Never, Paginate};
+use crate::ui::display::Font;
+use crate::ui::geometry::{Alignment, Offset, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::Pager;
const WORDS_PER_PAGE: usize = 3;
const EXTRA_LINE_HEIGHT: i16 = -2;
diff --git a/core/embed/rust/src/ui/layout_caesar/component/show_more.rs b/core/embed/rust/src/ui/layout_caesar/component/show_more.rs
index 80895469..418066fc 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/show_more.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/show_more.rs
@@ -1,13 +1,8 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Child, Component, Event, EventCtx, Never},
- geometry::{Insets, Rect},
- shape::Renderer,
- },
-};
-
use super::{theme, ButtonController, ButtonControllerMsg, ButtonLayout, ButtonPos};
+use crate::strutil::TString;
+use crate::ui::component::{Child, Component, Event, EventCtx, Never};
+use crate::ui::geometry::{Insets, Rect};
+use crate::ui::shape::Renderer;
pub enum CancelInfoConfirmMsg {
Cancelled,
diff --git a/core/embed/rust/src/ui/layout_caesar/component/title.rs b/core/embed/rust/src/ui/layout_caesar/component/title.rs
index 35e54822..fc4edc09 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/title.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/title.rs
@@ -1,15 +1,10 @@
-use crate::{
- strutil::TString,
- time::Instant,
- ui::{
- component::{Component, Event, EventCtx, Marquee, Never},
- geometry::{Alignment, Offset, Rect},
- shape,
- shape::Renderer,
- },
-};
-
use super::super::theme;
+use crate::strutil::TString;
+use crate::time::Instant;
+use crate::ui::component::{Component, Event, EventCtx, Marquee, Never};
+use crate::ui::geometry::{Alignment, Offset, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
pub struct Title {
area: Rect,
diff --git a/core/embed/rust/src/ui/layout_caesar/component/welcome_screen.rs b/core/embed/rust/src/ui/layout_caesar/component/welcome_screen.rs
index ff21841e..6dc8acfd 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/welcome_screen.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/welcome_screen.rs
@@ -1,11 +1,8 @@
-use crate::ui::{
- component::{Component, Event, EventCtx, Never},
- geometry::{Alignment2D, Offset, Rect},
- shape,
- shape::Renderer,
-};
-
use super::super::theme;
+use crate::ui::component::{Component, Event, EventCtx, Never};
+use crate::ui::geometry::{Alignment2D, Offset, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
const ICON_TOP_MARGIN: i16 = 12;
diff --git a/core/embed/rust/src/ui/layout_caesar/component_msg_obj.rs b/core/embed/rust/src/ui/layout_caesar/component_msg_obj.rs
index 7ed804c3..385ed73c 100644
--- a/core/embed/rust/src/ui/layout_caesar/component_msg_obj.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component_msg_obj.rs
@@ -5,22 +5,14 @@ use super::component::{
ConfirmHomescreen, Flow, Frame, Homescreen, Lockscreen, NumberInput, Page, PassphraseEntry,
PinEntry, Progress, ScrollableFrame, ShowMore, WordlistEntry,
};
-use crate::{
- error::Error,
- micropython::obj::Obj,
- ui::{
- component::{
- base::Component,
- paginated::{PageMsg, Paginate},
- text::paragraphs::{ParagraphSource, Paragraphs},
- Never, Timeout,
- },
- layout::{
- obj::ComponentMsgObj,
- result::{CANCELLED, CONFIRMED, INFO},
- },
- },
-};
+use crate::error::Error;
+use crate::micropython::obj::Obj;
+use crate::ui::component::base::Component;
+use crate::ui::component::paginated::{PageMsg, Paginate};
+use crate::ui::component::text::paragraphs::{ParagraphSource, Paragraphs};
+use crate::ui::component::{Never, Timeout};
+use crate::ui::layout::obj::ComponentMsgObj;
+use crate::ui::layout::result::{CANCELLED, CONFIRMED, INFO};
impl From<CancelConfirmMsg> for Obj {
fn from(value: CancelConfirmMsg) -> Self {
diff --git a/core/embed/rust/src/ui/layout_caesar/constant.rs b/core/embed/rust/src/ui/layout_caesar/constant.rs
index 7b7eb011..97df78d1 100644
--- a/core/embed/rust/src/ui/layout_caesar/constant.rs
+++ b/core/embed/rust/src/ui/layout_caesar/constant.rs
@@ -1,6 +1,5 @@
-use crate::ui::geometry::{Offset, Point, Rect};
-
use crate::trezorhal::display::{DISPLAY_RESX, DISPLAY_RESY};
+use crate::ui::geometry::{Offset, Point, Rect};
pub const WIDTH: i16 = DISPLAY_RESX as _;
pub const HEIGHT: i16 = DISPLAY_RESY as _;
diff --git a/core/embed/rust/src/ui/layout_caesar/cshape/dotted_line.rs b/core/embed/rust/src/ui/layout_caesar/cshape/dotted_line.rs
index 500f7f98..0b7189fd 100644
--- a/core/embed/rust/src/ui/layout_caesar/cshape/dotted_line.rs
+++ b/core/embed/rust/src/ui/layout_caesar/cshape/dotted_line.rs
@@ -1,11 +1,9 @@
-use crate::ui::{
- display::Color,
- geometry::{Offset, Point, Rect},
- shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone},
-};
-
use without_alloc::alloc::LocalAllocLeakExt;
+use crate::ui::display::Color;
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone};
+
// Shape of horizontal solid/dotted line
pub struct HorizontalLine {
/// Position of the left-top point
diff --git a/core/embed/rust/src/ui/layout_caesar/cshape/loader_circular.rs b/core/embed/rust/src/ui/layout_caesar/cshape/loader_circular.rs
index 57e349d3..0923cc28 100644
--- a/core/embed/rust/src/ui/layout_caesar/cshape/loader_circular.rs
+++ b/core/embed/rust/src/ui/layout_caesar/cshape/loader_circular.rs
@@ -1,11 +1,9 @@
-use crate::ui::{
- display::Color,
- geometry::{Offset, Point, Rect},
- shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone},
-};
-
use without_alloc::alloc::LocalAllocLeakExt;
+use crate::ui::display::Color;
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone};
+
static CELLS: [Offset; 24] = [
Offset::new(1, -4),
Offset::new(2, -4),
diff --git a/core/embed/rust/src/ui/layout_caesar/cshape/loader_small.rs b/core/embed/rust/src/ui/layout_caesar/cshape/loader_small.rs
index 432c845d..e62009e8 100644
--- a/core/embed/rust/src/ui/layout_caesar/cshape/loader_small.rs
+++ b/core/embed/rust/src/ui/layout_caesar/cshape/loader_small.rs
@@ -1,12 +1,10 @@
-use crate::ui::{
- display::Color,
- geometry::{Offset, Point, Rect},
- shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone},
-};
+use core::f32::consts::SQRT_2;
use without_alloc::alloc::LocalAllocLeakExt;
-use core::f32::consts::SQRT_2;
+use crate::ui::display::Color;
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone};
const STAR_COUNT: usize = 8;
const RADIUS: i16 = 3;
diff --git a/core/embed/rust/src/ui/layout_caesar/cshape/loader_starry.rs b/core/embed/rust/src/ui/layout_caesar/cshape/loader_starry.rs
index 84e42f70..84a3349c 100644
--- a/core/embed/rust/src/ui/layout_caesar/cshape/loader_starry.rs
+++ b/core/embed/rust/src/ui/layout_caesar/cshape/loader_starry.rs
@@ -1,12 +1,10 @@
-use crate::ui::{
- display::Color,
- geometry::{Offset, Point, Rect},
- shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone},
-};
+use core::f32::consts::SQRT_2;
use without_alloc::alloc::LocalAllocLeakExt;
-use core::f32::consts::SQRT_2;
+use crate::ui::display::Color;
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone};
const STAR_COUNT: usize = 8;
const STAR_SMALL: i16 = 2;
diff --git a/core/embed/rust/src/ui/layout_caesar/mod.rs b/core/embed/rust/src/ui/layout_caesar/mod.rs
index db2e5c63..1720c921 100644
--- a/core/embed/rust/src/ui/layout_caesar/mod.rs
+++ b/core/embed/rust/src/ui/layout_caesar/mod.rs
@@ -1,13 +1,11 @@
-use super::{geometry::Rect, CommonUI};
-
+use super::geometry::Rect;
#[cfg(any(feature = "ui_debug_overlay", feature = "ui_performance_overlay"))]
use super::shape;
-
-#[cfg(feature = "ui_debug_overlay")]
-use super::{display::Color, geometry::Offset};
-
+use super::CommonUI;
#[cfg(feature = "ui_performance_overlay")]
use super::PerformanceOverlay;
+#[cfg(feature = "ui_debug_overlay")]
+use super::{display::Color, geometry::Offset};
#[cfg(feature = "bootloader")]
pub mod bootloader;
@@ -24,9 +22,10 @@ pub mod cshape;
pub mod fonts;
pub mod theme;
-use crate::ui::layout::simplified::show;
use component::{ErrorScreen, WelcomeScreen};
+use crate::ui::layout::simplified::show;
+
pub struct UICaesar {}
#[cfg(feature = "micropython")]
diff --git a/core/embed/rust/src/ui/layout_caesar/prodtest/mod.rs b/core/embed/rust/src/ui/layout_caesar/prodtest/mod.rs
index b1308b8e..bfcc80fb 100644
--- a/core/embed/rust/src/ui/layout_caesar/prodtest/mod.rs
+++ b/core/embed/rust/src/ui/layout_caesar/prodtest/mod.rs
@@ -1,24 +1,20 @@
mod welcome;
#[cfg(feature = "touch")]
-use crate::ui::event::TouchEvent;
-use crate::ui::{
- component::Event,
- constant::screen,
- display,
- display::Color,
- geometry::{Alignment, Offset, Rect},
- layout::simplified::{process_frame_event, show},
- shape,
- shape::render_on_display,
- ui_prodtest::{ProdtestLayoutType, ProdtestUI},
-};
-
-use super::{fonts, UICaesar};
+use heapless::Vec;
use welcome::Welcome;
+use super::{fonts, UICaesar};
+use crate::ui::component::Event;
+use crate::ui::constant::screen;
+use crate::ui::display::Color;
#[cfg(feature = "touch")]
-use heapless::Vec;
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Alignment, Offset, Rect};
+use crate::ui::layout::simplified::{process_frame_event, show};
+use crate::ui::shape::render_on_display;
+use crate::ui::ui_prodtest::{ProdtestLayoutType, ProdtestUI};
+use crate::ui::{display, shape};
#[allow(clippy::large_enum_variant)]
pub enum ProdtestLayout {
diff --git a/core/embed/rust/src/ui/layout_caesar/prodtest/welcome.rs b/core/embed/rust/src/ui/layout_caesar/prodtest/welcome.rs
index 02195066..062795c3 100644
--- a/core/embed/rust/src/ui/layout_caesar/prodtest/welcome.rs
+++ b/core/embed/rust/src/ui/layout_caesar/prodtest/welcome.rs
@@ -1,10 +1,8 @@
use super::super::theme::{BLACK, WHITE};
-use crate::ui::{
- component::{Component, Event, EventCtx, Never, Qr},
- constant::screen,
- geometry::{Offset, Point, Rect},
- shape::{self, Renderer},
-};
+use crate::ui::component::{Component, Event, EventCtx, Never, Qr};
+use crate::ui::constant::screen;
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
pub struct Welcome {
id: Option<&'static str>,
diff --git a/core/embed/rust/src/ui/layout_caesar/theme/bootloader.rs b/core/embed/rust/src/ui/layout_caesar/theme/bootloader.rs
index 3ba34112..848b1dcc 100644
--- a/core/embed/rust/src/ui/layout_caesar/theme/bootloader.rs
+++ b/core/embed/rust/src/ui/layout_caesar/theme/bootloader.rs
@@ -1,7 +1,8 @@
-use crate::ui::{component::text::TextStyle, display::Color, util::include_icon};
-
use super::super::fonts;
pub use super::super::theme::{BLACK, WHITE};
+use crate::ui::component::text::TextStyle;
+use crate::ui::display::Color;
+use crate::ui::util::include_icon;
pub const BLD_BG: Color = BLACK;
pub const BLD_FG: Color = WHITE;
diff --git a/core/embed/rust/src/ui/layout_caesar/theme/mod.rs b/core/embed/rust/src/ui/layout_caesar/theme/mod.rs
index ce0e45b2..c1326736 100644
--- a/core/embed/rust/src/ui/layout_caesar/theme/mod.rs
+++ b/core/embed/rust/src/ui/layout_caesar/theme/mod.rs
@@ -1,14 +1,11 @@
-use crate::ui::{
- component::{
- text::{layout::Chunks, paragraphs::PARAGRAPH_BOTTOM_SPACE, TextStyle},
- LineBreaking, PageBreaking,
- },
- display::{Color, Font},
- geometry::Offset,
- util::include_icon,
-};
-
use super::fonts;
+use crate::ui::component::text::layout::Chunks;
+use crate::ui::component::text::paragraphs::PARAGRAPH_BOTTOM_SPACE;
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{LineBreaking, PageBreaking};
+use crate::ui::display::{Color, Font};
+use crate::ui::geometry::Offset;
+use crate::ui::util::include_icon;
pub mod bootloader;
diff --git a/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs b/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs
index 1d005e52..a0f4270a 100644
--- a/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs
+++ b/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs
@@ -1,49 +1,41 @@
use core::cmp::Ordering;
-use crate::{
- error::Error,
- io::BinaryData,
- maybe_trace::MaybeTrace,
- micropython::{buffer::StrBuffer, gc::Gc, iter::IterBuf, list::List, obj::Obj, util},
- strutil::TString,
- translations::TR,
- ui::{
- component::{
- text::{
- op::OpTextLayout,
- paragraphs::{
- Checklist, Paragraph, ParagraphSource, ParagraphVecLong, ParagraphVecShort,
- Paragraphs, VecExt,
- },
- TextStyle,
- },
- Component, ComponentExt, Empty, FormattedText, Label, LineBreaking, Paginate, Timeout,
- },
- geometry,
- layout::{
- obj::{LayoutMaybeTrace, LayoutObj, RootComponent},
- util::{ConfirmValueParams, PropsList, RecoveryType},
- },
- notification::Notification,
- ui_firmware::{
- FirmwareUI, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_MENU_ITEMS,
- MAX_PAIRED_DEVICES, MAX_WORD_QUIZ_ITEMS,
- },
- ModelUI,
- },
-};
+use heapless::Vec;
-use super::{
- component::{
- AddressDetails, ButtonActions, ButtonDetails, ButtonLayout, ButtonPage, ChoiceControls,
- CoinJoinProgress, ConfirmHomescreen, Flow, FlowPages, Frame, Homescreen, Lockscreen,
- NumberInput, Page, PassphraseEntry, PinEntry, Progress, ScrollableFrame, ShareWords,
- ShowMore, SimpleChoice, WordlistEntry, WordlistType,
- },
- constant, fonts, theme, UICaesar,
+use super::component::{
+ AddressDetails, ButtonActions, ButtonDetails, ButtonLayout, ButtonPage, ChoiceControls,
+ CoinJoinProgress, ConfirmHomescreen, Flow, FlowPages, Frame, Homescreen, Lockscreen,
+ NumberInput, Page, PassphraseEntry, PinEntry, Progress, ScrollableFrame, ShareWords, ShowMore,
+ SimpleChoice, WordlistEntry, WordlistType,
};
-
-use heapless::Vec;
+use super::{constant, fonts, theme, UICaesar};
+use crate::error::Error;
+use crate::io::BinaryData;
+use crate::maybe_trace::MaybeTrace;
+use crate::micropython::buffer::StrBuffer;
+use crate::micropython::gc::Gc;
+use crate::micropython::iter::IterBuf;
+use crate::micropython::list::List;
+use crate::micropython::obj::Obj;
+use crate::micropython::util;
+use crate::strutil::TString;
+use crate::translations::TR;
+use crate::ui::component::text::op::OpTextLayout;
+use crate::ui::component::text::paragraphs::{
+ Checklist, Paragraph, ParagraphSource, ParagraphVecLong, ParagraphVecShort, Paragraphs, VecExt,
+};
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{
+ Component, ComponentExt, Empty, FormattedText, Label, LineBreaking, Paginate, Timeout,
+};
+use crate::ui::layout::obj::{LayoutMaybeTrace, LayoutObj, RootComponent};
+use crate::ui::layout::util::{ConfirmValueParams, PropsList, RecoveryType};
+use crate::ui::notification::Notification;
+use crate::ui::ui_firmware::{
+ FirmwareUI, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_MENU_ITEMS, MAX_PAIRED_DEVICES,
+ MAX_WORD_QUIZ_ITEMS,
+};
+use crate::ui::{geometry, ModelUI};
impl FirmwareUI for UICaesar {
fn confirm_action(
diff --git a/core/embed/rust/src/ui/layout_delizia/bootloader/connect.rs b/core/embed/rust/src/ui/layout_delizia/bootloader/connect.rs
index 5419ac7e..b13eecca 100644
--- a/core/embed/rust/src/ui/layout_delizia/bootloader/connect.rs
+++ b/core/embed/rust/src/ui/layout_delizia/bootloader/connect.rs
@@ -1,18 +1,13 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx, Pad},
- display::{Color, Font},
- geometry::{Alignment, Offset, Point, Rect},
- shape::{self, Renderer},
- },
-};
-
-use super::super::{
- component::{Button, ButtonMsg},
- constant::WIDTH,
- theme::bootloader::{button_bld, BUTTON_AREA_START, BUTTON_HEIGHT, CONTENT_PADDING},
+use super::super::component::{Button, ButtonMsg};
+use super::super::constant::WIDTH;
+use super::super::theme::bootloader::{
+ button_bld, BUTTON_AREA_START, BUTTON_HEIGHT, CONTENT_PADDING,
};
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx, Pad};
+use crate::ui::display::{Color, Font};
+use crate::ui::geometry::{Alignment, Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
#[repr(u32)]
#[derive(Copy, Clone, ToPrimitive)]
diff --git a/core/embed/rust/src/ui/layout_delizia/bootloader/intro.rs b/core/embed/rust/src/ui/layout_delizia/bootloader/intro.rs
index 075d3e85..e6f9b5cb 100644
--- a/core/embed/rust/src/ui/layout_delizia/bootloader/intro.rs
+++ b/core/embed/rust/src/ui/layout_delizia/bootloader/intro.rs
@@ -1,22 +1,16 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Child, Component, Event, EventCtx, Label, Pad},
- constant::screen,
- display::Icon,
- geometry::{Alignment, Insets, Point, Rect},
- shape::Renderer,
- },
-};
-
-use super::super::{
- component::{Button, ButtonMsg::Clicked},
- constant::WIDTH,
- theme::bootloader::{
- button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_AREA_START, BUTTON_HEIGHT,
- CONTENT_PADDING, CORNER_BUTTON_AREA, MENU32, TEXT_NORMAL, TEXT_WARNING, TITLE_AREA,
- },
+use super::super::component::Button;
+use super::super::component::ButtonMsg::Clicked;
+use super::super::constant::WIDTH;
+use super::super::theme::bootloader::{
+ button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_AREA_START, BUTTON_HEIGHT,
+ CONTENT_PADDING, CORNER_BUTTON_AREA, MENU32, TEXT_NORMAL, TEXT_WARNING, TITLE_AREA,
};
+use crate::strutil::TString;
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Pad};
+use crate::ui::constant::screen;
+use crate::ui::display::Icon;
+use crate::ui::geometry::{Alignment, Insets, Point, Rect};
+use crate::ui::shape::Renderer;
#[repr(u32)]
#[derive(Copy, Clone, ToPrimitive)]
diff --git a/core/embed/rust/src/ui/layout_delizia/bootloader/menu.rs b/core/embed/rust/src/ui/layout_delizia/bootloader/menu.rs
index 50d360ef..4aa8cab7 100644
--- a/core/embed/rust/src/ui/layout_delizia/bootloader/menu.rs
+++ b/core/embed/rust/src/ui/layout_delizia/bootloader/menu.rs
@@ -1,18 +1,14 @@
-use crate::ui::{
- component::{Child, Component, Event, EventCtx, Label, Pad},
- constant::{screen, WIDTH},
- display::Icon,
- geometry::{Insets, Point, Rect},
- shape::Renderer,
-};
-
-use super::super::{
- component::{Button, ButtonMsg::Clicked, IconText},
- theme::bootloader::{
- button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_HEIGHT, CONTENT_PADDING,
- CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, FIRE24, REFRESH24, TITLE_AREA, X32,
- },
+use super::super::component::ButtonMsg::Clicked;
+use super::super::component::{Button, IconText};
+use super::super::theme::bootloader::{
+ button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_HEIGHT, CONTENT_PADDING,
+ CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, FIRE24, REFRESH24, TITLE_AREA, X32,
};
+use crate::ui::component::{Child, Component, Event, EventCtx, Label, Pad};
+use crate::ui::constant::{screen, WIDTH};
+use crate::ui::display::Icon;
+use crate::ui::geometry::{Insets, Point, Rect};
+use crate::ui::shape::Renderer;
const BUTTON_AREA_START: i16 = 56;
const BUTTON_SPACING: i16 = 8;
diff --git a/core/embed/rust/src/ui/layout_delizia/bootloader/mod.rs b/core/embed/rust/src/ui/layout_delizia/bootloader/mod.rs
index faa26292..06e41581 100644
--- a/core/embed/rust/src/ui/layout_delizia/bootloader/mod.rs
+++ b/core/embed/rust/src/ui/layout_delizia/bootloader/mod.rs
@@ -1,48 +1,33 @@
-use heapless::String;
-
-use super::{
- bootloader::welcome::Welcome,
- component::{
- bl_confirm::{Confirm, ConfirmTitle},
- Button, ResultScreen, WelcomeScreen,
- },
- cshape::{render_loader, LoaderRange},
- fonts,
- theme::{
- backlight,
- bootloader::{
- button_bld, button_bld_menu, button_confirm, button_wipe_cancel, button_wipe_confirm,
- BLD_BG, BLD_FG, BLD_TITLE_COLOR, BLD_WARN_COLOR, BLD_WIPE_COLOR, CHECK24, CHECK40,
- DOWNLOAD24, FIRE32, FIRE40, RESULT_FW_INSTALL, RESULT_WIPE, TEXT_BOLD, TEXT_NORMAL,
- TEXT_WIPE_BOLD, TEXT_WIPE_NORMAL, WARNING40, WELCOME_COLOR, X24,
- },
- GREEN_LIGHT, GREY,
- },
- UIDelizia,
-};
-
-use crate::{
- bootloader::run,
- time::Duration,
- trezorhal::time,
- ui::{
- component::Label,
- display::{self, toif::Toif, Color, Icon, LOADER_MAX},
- geometry::{Alignment, Alignment2D, Offset, Point, Rect},
- layout::simplified::show,
- shape,
- shape::render_on_display,
- ui_bootloader::BootloaderUI,
- util::animation_disabled,
- CommonUI,
- },
-};
-
-use ufmt::uwrite;
-
use connect::Connect;
+use heapless::String;
use intro::Intro;
use menu::Menu;
+use ufmt::uwrite;
+
+use super::bootloader::welcome::Welcome;
+use super::component::bl_confirm::{Confirm, ConfirmTitle};
+use super::component::{Button, ResultScreen, WelcomeScreen};
+use super::cshape::{render_loader, LoaderRange};
+use super::theme::bootloader::{
+ button_bld, button_bld_menu, button_confirm, button_wipe_cancel, button_wipe_confirm, BLD_BG,
+ BLD_FG, BLD_TITLE_COLOR, BLD_WARN_COLOR, BLD_WIPE_COLOR, CHECK24, CHECK40, DOWNLOAD24, FIRE32,
+ FIRE40, RESULT_FW_INSTALL, RESULT_WIPE, TEXT_BOLD, TEXT_NORMAL, TEXT_WIPE_BOLD,
+ TEXT_WIPE_NORMAL, WARNING40, WELCOME_COLOR, X24,
+};
+use super::theme::{backlight, GREEN_LIGHT, GREY};
+use super::{fonts, UIDelizia};
+use crate::bootloader::run;
+use crate::time::Duration;
+use crate::trezorhal::time;
+use crate::ui::component::Label;
+use crate::ui::display::toif::Toif;
+use crate::ui::display::{self, Color, Icon, LOADER_MAX};
+use crate::ui::geometry::{Alignment, Alignment2D, Offset, Point, Rect};
+use crate::ui::layout::simplified::show;
+use crate::ui::shape::render_on_display;
+use crate::ui::ui_bootloader::BootloaderUI;
+use crate::ui::util::animation_disabled;
+use crate::ui::{shape, CommonUI};
pub mod intro;
pub mod menu;
diff --git a/core/embed/rust/src/ui/layout_delizia/bootloader/welcome.rs b/core/embed/rust/src/ui/layout_delizia/bootloader/welcome.rs
index 8b1e3daf..e3f0b271 100644
--- a/core/embed/rust/src/ui/layout_delizia/bootloader/welcome.rs
+++ b/core/embed/rust/src/ui/layout_delizia/bootloader/welcome.rs
@@ -1,14 +1,9 @@
-use crate::ui::{
- component::{Component, Event, EventCtx, Never, Pad},
- constant::screen,
- geometry::{Offset, Point, Rect},
- shape::{self, Renderer},
-};
-
-use super::{
- super::theme::{BLACK, GREY, WHITE},
- fonts,
-};
+use super::super::theme::{BLACK, GREY, WHITE};
+use super::fonts;
+use crate::ui::component::{Component, Event, EventCtx, Never, Pad};
+use crate::ui::constant::screen;
+use crate::ui::geometry::{Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
const TEXT_ORIGIN: Point = Point::new(0, 105);
const STRIDE: i16 = 22;
diff --git a/core/embed/rust/src/ui/layout_delizia/component/address_details.rs b/core/embed/rust/src/ui/layout_delizia/component/address_details.rs
index b120d43f..785e8376 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/address_details.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/address_details.rs
@@ -1,26 +1,22 @@
use heapless::Vec;
-use crate::{
- error::Error,
- micropython::{buffer::StrBuffer, gc::GcBox},
- strutil::TString,
- translations::TR,
- ui::{
- component::{
- swipe_detect::SwipeConfig,
- text::paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt},
- Component, Event, EventCtx, Paginate,
- },
- event::SwipeEvent,
- flow::Swipable,
- geometry::{Direction, Rect},
- layout::util::MAX_XPUBS,
- shape::Renderer,
- util::Pager,
- },
-};
-
use super::{theme, Frame, FrameMsg, Header};
+use crate::error::Error;
+use crate::micropython::buffer::StrBuffer;
+use crate::micropython::gc::GcBox;
+use crate::strutil::TString;
+use crate::translations::TR;
+use crate::ui::component::swipe_detect::SwipeConfig;
+use crate::ui::component::text::paragraphs::{
+ Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt,
+};
+use crate::ui::component::{Component, Event, EventCtx, Paginate};
+use crate::ui::event::SwipeEvent;
+use crate::ui::flow::Swipable;
+use crate::ui::geometry::{Direction, Rect};
+use crate::ui::layout::util::MAX_XPUBS;
+use crate::ui::shape::Renderer;
+use crate::ui::util::Pager;
pub struct AddressDetails {
details: Frame<Paragraphs<ParagraphVecShort<'static>>>,
diff --git a/core/embed/rust/src/ui/layout_delizia/component/binary_selection.rs b/core/embed/rust/src/ui/layout_delizia/component/binary_selection.rs
index decc466e..455bf6ac 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/binary_selection.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/binary_selection.rs
@@ -1,10 +1,8 @@
-use crate::ui::{
- component::{Component, Event, EventCtx},
- geometry::{Alignment, Alignment2D, Offset, Rect},
- shape::Renderer,
-};
-
-use super::{super::cshape, theme, Button, ButtonContent, ButtonMsg, ButtonStyleSheet};
+use super::super::cshape;
+use super::{theme, Button, ButtonContent, ButtonMsg, ButtonStyleSheet};
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::{Alignment, Alignment2D, Offset, Rect};
+use crate::ui::shape::Renderer;
pub enum BinarySelectionMsg {
Left,
diff --git a/core/embed/rust/src/ui/layout_delizia/component/bl_confirm.rs b/core/embed/rust/src/ui/layout_delizia/component/bl_confirm.rs
index 3e06b9b0..268f1fd1 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/bl_confirm.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/bl_confirm.rs
@@ -1,29 +1,18 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Child, Component, ComponentExt, Event, EventCtx, Label, Pad},
- constant,
- constant::screen,
- display::{Color, Icon},
- geometry::{Alignment2D, Insets, Offset, Point, Rect},
- shape,
- shape::Renderer,
- },
-};
-
-use super::{
- constant::WIDTH,
- theme::{
- bootloader::{
- text_fingerprint, text_title, BUTTON_AREA_START, BUTTON_HEIGHT, CONTENT_PADDING,
- CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, INFO32, TITLE_AREA, X32,
- },
- WHITE,
- },
- Button,
- ButtonMsg::Clicked,
- ButtonStyleSheet,
+use super::constant::WIDTH;
+use super::theme::bootloader::{
+ text_fingerprint, text_title, BUTTON_AREA_START, BUTTON_HEIGHT, CONTENT_PADDING,
+ CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, INFO32, TITLE_AREA, X32,
};
+use super::theme::WHITE;
+use super::ButtonMsg::Clicked;
+use super::{Button, ButtonStyleSheet};
+use crate::strutil::TString;
+use crate::ui::component::{Child, Component, ComponentExt, Event, EventCtx, Label, Pad};
+use crate::ui::constant::screen;
+use crate::ui::display::{Color, Icon};
+use crate::ui::geometry::{Alignment2D, Insets, Offset, Point, Rect};
+use crate::ui::shape::Renderer;
+use crate::ui::{constant, shape};
const ICON_TOP: i16 = 17;
const CONTENT_START: i16 = 72;
diff --git a/core/embed/rust/src/ui/layout_delizia/component/button.rs b/core/embed/rust/src/ui/layout_delizia/component/button.rs
index 94c8e800..f7081c57 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/button.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/button.rs
@@ -1,19 +1,15 @@
+use super::theme;
+use crate::strutil::TString;
+use crate::time::ShortDuration;
#[cfg(feature = "haptic")]
use crate::trezorhal::haptic::{play, HapticEffect};
-use crate::{
- strutil::TString,
- time::ShortDuration,
- ui::{
- component::{Component, Event, EventCtx, Timer},
- display::{toif::Icon, Color, Font},
- event::TouchEvent,
- geometry::{Alignment, Alignment2D, Insets, Offset, Point, Rect},
- shape::{self, Renderer},
- util::split_two_lines,
- },
-};
-
-use super::theme;
+use crate::ui::component::{Component, Event, EventCtx, Timer};
+use crate::ui::display::toif::Icon;
+use crate::ui::display::{Color, Font};
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Alignment, Alignment2D, Insets, Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::split_two_lines;
pub enum ButtonMsg {
Pressed,
diff --git a/core/embed/rust/src/ui/layout_delizia/component/coinjoin_progress.rs b/core/embed/rust/src/ui/layout_delizia/component/coinjoin_progress.rs
index 3129361a..d0c734d5 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/coinjoin_progress.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/coinjoin_progress.rs
@@ -1,20 +1,16 @@
use core::mem;
-use crate::{
- error::Error,
- maybe_trace::MaybeTrace,
- strutil::TString,
- translations::TR,
- ui::{
- component::{base::Never, Bar, Component, Empty, Event, EventCtx, Label, Split},
- geometry::{Insets, Offset, Rect},
- shape,
- shape::Renderer,
- util::animation_disabled,
- },
-};
-
use super::{constant, theme, Frame, Header};
+use crate::error::Error;
+use crate::maybe_trace::MaybeTrace;
+use crate::strutil::TString;
+use crate::translations::TR;
+use crate::ui::component::base::Never;
+use crate::ui::component::{Bar, Component, Empty, Event, EventCtx, Label, Split};
+use crate::ui::geometry::{Insets, Offset, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
+use crate::ui::util::animation_disabled;
const RECTANGLE_HEIGHT: i16 = 56;
const LABEL_TOP: i16 = 135;
diff --git a/core/embed/rust/src/ui/layout_delizia/component/error.rs b/core/embed/rust/src/ui/layout_delizia/component/error.rs
index eda45be8..5e54d9bf 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/error.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/error.rs
@@ -1,19 +1,12 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx, Label, Never, Pad},
- constant::screen,
- geometry::{Alignment2D, Point, Rect},
- shape,
- shape::Renderer,
- },
-};
-
-use super::{
- constant::WIDTH,
- theme::{FATAL_ERROR_COLOR, ICON_WARNING40, RESULT_FOOTER_START, RESULT_PADDING, WHITE},
- ResultFooter, ResultStyle,
-};
+use super::constant::WIDTH;
+use super::theme::{FATAL_ERROR_COLOR, ICON_WARNING40, RESULT_FOOTER_START, RESULT_PADDING, WHITE};
+use super::{ResultFooter, ResultStyle};
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx, Label, Never, Pad};
+use crate::ui::constant::screen;
+use crate::ui::geometry::{Alignment2D, Point, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
const ICON_TOP: i16 = 23;
const TITLE_AREA_START: i16 = 70;
diff --git a/core/embed/rust/src/ui/layout_delizia/component/fido.rs b/core/embed/rust/src/ui/layout_delizia/component/fido.rs
index 8aa6e183..e654a07b 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/fido.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/fido.rs
@@ -1,18 +1,14 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{
- image::Image,
- paginated::SinglePage,
- text::paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs},
- Component, Event, EventCtx,
- },
- geometry::{Insets, Offset, Rect},
- shape::Renderer,
- },
+use super::super::component::fido_icons::get_fido_icon_data;
+use super::super::component::theme;
+use crate::strutil::TString;
+use crate::ui::component::image::Image;
+use crate::ui::component::paginated::SinglePage;
+use crate::ui::component::text::paragraphs::{
+ Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs,
};
-
-use super::super::component::{fido_icons::get_fido_icon_data, theme};
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::{Insets, Offset, Rect};
+use crate::ui::shape::Renderer;
pub struct FidoCredential<F: Fn() -> TString<'static>> {
app_icon: Option<Image>,
diff --git a/core/embed/rust/src/ui/layout_delizia/component/footer.rs b/core/embed/rust/src/ui/layout_delizia/component/footer.rs
index 9016b479..78420912 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/footer.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/footer.rs
@@ -1,18 +1,15 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{text::TextStyle, Component, Event, EventCtx},
- display::{Color, Font},
- event::SwipeEvent,
- geometry::{Alignment, Alignment2D, Direction, Insets, Offset, Point, Rect},
- lerp::Lerp,
- shape::{self, Renderer, Text},
- util::Pager,
- CommonUI, ModelUI,
- },
-};
-
-use super::{super::fonts::FONT_SUB, theme, Button, ButtonMsg};
+use super::super::fonts::FONT_SUB;
+use super::{theme, Button, ButtonMsg};
+use crate::strutil::TString;
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::display::{Color, Font};
+use crate::ui::event::SwipeEvent;
+use crate::ui::geometry::{Alignment, Alignment2D, Direction, Insets, Offset, Point, Rect};
+use crate::ui::lerp::Lerp;
+use crate::ui::shape::{self, Renderer, Text};
+use crate::ui::util::Pager;
+use crate::ui::{CommonUI, ModelUI};
/// Component showing a task instruction, e.g. "Swipe up", and an optional
/// content consisting of one of these:
diff --git a/core/embed/rust/src/ui/layout_delizia/component/frame.rs b/core/embed/rust/src/ui/layout_delizia/component/frame.rs
index eda85833..2cb54f6f 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/frame.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/frame.rs
@@ -1,27 +1,18 @@
+use super::super::theme::TITLE_HEIGHT;
use super::{theme, Footer, Header};
-use crate::{
- strutil::TString,
- ui::{
- component::{
- base::AttachType,
- paginated::Paginate,
- swipe_detect::{SwipeConfig, SwipeSettings},
- Component,
- Event::{self, Swipe},
- EventCtx, FlowMsg, MsgMap, SwipeDetect,
- },
- event::SwipeEvent,
- geometry::{Direction, Insets, Point, Rect},
- lerp::Lerp,
- shape::{self, Renderer},
- },
-};
-
+use crate::strutil::TString;
+use crate::ui::component::base::AttachType;
+use crate::ui::component::paginated::Paginate;
+use crate::ui::component::swipe_detect::{SwipeConfig, SwipeSettings};
+use crate::ui::component::Event::{self, Swipe};
+use crate::ui::component::{Component, EventCtx, FlowMsg, MsgMap, SwipeDetect};
+use crate::ui::event::SwipeEvent;
+use crate::ui::geometry::{Direction, Insets, Point, Rect};
+use crate::ui::lerp::Lerp;
+use crate::ui::shape::{self, Renderer};
#[cfg(feature = "micropython")]
use crate::ui::util::Pager;
-use super::super::theme::TITLE_HEIGHT;
-
#[derive(Clone)]
pub struct HorizontalSwipe {
progress: i16,
diff --git a/core/embed/rust/src/ui/layout_delizia/component/header.rs b/core/embed/rust/src/ui/layout_delizia/component/header.rs
index 7536859d..4fb487e9 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/header.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/header.rs
@@ -1,20 +1,14 @@
-use crate::{
- strutil::TString,
- time::{Duration, Stopwatch},
- ui::{
- component::{text::TextStyle, Component, Event, EventCtx, FlowMsg, Label},
- display::{Color, Icon},
- geometry::{Alignment, Alignment2D, Insets, Offset, Rect},
- lerp::Lerp,
- shape::{self, Renderer},
- util::animation_disabled,
- },
-};
-
-use super::super::{
- component::{Button, ButtonMsg, ButtonStyleSheet},
- theme::{self, TITLE_HEIGHT},
-};
+use super::super::component::{Button, ButtonMsg, ButtonStyleSheet};
+use super::super::theme::{self, TITLE_HEIGHT};
+use crate::strutil::TString;
+use crate::time::{Duration, Stopwatch};
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{Component, Event, EventCtx, FlowMsg, Label};
+use crate::ui::display::{Color, Icon};
+use crate::ui::geometry::{Alignment, Alignment2D, Insets, Offset, Rect};
+use crate::ui::lerp::Lerp;
+use crate::ui::shape::{self, Renderer};
+use crate::ui::util::animation_disabled;
const ANIMATION_TIME_MS: u32 = 1000;
diff --git a/core/embed/rust/src/ui/layout_delizia/component/hold_to_confirm.rs b/core/embed/rust/src/ui/layout_delizia/component/hold_to_confirm.rs
index f1c5d3d0..d85b7729 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/hold_to_confirm.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/hold_to_confirm.rs
@@ -1,33 +1,19 @@
-use crate::{
- time::{Duration, ShortDuration},
- translations::TR,
- ui::{
- component::{Component, Event, EventCtx},
- display::Color,
- geometry::{Alignment2D, Offset, Rect},
- lerp::Lerp,
- shape,
- shape::Renderer,
- util::animation_disabled,
- },
-};
-
-use super::{
- theme::{self, TITLE_HEIGHT},
- Button, ButtonContent, ButtonMsg,
-};
+use pareen;
+use super::theme::{self, TITLE_HEIGHT};
+use super::{Button, ButtonContent, ButtonMsg};
+use crate::time::{Duration, ShortDuration, Stopwatch};
+use crate::translations::TR;
#[cfg(feature = "haptic")]
use crate::trezorhal::haptic::{self, HapticEffect};
-use crate::{
- time::Stopwatch,
- ui::{
- component::Label,
- constant::screen,
- geometry::{Alignment, Point},
- },
-};
-use pareen;
+use crate::ui::component::{Component, Event, EventCtx, Label};
+use crate::ui::constant::screen;
+use crate::ui::display::Color;
+use crate::ui::geometry::{Alignment, Alignment2D, Offset, Point, Rect};
+use crate::ui::lerp::Lerp;
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
+use crate::ui::util::animation_disabled;
#[derive(Default, Clone)]
struct HoldToConfirmAnim {
diff --git a/core/embed/rust/src/ui/layout_delizia/component/homescreen.rs b/core/embed/rust/src/ui/layout_delizia/component/homescreen.rs
index 5193f00c..3a9e2e3d 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/homescreen.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/homescreen.rs
@@ -1,41 +1,27 @@
+use super::super::cshape::{self, UnlockOverlay};
+use super::super::fonts;
+use super::theme::{self, GREY_LIGHT, HOMESCREEN_ICON, ICON_KEY};
+use super::{constant, Loader, LoaderMsg};
+use crate::error::Error;
+use crate::io::BinaryData;
+use crate::strutil::TString;
+use crate::time::{Duration, Instant, Stopwatch};
+use crate::translations::TR;
#[cfg(feature = "haptic")]
use crate::trezorhal::haptic::{play, HapticEffect};
-
-use crate::{
- error::Error,
- io::BinaryData,
- strutil::TString,
- time::{Duration, Instant, Stopwatch},
- translations::TR,
- trezorhal::usb::usb_configured,
- ui::{
- component::{Component, Event, EventCtx, Timer},
- display::{image::ImageInfo, Color},
- event::TouchEvent,
- geometry::{Alignment, Alignment2D, Insets, Offset, Point, Rect},
- layout::util::get_user_custom_image,
- notification::{Notification, NotificationLevel},
- shape::{self, Renderer},
- },
-};
-
-use crate::ui::{
- component::{base::AttachType, Label},
- constant::{screen, HEIGHT, WIDTH},
- lerp::Lerp,
- shape::{render_on_canvas, ImageBuffer, Rgb565Canvas},
- util::animation_disabled,
-};
-
-use super::{
- super::{
- cshape::{self, UnlockOverlay},
- fonts,
- },
- constant,
- theme::{self, GREY_LIGHT, HOMESCREEN_ICON, ICON_KEY},
- Loader, LoaderMsg,
-};
+use crate::trezorhal::usb::usb_configured;
+use crate::ui::component::base::AttachType;
+use crate::ui::component::{Component, Event, EventCtx, Label, Timer};
+use crate::ui::constant::{screen, HEIGHT, WIDTH};
+use crate::ui::display::image::ImageInfo;
+use crate::ui::display::Color;
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Alignment, Alignment2D, Insets, Offset, Point, Rect};
+use crate::ui::layout::util::get_user_custom_image;
+use crate::ui::lerp::Lerp;
+use crate::ui::notification::{Notification, NotificationLevel};
+use crate::ui::shape::{self, render_on_canvas, ImageBuffer, Renderer, Rgb565Canvas};
+use crate::ui::util::animation_disabled;
const AREA: Rect = constant::screen();
const AREA_TAP_TO_UNLOCK: Rect =
diff --git a/core/embed/rust/src/ui/layout_delizia/component/keyboard/bip39.rs b/core/embed/rust/src/ui/layout_delizia/component/keyboard/bip39.rs
index 5878951a..65b99ef2 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/keyboard/bip39.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/keyboard/bip39.rs
@@ -1,24 +1,18 @@
-use crate::{
- trezorhal::bip39,
- ui::{
- component::{text::common::TextBox, Component, Event, EventCtx},
- geometry::{Alignment, Alignment2D, Offset, Point, Rect},
- shape,
- shape::Renderer,
- },
+use super::super::super::component::keyboard::common::{
+ render_pending_marker, render_pill_shape, MultiTapKeyboard,
};
-
-use super::super::{
- super::component::{
- keyboard::{
- common::{render_pending_marker, render_pill_shape, MultiTapKeyboard},
- mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
- },
- Button, ButtonMsg,
- },
- constant::WIDTH,
- theme,
+use super::super::super::component::keyboard::mnemonic::{
+ MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT,
};
+use super::super::super::component::{Button, ButtonMsg};
+use super::super::constant::WIDTH;
+use super::super::theme;
+use crate::trezorhal::bip39;
+use crate::ui::component::text::common::TextBox;
+use crate::ui::component::{Component, Event, EventCtx};
+use crate::ui::geometry::{Alignment, Alignment2D, Offset, Point, Rect};
+use crate::ui::shape;
+use crate::ui::shape::Renderer;
const MAX_LENGTH: usize = 8;
diff --git a/core/embed/rust/src/ui/layout_delizia/component/keyboard/common.rs b/core/embed/rust/src/ui/layout_delizia/component/keyboard/common.rs
index deea3191..2d03fc45 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/keyboard/common.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/keyboard/common.rs
@@ -1,14 +1,10 @@
-use crate::{
- time::Duration,
- ui::{
- component::{text::common::TextEdit, Event, EventCtx, Timer},
- display::{Color, Font},
- geometry::{Alignment2D, Offset, Point, Rect},
- shape::{self, Renderer},
- },
-};
-
use super::super::ButtonStyle;
+use crate::time::Duration;
+use crate::ui::component::text::common::TextEdit;
+use crate::ui::component::{Event, EventCtx, Timer};
+use crate::ui::display::{Color, Font};
+use crate::ui::geometry::{Alignment2D, Offset, Point, Rect};
+use crate::ui::shape::{self, Renderer};
/// Contains state commonly used in implementations multi-tap keyboards.
pub struct MultiTapKeyboard {
diff --git a/core/embed/rust/src/ui/layout_delizia/component/keyboard/mnemonic.rs b/core/embed/rust/src/ui/layout_delizia/component/keyboard/mnemonic.rs
index 5a9d2b38..abe5ede8 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/keyboard/mnemonic.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/keyboard/mnemonic.rs
@@ -1,16 +1,9 @@
-use crate::{
- strutil::TString,
- ui::{
- component::{Component, Event, EventCtx, Label, Maybe},
- geometry::{Alignment, Grid, Insets, Rect},
- shape::Renderer,
- },
-};
-
-use super::super::super::{
- component::{Button, ButtonMsg},
- cshape, theme,
-};
+use super::super::super::component::{Button, ButtonMsg};
+use super::super::super::{cshape, theme};
+use crate::strutil::TString;
+use crate::ui::component::{Component, Event, EventCtx, Label, Maybe};
+use crate::ui::geometry::{Alignment, Grid, Insets, Rect};
+use crate::ui::shape::Renderer;
pub const MNEMONIC_KEY_COUNT: usize = 9;
const BACK_BUTTON_RIGHT_EXPAND: i16 = 24;
diff --git a/core/embed/rust/src/ui/layout_delizia/component/keyboard/passphrase.rs b/core/embed/rust/src/ui/layout_delizia/component/keyboard/passphrase.rs
index 42817c86..78667770 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/keyboard/passphrase.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/keyboard/passphrase.rs
@@ -1,38 +1,28 @@
-use crate::{
- strutil::{ShortString, TString},
- time::Duration,
- ui::{
- component::{
- base::ComponentExt,
- swipe_detect::SwipeConfig,
- text::{
- common::TextBox,
- layout::{LayoutFit, LineBreaking},
- TextStyle,
- },
- Component, Event, EventCtx, Label, Maybe, Never, Pad, Swipe, TextLayout, Timer,
- },
- display,
- event::TouchEvent,
- geometry::{Alignment, Alignment2D, Direction, Grid, Insets, Rect},
- shape::{Bar, Renderer, Text, ToifImage},
- util::{DisplayStyle, Pager},
- },
-};
-
-use super::super::super::{
- component::{
- button::{Button, ButtonContent, ButtonMsg},
- keyboard::common::{render_pending_marker, MultiTapKeyboard},
- theme,
- },
- constant::SCREEN,
- cshape,
-};
-
use core::cell::Cell;
+
use num_traits::ToPrimitive;
+use super::super::super::component::button::{Button, ButtonContent, ButtonMsg};
+use super::super::super::component::keyboard::common::{render_pending_marker, MultiTapKeyboard};
+use super::super::super::component::theme;
+use super::super::super::constant::SCREEN;
+use super::super::super::cshape;
+use crate::strutil::{ShortString, TString};
+use crate::time::Duration;
+use crate::ui::component::base::ComponentExt;
+use crate::ui::component::swipe_detect::SwipeConfig;
+use crate::ui::component::text::common::TextBox;
+use crate::ui::component::text::layout::{LayoutFit, LineBreaking};
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{
+ Component, Event, EventCtx, Label, Maybe, Never, Pad, Swipe, TextLayout, Timer,
+};
+use crate::ui::display;
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Alignment, Alignment2D, Direction, Grid, Insets, Rect};
+use crate::ui::shape::{Bar, Renderer, Text, ToifImage};
+use crate::ui::util::{DisplayStyle, Pager};
+
pub enum PassphraseKeyboardMsg {
Confirmed(ShortString),
Cancelled,
diff --git a/core/embed/rust/src/ui/layout_delizia/component/keyboard/pin.rs b/core/embed/rust/src/ui/layout_delizia/component/keyboard/pin.rs
index ca1f0ab1..7989cc4f 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/keyboard/pin.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/keyboard/pin.rs
@@ -1,33 +1,20 @@
use core::mem;
-use crate::{
- strutil::{ShortString, TString},
- time::{Duration, Stopwatch},
- trezorhal::random,
- ui::{
- component::{
- base::{AttachType, ComponentExt},
- text::TextStyle,
- Component, Event, EventCtx, Label, Never, Pad, Timer,
- },
- event::TouchEvent,
- geometry::{Alignment, Alignment2D, Direction, Grid, Insets, Offset, Rect},
- shape::{Bar, Renderer, Text, ToifImage},
- util::{animation_disabled, DisplayStyle},
- },
-};
-
-use super::super::super::{
- component::{
- button::{
- Button, ButtonContent,
- ButtonMsg::{self, Clicked},
- },
- theme,
- },
- cshape,
- fonts::FONT_MONO,
-};
+use super::super::super::component::button::ButtonMsg::{self, Clicked};
+use super::super::super::component::button::{Button, ButtonContent};
+use super::super::super::component::theme;
+use super::super::super::cshape;
+use super::super::super::fonts::FONT_MONO;
+use crate::strutil::{ShortString, TString};
+use crate::time::{Duration, Stopwatch};
+use crate::trezorhal::random;
+use crate::ui::component::base::{AttachType, ComponentExt};
+use crate::ui::component::text::TextStyle;
+use crate::ui::component::{Component, Event, EventCtx, Label, Never, Pad, Timer};
+use crate::ui::event::TouchEvent;
+use crate::ui::geometry::{Alignment, Alignment2D, Direction, Grid, Insets, Offset, Rect};
+use crate::ui::shape::{Bar, Renderer, Text, ToifImage};
+use crate::ui::util::{animation_disabled, DisplayStyle};
pub enum PinKeyboardMsg {
Confirmed,
diff --git a/core/embed/rust/src/ui/layout_delizia/component/keyboard/slip39.rs b/core/embed/rust/src/ui/layout_delizia/component/keyboard/slip39.rs
index bf596b67..ccf63f64 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/keyboard/slip39.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/keyboard/slip39.rs
@@ -1,30 +1,21 @@
use core::iter;
-use crate::{
- strutil::ShortString,
- trezorhal::slip39,
- ui::{
- component::{
- text::common::{TextBox, TextEdit},
- Component, Event, EventCtx,
- },
- constant::WIDTH,
- geometry::{Alignment, Alignment2D, Offset, Point, Rect},
- shape::{self, Renderer},
- util::ResultExt,
- },
+use super::super::super::component::keyboard::common::{
+ render_Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.