mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-10 15:30:55 +00:00
refactor(core): consistent naming of UI layouts
- UI layouts name changes: - model_tt -> layout_bolt - model_tr -> layout_samson - model_mercury -> layout_quicksilver - rust features `model_xyz` freed for different use, now it's `layout_xyz` - input_flow function names are based on UI layout and not internal model name (i.e. quicksilver instead of t3t1) - directory names and commentary changed accordingly [no changelog]
This commit is contained in:
parent
367ba7cd5c
commit
862c987779
@ -40,7 +40,7 @@ message DebugLinkDecision {
|
||||
}
|
||||
|
||||
/**
|
||||
* Structure representing model R button presses
|
||||
* Structure representing button presses of UI samson
|
||||
*/
|
||||
// TODO: probably delete the middle_btn as it is not a physical one
|
||||
enum DebugPhysicalButton {
|
||||
|
@ -53,23 +53,23 @@ OPENOCD_TRANSPORT ?= hla_swd
|
||||
ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T))
|
||||
MCU = STM32F4
|
||||
OPENOCD_TARGET = target/stm32f4x.cfg
|
||||
MODEL_FEATURE = model_tt
|
||||
LAYOUT_FEATURE = layout_bolt
|
||||
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),R))
|
||||
MCU = STM32F4
|
||||
OPENOCD_TARGET = target/stm32f4x.cfg
|
||||
MODEL_FEATURE = model_tr
|
||||
LAYOUT_FEATURE = layout_samson
|
||||
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T3T1))
|
||||
MCU = STM32U5
|
||||
OPENOCD_TARGET = target/stm32u5x.cfg
|
||||
MODEL_FEATURE = model_mercury
|
||||
LAYOUT_FEATURE = layout_quicksilver
|
||||
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T3B1))
|
||||
MCU = STM32U5
|
||||
OPENOCD_TARGET = target/stm32u5x.cfg
|
||||
MODEL_FEATURE = model_tr
|
||||
LAYOUT_FEATURE = layout_samson
|
||||
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T3W1))
|
||||
MCU = STM32U5
|
||||
OPENOCD_TARGET = target/stm32u5x.cfg
|
||||
MODEL_FEATURE = model_tt
|
||||
LAYOUT_FEATURE = layout_bolt
|
||||
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),DISC1))
|
||||
MCU = STM32F4
|
||||
OPENOCD_TARGET = target/stm32f4x.cfg
|
||||
@ -188,7 +188,7 @@ test: ## run unit tests
|
||||
test_rust: ## run rs unit tests
|
||||
export BUILD_DIR=$(abspath $(UNIX_BUILD_DIR)) ; \
|
||||
cd embed/rust ; cargo test $(TESTOPTS) --target=$(RUST_TARGET) \
|
||||
--no-default-features --features $(MODEL_FEATURE),test \
|
||||
--no-default-features --features $(LAYOUT_FEATURE),test \
|
||||
-- --test-threads=1 --nocapture
|
||||
|
||||
test_emu: ## run selected device tests from python-trezor
|
||||
|
@ -6,11 +6,11 @@ edition = "2021"
|
||||
build = "build.rs"
|
||||
|
||||
[features]
|
||||
default = ["model_tt"]
|
||||
default = ["layout_bolt"]
|
||||
crypto = ["zeroize"]
|
||||
model_tt = ["jpeg"]
|
||||
model_tr = []
|
||||
model_mercury = ["jpeg", "dma2d"]
|
||||
layout_bolt = ["jpeg"]
|
||||
layout_samson = []
|
||||
layout_quicksilver = ["jpeg", "dma2d"]
|
||||
micropython = []
|
||||
protobuf = ["micropython"]
|
||||
ui = []
|
||||
|
@ -53,7 +53,7 @@ const DEFAULT_BINDGEN_MACROS_COMMON: &[&str] = &[
|
||||
"-DUSE_RGB_LED",
|
||||
];
|
||||
|
||||
#[cfg(feature = "model_tt")]
|
||||
#[cfg(feature = "layout_bolt")]
|
||||
const DEFAULT_BINDGEN_MACROS_T2T1: &[&str] = &[
|
||||
"-DSTM32F427",
|
||||
"-DTREZOR_MODEL_T",
|
||||
@ -63,10 +63,10 @@ const DEFAULT_BINDGEN_MACROS_T2T1: &[&str] = &[
|
||||
"-DDISPLAY_RESY=240",
|
||||
"-DTREZOR_BOARD=\"T2T1/boards/t2t1-unix.h\"",
|
||||
];
|
||||
#[cfg(not(feature = "model_tt"))]
|
||||
#[cfg(not(feature = "layout_bolt"))]
|
||||
const DEFAULT_BINDGEN_MACROS_T2T1: &[&str] = &[];
|
||||
|
||||
#[cfg(feature = "model_tr")]
|
||||
#[cfg(feature = "layout_samson")]
|
||||
const DEFAULT_BINDGEN_MACROS_T2B1: &[&str] = &[
|
||||
"-DSTM32F427",
|
||||
"-DTREZOR_MODEL_R",
|
||||
@ -76,10 +76,10 @@ const DEFAULT_BINDGEN_MACROS_T2B1: &[&str] = &[
|
||||
"-DDISPLAY_RESY=64",
|
||||
"-DTREZOR_BOARD=\"T2B1/boards/t2b1-unix.h\"",
|
||||
];
|
||||
#[cfg(not(feature = "model_tr"))]
|
||||
#[cfg(not(feature = "layout_samson"))]
|
||||
const DEFAULT_BINDGEN_MACROS_T2B1: &[&str] = &[];
|
||||
|
||||
#[cfg(feature = "model_mercury")]
|
||||
#[cfg(feature = "layout_quicksilver")]
|
||||
const DEFAULT_BINDGEN_MACROS_T3T1: &[&str] = &[
|
||||
"-DSTM32U5",
|
||||
"-DTREZOR_MODEL_T3T1",
|
||||
@ -89,7 +89,7 @@ const DEFAULT_BINDGEN_MACROS_T3T1: &[&str] = &[
|
||||
"-DDISPLAY_RESY=240",
|
||||
"-DTREZOR_BOARD=\"T3T1/boards/t3t1-unix.h\"",
|
||||
];
|
||||
#[cfg(not(feature = "model_mercury"))]
|
||||
#[cfg(not(feature = "layout_quicksilver"))]
|
||||
const DEFAULT_BINDGEN_MACROS_T3T1: &[&str] = &[];
|
||||
|
||||
fn add_bindgen_macros<'a>(clang_args: &mut Vec<&'a str>, envvar: Option<&'a str>) {
|
||||
|
@ -648,7 +648,7 @@ static void _librust_qstrs(void) {
|
||||
MP_QSTR_show_progress_coinjoin;
|
||||
MP_QSTR_show_remaining_shares;
|
||||
MP_QSTR_show_share_words;
|
||||
MP_QSTR_show_share_words_mercury;
|
||||
MP_QSTR_show_share_words_quicksilver;
|
||||
MP_QSTR_show_simple;
|
||||
MP_QSTR_show_success;
|
||||
MP_QSTR_show_wait_text;
|
||||
|
@ -927,7 +927,7 @@ extern "C" fn new_show_share_words(n_args: usize, args: *const Obj, kwargs: *mut
|
||||
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
||||
}
|
||||
|
||||
extern "C" fn new_show_share_words_mercury(
|
||||
extern "C" fn new_show_share_words_quicksilver(
|
||||
n_args: usize,
|
||||
args: *const Obj,
|
||||
kwargs: *mut Map,
|
||||
@ -947,7 +947,7 @@ extern "C" fn new_show_share_words_mercury(
|
||||
|
||||
let words: Vec<TString, 33> = util::iter_into_vec(words)?;
|
||||
|
||||
let layout = ModelUI::show_share_words_mercury(
|
||||
let layout = ModelUI::show_share_words_quicksilver(
|
||||
words,
|
||||
subtitle,
|
||||
instructions,
|
||||
@ -1280,7 +1280,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
|
||||
/// items: Iterable[tuple[int, str | bytes]],
|
||||
/// ) -> LayoutObj[UiResult]:
|
||||
/// """Confirm long content with the possibility to go back from any page.
|
||||
/// Meant to be used with confirm_with_info on model TT and TR."""
|
||||
/// Meant to be used with confirm_with_info on UI bolt and samson."""
|
||||
Qstr::MP_QSTR_confirm_more => obj_fn_kw!(0, new_confirm_more).as_obj(),
|
||||
|
||||
/// def confirm_properties(
|
||||
@ -1338,7 +1338,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
|
||||
/// items: Iterable[tuple[int, str | bytes]],
|
||||
/// ) -> LayoutObj[UiResult]:
|
||||
/// """Confirm given items but with third button. Always single page
|
||||
/// without scrolling. In mercury, the button is placed in
|
||||
/// without scrolling. In Quicksilver, the button is placed in
|
||||
/// context menu."""
|
||||
Qstr::MP_QSTR_confirm_with_info => obj_fn_kw!(0, new_confirm_with_info).as_obj(),
|
||||
|
||||
@ -1348,7 +1348,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
|
||||
/// subtext: str | None,
|
||||
/// button: str | None,
|
||||
/// recovery_type: RecoveryType,
|
||||
/// show_instructions: bool = False, # unused on TT
|
||||
/// show_instructions: bool = False, # unused on bolt
|
||||
/// remaining_shares: Iterable[tuple[str, str]] | None = None,
|
||||
/// ) -> LayoutObj[UiResult]:
|
||||
/// """Device recovery homescreen."""
|
||||
@ -1378,7 +1378,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
|
||||
/// """Confirm the recipient, (optionally) confirm the amount and (optionally) confirm the summary and present a Hold to Sign page."""
|
||||
Qstr::MP_QSTR_flow_confirm_output => obj_fn_kw!(0, new_flow_confirm_output).as_obj(),
|
||||
|
||||
// TODO: supply more arguments for Wipe code setting (mercury)
|
||||
// TODO: supply more arguments for Wipe code setting (quicksilver)
|
||||
///
|
||||
/// def flow_confirm_set_new_pin(
|
||||
/// *,
|
||||
@ -1625,7 +1625,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
|
||||
/// """Show mnemonic for backup."""
|
||||
Qstr::MP_QSTR_show_share_words => obj_fn_kw!(0, new_show_share_words).as_obj(),
|
||||
|
||||
/// def show_share_words_mercury(
|
||||
/// def show_share_words_quicksilver(
|
||||
/// *,
|
||||
/// words: Iterable[str],
|
||||
/// subtitle: str | None,
|
||||
@ -1635,7 +1635,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
|
||||
/// ) -> LayoutObj[UiResult]:
|
||||
/// """Show mnemonic for wallet backup preceded by an instruction screen and followed by a
|
||||
/// confirmation screen."""
|
||||
Qstr::MP_QSTR_show_share_words_mercury => obj_fn_kw!(0, new_show_share_words_mercury).as_obj(),
|
||||
Qstr::MP_QSTR_show_share_words_quicksilver => obj_fn_kw!(0, new_show_share_words_quicksilver).as_obj(),
|
||||
|
||||
/// def show_simple(
|
||||
/// *,
|
||||
@ -1668,9 +1668,9 @@ pub static mp_module_trezorui_api: Module = obj_module! {
|
||||
/// value: str = "",
|
||||
/// description: str = "",
|
||||
/// allow_cancel: bool = True,
|
||||
/// danger: bool = False, # unused on TT
|
||||
/// danger: bool = False, # unused on bolt
|
||||
/// ) -> LayoutObj[UiResult]:
|
||||
/// """Warning modal. TT: No buttons shown when `button` is empty string. TR: middle button and centered text."""
|
||||
/// """Warning modal. bolt: No buttons shown when `button` is empty string. samson: middle button and centered text."""
|
||||
Qstr::MP_QSTR_show_warning => obj_fn_kw!(0, new_show_warning).as_obj(),
|
||||
|
||||
/// def tutorial() -> LayoutObj[UiResult]:
|
||||
|
@ -2,12 +2,12 @@
|
||||
//! current feature (Trezor model)
|
||||
|
||||
#[cfg(all(
|
||||
feature = "model_mercury",
|
||||
not(feature = "model_tr"),
|
||||
not(feature = "model_tt")
|
||||
feature = "layout_bolt",
|
||||
not(feature = "layout_quicksilver"),
|
||||
not(feature = "layout_samson")
|
||||
))]
|
||||
pub use super::model_mercury::constant::*;
|
||||
#[cfg(all(feature = "model_tr", not(feature = "model_tt")))]
|
||||
pub use super::model_tr::constant::*;
|
||||
#[cfg(feature = "model_tt")]
|
||||
pub use super::model_tt::constant::*;
|
||||
pub use super::layout_bolt::constant::*;
|
||||
#[cfg(all(feature = "layout_quicksilver", not(feature = "layout_bolt")))]
|
||||
pub use super::layout_quicksilver::constant::*;
|
||||
#[cfg(feature = "layout_samson")]
|
||||
pub use super::layout_samson::constant::*;
|
||||
|
@ -5,7 +5,7 @@ use crate::{
|
||||
constant::screen,
|
||||
display::Icon,
|
||||
geometry::{Alignment, Insets, Point, Rect},
|
||||
model_tt::{
|
||||
layout_bolt::{
|
||||
component::{Button, ButtonMsg::Clicked},
|
||||
constant::WIDTH,
|
||||
theme::bootloader::{
|
@ -5,7 +5,7 @@ use crate::{
|
||||
constant::{screen, WIDTH},
|
||||
display::Icon,
|
||||
geometry::{Insets, Point, Rect},
|
||||
model_tt::{
|
||||
layout_bolt::{
|
||||
component::{Button, ButtonMsg::Clicked, IconText},
|
||||
theme::bootloader::{
|
||||
button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_HEIGHT, CONTENT_PADDING,
|
@ -26,7 +26,7 @@ use super::{
|
||||
},
|
||||
FG,
|
||||
},
|
||||
UIModelTT,
|
||||
UIBolt,
|
||||
};
|
||||
|
||||
use crate::ui::{ui_bootloader::BootloaderUI, CommonUI};
|
||||
@ -56,9 +56,9 @@ pub type BootloaderString = String<128>;
|
||||
|
||||
const RECONNECT_MESSAGE: &str = "PLEASE RECONNECT\nTHE DEVICE";
|
||||
|
||||
const SCREEN: Rect = UIModelTT::SCREEN;
|
||||
const SCREEN: Rect = UIBolt::SCREEN;
|
||||
|
||||
impl UIModelTT {
|
||||
impl UIBolt {
|
||||
fn screen_progress(
|
||||
text: &str,
|
||||
progress: u16,
|
||||
@ -133,7 +133,7 @@ impl UIModelTT {
|
||||
}
|
||||
}
|
||||
|
||||
impl BootloaderUI for UIModelTT {
|
||||
impl BootloaderUI for UIBolt {
|
||||
fn screen_welcome() {
|
||||
let mut frame = Welcome::new();
|
||||
show(&mut frame, true);
|
@ -3,7 +3,7 @@ use crate::ui::{
|
||||
constant::screen,
|
||||
display::{toif::Toif, Font},
|
||||
geometry::{Alignment, Alignment2D, Offset, Rect},
|
||||
model_tt::theme::{
|
||||
layout_bolt::theme::{
|
||||
bootloader::{START_URL, WELCOME_COLOR},
|
||||
GREY_MEDIUM, WHITE,
|
||||
},
|
@ -6,7 +6,7 @@ use crate::{
|
||||
constant::screen,
|
||||
display::{Color, Icon},
|
||||
geometry::{Alignment2D, Insets, Offset, Point, Rect},
|
||||
model_tt::{
|
||||
layout_bolt::{
|
||||
component::{Button, ButtonMsg::Clicked, ButtonStyleSheet},
|
||||
constant::WIDTH,
|
||||
theme::{
|
@ -9,7 +9,7 @@ use crate::{
|
||||
},
|
||||
};
|
||||
|
||||
use crate::ui::model_tt::{
|
||||
use crate::ui::layout_bolt::{
|
||||
component::{ResultFooter, ResultStyle},
|
||||
constant::WIDTH,
|
||||
theme::{FATAL_ERROR_COLOR, ICON_WARNING40, RESULT_FOOTER_START, RESULT_PADDING, WHITE},
|
||||
@ -20,7 +20,7 @@ const TITLE_AREA_START: i16 = 70;
|
||||
const MESSAGE_AREA_START: i16 = 116;
|
||||
|
||||
#[cfg(feature = "bootloader")]
|
||||
const STYLE: &ResultStyle = &crate::ui::model_tt::theme::bootloader::RESULT_WIPE;
|
||||
const STYLE: &ResultStyle = &crate::ui::layout_bolt::theme::bootloader::RESULT_WIPE;
|
||||
#[cfg(not(feature = "bootloader"))]
|
||||
const STYLE: &ResultStyle = &super::theme::RESULT_ERROR;
|
||||
|
@ -4,7 +4,7 @@ use crate::{
|
||||
component::{image::Image, Child, Component, Event, EventCtx, Label},
|
||||
display,
|
||||
geometry::{Insets, Rect},
|
||||
model_tt::component::{
|
||||
layout_bolt::component::{
|
||||
fido_icons::get_fido_icon_data,
|
||||
swipe::{Swipe, SwipeDirection},
|
||||
theme, ScrollBar,
|
84
core/embed/rust/src/ui/layout_bolt/component/fido_icons.rs
Normal file
84
core/embed/rust/src/ui/layout_bolt/component/fido_icons.rs
Normal file
@ -0,0 +1,84 @@
|
||||
//! generated from webauthn_icons.rs.mako
|
||||
//! (by running `make templates` in `core`)
|
||||
//! do not edit manually!
|
||||
|
||||
|
||||
use crate::strutil::TString;
|
||||
use crate::ui::util::include_res;
|
||||
|
||||
|
||||
const ICON_APPLE: &[u8] = include_res!("layout_bolt/res/fido/icon_apple.toif");
|
||||
const ICON_AWS: &[u8] = include_res!("layout_bolt/res/fido/icon_aws.toif");
|
||||
const ICON_BINANCE: &[u8] = include_res!("layout_bolt/res/fido/icon_binance.toif");
|
||||
const ICON_BITBUCKET: &[u8] = include_res!("layout_bolt/res/fido/icon_bitbucket.toif");
|
||||
const ICON_BITFINEX: &[u8] = include_res!("layout_bolt/res/fido/icon_bitfinex.toif");
|
||||
const ICON_BITWARDEN: &[u8] = include_res!("layout_bolt/res/fido/icon_bitwarden.toif");
|
||||
const ICON_CLOUDFLARE: &[u8] = include_res!("layout_bolt/res/fido/icon_cloudflare.toif");
|
||||
const ICON_COINBASE: &[u8] = include_res!("layout_bolt/res/fido/icon_coinbase.toif");
|
||||
const ICON_DASHLANE: &[u8] = include_res!("layout_bolt/res/fido/icon_dashlane.toif");
|
||||
const ICON_DROPBOX: &[u8] = include_res!("layout_bolt/res/fido/icon_dropbox.toif");
|
||||
const ICON_DUO: &[u8] = include_res!("layout_bolt/res/fido/icon_duo.toif");
|
||||
const ICON_FACEBOOK: &[u8] = include_res!("layout_bolt/res/fido/icon_facebook.toif");
|
||||
const ICON_FASTMAIL: &[u8] = include_res!("layout_bolt/res/fido/icon_fastmail.toif");
|
||||
const ICON_FEDORA: &[u8] = include_res!("layout_bolt/res/fido/icon_fedora.toif");
|
||||
const ICON_GANDI: &[u8] = include_res!("layout_bolt/res/fido/icon_gandi.toif");
|
||||
const ICON_GEMINI: &[u8] = include_res!("layout_bolt/res/fido/icon_gemini.toif");
|
||||
const ICON_GITHUB: &[u8] = include_res!("layout_bolt/res/fido/icon_github.toif");
|
||||
const ICON_GITLAB: &[u8] = include_res!("layout_bolt/res/fido/icon_gitlab.toif");
|
||||
const ICON_GOOGLE: &[u8] = include_res!("layout_bolt/res/fido/icon_google.toif");
|
||||
const ICON_INVITY: &[u8] = include_res!("layout_bolt/res/fido/icon_invity.toif");
|
||||
const ICON_KEEPER: &[u8] = include_res!("layout_bolt/res/fido/icon_keeper.toif");
|
||||
const ICON_KRAKEN: &[u8] = include_res!("layout_bolt/res/fido/icon_kraken.toif");
|
||||
const ICON_LOGIN_GOV: &[u8] = include_res!("layout_bolt/res/fido/icon_login.gov.toif");
|
||||
const ICON_MICROSOFT: &[u8] = include_res!("layout_bolt/res/fido/icon_microsoft.toif");
|
||||
const ICON_MOJEID: &[u8] = include_res!("layout_bolt/res/fido/icon_mojeid.toif");
|
||||
const ICON_NAMECHEAP: &[u8] = include_res!("layout_bolt/res/fido/icon_namecheap.toif");
|
||||
const ICON_PROTON: &[u8] = include_res!("layout_bolt/res/fido/icon_proton.toif");
|
||||
const ICON_SLUSHPOOL: &[u8] = include_res!("layout_bolt/res/fido/icon_slushpool.toif");
|
||||
const ICON_STRIPE: &[u8] = include_res!("layout_bolt/res/fido/icon_stripe.toif");
|
||||
const ICON_TUTANOTA: &[u8] = include_res!("layout_bolt/res/fido/icon_tutanota.toif");
|
||||
/// Default icon when app does not have its own
|
||||
const ICON_WEBAUTHN: &[u8] = include_res!("layout_bolt/res/fido/icon_webauthn.toif");
|
||||
|
||||
/// Translates icon name into its data.
|
||||
/// Returns default `ICON_WEBAUTHN` when the icon is not found or name not
|
||||
/// supplied.
|
||||
pub fn get_fido_icon_data(icon_name: Option<TString<'static>>) -> &'static [u8] {
|
||||
if let Some(icon_name) = icon_name {
|
||||
icon_name.map(|c| match c {
|
||||
"apple" => ICON_APPLE,
|
||||
"aws" => ICON_AWS,
|
||||
"binance" => ICON_BINANCE,
|
||||
"bitbucket" => ICON_BITBUCKET,
|
||||
"bitfinex" => ICON_BITFINEX,
|
||||
"bitwarden" => ICON_BITWARDEN,
|
||||
"cloudflare" => ICON_CLOUDFLARE,
|
||||
"coinbase" => ICON_COINBASE,
|
||||
"dashlane" => ICON_DASHLANE,
|
||||
"dropbox" => ICON_DROPBOX,
|
||||
"duo" => ICON_DUO,
|
||||
"facebook" => ICON_FACEBOOK,
|
||||
"fastmail" => ICON_FASTMAIL,
|
||||
"fedora" => ICON_FEDORA,
|
||||
"gandi" => ICON_GANDI,
|
||||
"gemini" => ICON_GEMINI,
|
||||
"github" => ICON_GITHUB,
|
||||
"gitlab" => ICON_GITLAB,
|
||||
"google" => ICON_GOOGLE,
|
||||
"invity" => ICON_INVITY,
|
||||
"keeper" => ICON_KEEPER,
|
||||
"kraken" => ICON_KRAKEN,
|
||||
"login.gov" => ICON_LOGIN_GOV,
|
||||
"microsoft" => ICON_MICROSOFT,
|
||||
"mojeid" => ICON_MOJEID,
|
||||
"namecheap" => ICON_NAMECHEAP,
|
||||
"proton" => ICON_PROTON,
|
||||
"slushpool" => ICON_SLUSHPOOL,
|
||||
"stripe" => ICON_STRIPE,
|
||||
"tutanota" => ICON_TUTANOTA,
|
||||
_ => ICON_WEBAUTHN,
|
||||
})
|
||||
} else {
|
||||
ICON_WEBAUTHN
|
||||
}
|
||||
}
|
@ -17,10 +17,10 @@ for app in fido:
|
||||
%>\
|
||||
|
||||
% for icon_name, var_name in icons:
|
||||
const ICON_${var_name}: &[u8] = include_res!("model_tt/res/fido/icon_${icon_name}.toif");
|
||||
const ICON_${var_name}: &[u8] = include_res!("layout_bolt/res/fido/icon_${icon_name}.toif");
|
||||
% endfor
|
||||
/// Default icon when app does not have its own
|
||||
const ICON_WEBAUTHN: &[u8] = include_res!("model_tt/res/fido/icon_webauthn.toif");
|
||||
const ICON_WEBAUTHN: &[u8] = include_res!("layout_bolt/res/fido/icon_webauthn.toif");
|
||||
|
||||
/// Translates icon name into its data.
|
||||
/// Returns default `ICON_WEBAUTHN` when the icon is not found or name not
|
@ -7,7 +7,7 @@ use crate::{
|
||||
},
|
||||
display::Icon,
|
||||
geometry::{Alignment, Insets, Offset, Rect},
|
||||
model_tt::component::{Button, ButtonMsg, CancelInfoConfirmMsg},
|
||||
layout_bolt::component::{Button, ButtonMsg, CancelInfoConfirmMsg},
|
||||
shape::Renderer,
|
||||
},
|
||||
};
|
@ -14,7 +14,7 @@ use crate::{
|
||||
event::{TouchEvent, USBEvent},
|
||||
geometry::{Alignment, Alignment2D, Insets, Offset, Point, Rect},
|
||||
layout::util::get_user_custom_image,
|
||||
model_tt::{constant, theme::IMAGE_HOMESCREEN},
|
||||
layout_bolt::{constant, theme::IMAGE_HOMESCREEN},
|
||||
shape::{self, Renderer},
|
||||
},
|
||||
};
|
@ -3,7 +3,7 @@ use crate::{
|
||||
ui::{
|
||||
component::{text::common::TextBox, Component, Event, EventCtx},
|
||||
geometry::{Alignment2D, Offset, Rect},
|
||||
model_tt::{
|
||||
layout_bolt::{
|
||||
component::{
|
||||
keyboard::{
|
||||
common::{render_pending_marker, MultiTapKeyboard},
|
@ -3,7 +3,7 @@ use crate::{
|
||||
ui::{
|
||||
component::{Child, Component, Event, EventCtx, Label, Maybe},
|
||||
geometry::{Alignment2D, Grid, Offset, Rect},
|
||||
model_tt::{
|
||||
layout_bolt::{
|
||||
component::{Button, ButtonMsg, Swipe, SwipeDirection},
|
||||
theme,
|
||||
},
|
@ -6,7 +6,7 @@ use crate::{
|
||||
},
|
||||
display,
|
||||
geometry::{Grid, Offset, Rect},
|
||||
model_tt::component::{
|
||||
layout_bolt::component::{
|
||||
button::{Button, ButtonContent, ButtonMsg},
|
||||
keyboard::common::{render_pending_marker, MultiTapKeyboard},
|
||||
swipe::{Swipe, SwipeDirection},
|
@ -12,7 +12,7 @@ use crate::{
|
||||
display::Font,
|
||||
event::TouchEvent,
|
||||
geometry::{Alignment, Alignment2D, Grid, Insets, Offset, Rect},
|
||||
model_tt::component::{
|
||||
layout_bolt::component::{
|
||||
button::{
|
||||
Button, ButtonContent,
|
||||
ButtonMsg::{self, Clicked},
|
@ -9,7 +9,7 @@ use crate::{
|
||||
Component, Event, EventCtx,
|
||||
},
|
||||
geometry::{Alignment2D, Offset, Rect},
|
||||
model_tt::{
|
||||
layout_bolt::{
|
||||
component::{
|
||||
keyboard::{
|
||||
common::{render_pending_marker, MultiTapKeyboard},
|
@ -1,7 +1,7 @@
|
||||
use crate::ui::{
|
||||
component::{Component, Event, EventCtx},
|
||||
geometry::{Grid, GridCellSpan, Rect},
|
||||
model_tt::{
|
||||
layout_bolt::{
|
||||
component::button::{Button, ButtonMsg},
|
||||
theme,
|
||||
},
|
@ -11,7 +11,7 @@ use crate::{
|
||||
component::{Component, Event, EventCtx, Pad},
|
||||
display::{self, toif::Icon, Color, LOADER_MAX},
|
||||
geometry::{Alignment2D, Offset, Rect},
|
||||
model_tt::constant,
|
||||
layout_bolt::constant,
|
||||
shape::{self, Renderer},
|
||||
util::animation_disabled,
|
||||
},
|
@ -487,7 +487,7 @@ mod tests {
|
||||
component::text::paragraphs::{Paragraph, Paragraphs},
|
||||
event::TouchEvent,
|
||||
geometry::Point,
|
||||
model_tt::constant,
|
||||
layout_bolt::constant,
|
||||
},
|
||||
};
|
||||
|
@ -15,7 +15,7 @@ use crate::{
|
||||
},
|
||||
display::{Font, LOADER_MAX},
|
||||
geometry::{Insets, Offset, Rect},
|
||||
model_tt::constant,
|
||||
layout_bolt::constant,
|
||||
shape::Renderer,
|
||||
util::animation_disabled,
|
||||
},
|
@ -5,13 +5,13 @@ use crate::{
|
||||
constant::screen,
|
||||
display::{Color, Font, Icon},
|
||||
geometry::{Alignment2D, Insets, Offset, Point, Rect},
|
||||
model_tt::theme::FG,
|
||||
layout_bolt::theme::FG,
|
||||
shape,
|
||||
shape::Renderer,
|
||||
},
|
||||
};
|
||||
|
||||
use crate::ui::model_tt::{
|
||||
use crate::ui::layout_bolt::{
|
||||
constant::WIDTH,
|
||||
theme::{RESULT_FOOTER_START, RESULT_PADDING},
|
||||
};
|
@ -4,7 +4,7 @@ use crate::{
|
||||
component::{Component, Event, EventCtx, Never, Paginate},
|
||||
display::Font,
|
||||
geometry::{Offset, Rect},
|
||||
model_tt::theme,
|
||||
layout_bolt::theme,
|
||||
shape::{self, Renderer},
|
||||
},
|
||||
};
|
@ -3,7 +3,7 @@ use crate::ui::{
|
||||
display,
|
||||
event::TouchEvent,
|
||||
geometry::{Point, Rect},
|
||||
model_tt::theme::backlight,
|
||||
layout_bolt::theme::backlight,
|
||||
shape::Renderer,
|
||||
};
|
||||
|
@ -1,12 +1,12 @@
|
||||
use crate::ui::{
|
||||
component::{Component, Event, EventCtx, Never},
|
||||
geometry::{Alignment2D, Offset, Rect},
|
||||
model_tt::theme,
|
||||
layout_bolt::theme,
|
||||
shape,
|
||||
shape::Renderer,
|
||||
};
|
||||
#[cfg(feature = "bootloader")]
|
||||
use crate::ui::{display::toif::Toif, model_tt::theme::bootloader::DEVICE_NAME};
|
||||
use crate::ui::{display::toif::Toif, layout_bolt::theme::bootloader::DEVICE_NAME};
|
||||
|
||||
const TEXT_BOTTOM_MARGIN: i16 = 24; // matching the homescreen label margin
|
||||
const ICON_TOP_MARGIN: i16 = 48;
|
@ -7,7 +7,7 @@ pub mod constant;
|
||||
pub mod theme;
|
||||
|
||||
#[cfg(feature = "backlight")]
|
||||
use crate::ui::model_tt::theme::backlight;
|
||||
use crate::ui::layout_bolt::theme::backlight;
|
||||
|
||||
#[cfg(feature = "micropython")]
|
||||
pub mod component_msg_obj;
|
||||
@ -15,15 +15,15 @@ pub mod cshape;
|
||||
|
||||
use crate::ui::{
|
||||
layout::simplified::show,
|
||||
model_tt::component::{ErrorScreen, WelcomeScreen},
|
||||
layout_bolt::component::{ErrorScreen, WelcomeScreen},
|
||||
};
|
||||
|
||||
pub struct UIModelTT;
|
||||
pub struct UIBolt;
|
||||
|
||||
#[cfg(feature = "micropython")]
|
||||
pub mod ui_firmware;
|
||||
|
||||
impl CommonUI for UIModelTT {
|
||||
impl CommonUI for UIBolt {
|
||||
#[cfg(feature = "backlight")]
|
||||
fn fadein() {
|
||||
crate::ui::display::fade_backlight_duration(backlight::get_backlight_normal(), 150);
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user