1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-18 19:31:04 +00:00

fix(core): fix button alignment in T3T1 bootloader

[no changelog]
This commit is contained in:
tychovrahe 2024-08-27 16:38:09 +02:00 committed by TychoVrahe
parent 4ac28e60f6
commit 384615c047
5 changed files with 28 additions and 12 deletions

View File

@ -8,7 +8,7 @@ CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
PRODUCTION = 0 if BOOTLOADER_QA else ARGUMENTS.get('PRODUCTION', '0') == '1'
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1'
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1' or TREZOR_MODEL in ('T3T1',)
if TREZOR_MODEL in ('1', ):
# skip bootloader build

View File

@ -6,7 +6,7 @@ import tools, models
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1'
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1' or TREZOR_MODEL in ('T3T1',)
if TREZOR_MODEL in ('1', 'DISC1', 'DISC2'):
# skip bootloader_ci build

View File

@ -6,7 +6,7 @@ import tools, models
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
HW_REVISION = 'emulator'
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1'
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1' or TREZOR_MODEL in ('T3T1',)
if TREZOR_MODEL in ('1', 'DISC1', 'DISC2'):
# skip bootloader build

View File

@ -44,7 +44,11 @@ impl<'a> Intro<'a> {
.styled(button_bld_menu())
.with_expanded_touch_area(Insets::uniform(13)),
),
host: Child::new(Button::with_text("INSTALL FIRMWARE".into()).styled(button_bld())),
host: Child::new(
Button::with_text("INSTALL FIRMWARE".into())
.styled(button_bld())
.with_text_align(Alignment::Center),
),
text: Child::new(Label::left_aligned(content, TEXT_NORMAL).vertically_centered()),
warn: (!fw_ok).then_some(Child::new(
Label::new("FIRMWARE CORRUPTED".into(), Alignment::Start, TEXT_WARNING)

View File

@ -5,7 +5,7 @@ use crate::{
ui::{
component::{connect::Connect, Label},
display::{self, Color, Font, Icon},
geometry::{Offset, Point, Rect},
geometry::{Alignment, Offset, Point, Rect},
layout::simplified::{run, show},
},
};
@ -37,7 +37,7 @@ use super::theme::BLACK;
#[cfg(feature = "new_rendering")]
use crate::ui::{
display::{toif::Toif, LOADER_MAX},
geometry::{Alignment, Alignment2D},
geometry::Alignment2D,
model_mercury::cshape::{render_loader, LoaderRange},
shape,
shape::render_on_display,
@ -258,12 +258,20 @@ impl UIFeaturesBootloader for ModelMercuryFeatures {
));
let (left, right) = if should_keep_seed {
let l = Button::with_text("CANCEL".into()).styled(button_bld());
let r = Button::with_text("INSTALL".into()).styled(button_confirm());
let l = Button::with_text("CANCEL".into())
.styled(button_bld())
.with_text_align(Alignment::Center);
let r = Button::with_text("INSTALL".into())
.styled(button_confirm())
.with_text_align(Alignment::Center);
(l, r)
} else {
let l = Button::with_icon(Icon::new(X24)).styled(button_bld());
let r = Button::with_icon(Icon::new(CHECK24)).styled(button_confirm());
let l = Button::with_icon(Icon::new(X24))
.styled(button_bld())
.with_text_align(Alignment::Center);
let r = Button::with_icon(Icon::new(CHECK24))
.styled(button_confirm())
.with_text_align(Alignment::Center);
(l, r)
};
@ -290,8 +298,12 @@ impl UIFeaturesBootloader for ModelMercuryFeatures {
);
let alert = Label::centered("SEED AND FIRMWARE\nWILL BE ERASED!".into(), TEXT_WIPE_BOLD);
let right = Button::with_text("RESET".into()).styled(button_wipe_confirm());
let left = Button::with_text("CANCEL".into()).styled(button_wipe_cancel());
let right = Button::with_text("RESET".into())
.styled(button_wipe_confirm())
.with_text_align(Alignment::Center);
let left = Button::with_text("CANCEL".into())
.styled(button_wipe_cancel())
.with_text_align(Alignment::Center);
let mut frame = Confirm::new(BLD_WIPE_COLOR, left, right, ConfirmTitle::Icon(icon), msg)
.with_alert(alert);