1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-08-02 20:08:31 +00:00

chore(core/eckhart): Update ConfirmAction button styling logic

This commit is contained in:
Lukas Bielesch 2025-06-02 11:26:16 +02:00 committed by Lukáš Bielesch
parent 1f69975ba9
commit 41a852c675
2 changed files with 12 additions and 6 deletions

View File

@ -76,11 +76,16 @@ impl FirmwareUI for UIEckhart {
)
};
let verb = verb.unwrap_or(TR::buttons__confirm.into());
let mut right_button = Button::with_text(verb).styled(theme::firmware::button_confirm());
if hold {
right_button = right_button.with_long_press(theme::CONFIRM_HOLD_DURATION);
}
let right_button = if hold {
let verb = verb.unwrap_or(TR::buttons__hold_to_confirm.into());
Button::with_text(verb)
.with_long_press(theme::CONFIRM_HOLD_DURATION)
.styled(theme::firmware::button_confirm())
} else if let Some(verb) = verb {
Button::with_text(verb)
} else {
Button::with_text(TR::buttons__confirm.into()).styled(theme::firmware::button_confirm())
};
let mut screen = TextScreen::new(paragraphs)
.with_header(Header::new(title))

View File

@ -633,6 +633,7 @@ def confirm_value(
info_title: str | None = None,
chunkify_info: bool = False,
warning_footer: str | None = None,
cancel: bool = False,
) -> Awaitable[None]:
"""General confirmation dialog, used by many other confirm_* functions."""
@ -655,7 +656,7 @@ def confirm_value(
hold=hold,
chunkify=chunkify,
warning_footer=warning_footer,
cancel=False,
cancel=cancel,
),
info_layout,
br_name,