chore(core): support ICON_DOWN in also for confirm_with_info() in Bolt

[no changelog]
This commit is contained in:
Roman Zeyde
2026-02-12 12:56:08 +01:00
parent 553d33e5cc
commit 6ccb9a892f
2 changed files with 10 additions and 7 deletions

View File

@@ -411,6 +411,14 @@ impl Button {
Self::cancel_confirm(left, right, left_is_small)
}
pub fn with_text_or_icon_down(verb: TString<'static>) -> Self {
if verb.map(|v| v == "V") {
Button::with_icon(theme::ICON_DOWN)
} else {
Button::with_text(verb)
}
}
pub fn cancel_info_confirm(
confirm: Button,
verb_info: TString<'static>,
@@ -422,7 +430,7 @@ impl Button {
let right = confirm.map(|msg| {
(matches!(msg, ButtonMsg::Clicked)).then(|| CancelInfoConfirmMsg::Confirmed)
});
let top = Button::with_text(verb_info)
let top = Button::with_text_or_icon_down(verb_info)
.styled(theme::button_moreinfo())
.map(|msg| (matches!(msg, ButtonMsg::Clicked)).then(|| CancelInfoConfirmMsg::Info));
let left = Button::with_icon(theme::ICON_CANCEL).map(|msg| {

View File

@@ -513,12 +513,7 @@ impl FirmwareUI for UIBolt {
}
}
let confirm_button = if verb.map(|v| v == "V") {
Button::with_icon(theme::ICON_DOWN)
} else {
Button::with_text(verb)
}
.styled(theme::button_confirm());
let confirm_button = Button::with_text_or_icon_down(verb).styled(theme::button_confirm());
let buttons = Button::cancel_info_confirm(confirm_button, verb_info);