mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-06-17 21:48:47 +00:00
chore(eckhart): use dedicated function for menu buttons creation
This commit is contained in:
parent
11fb6f3e90
commit
48ae2bad26
@ -15,7 +15,7 @@ use crate::{
|
|||||||
base::{Decision, DecisionBuilder as _},
|
base::{Decision, DecisionBuilder as _},
|
||||||
FlowController, FlowMsg, SwipeFlow,
|
FlowController, FlowMsg, SwipeFlow,
|
||||||
},
|
},
|
||||||
geometry::{Alignment, Direction, LinearPlacement, Offset},
|
geometry::{Direction, LinearPlacement},
|
||||||
layout::util::StrOrBytes,
|
layout::util::StrOrBytes,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -218,29 +218,23 @@ fn content_main_menu(
|
|||||||
let mut main_menu = VerticalMenu::<ShortMenuVec>::empty();
|
let mut main_menu = VerticalMenu::<ShortMenuVec>::empty();
|
||||||
let mut main_menu_items = Vec::<usize, 3>::new();
|
let mut main_menu_items = Vec::<usize, 3>::new();
|
||||||
if address_params {
|
if address_params {
|
||||||
main_menu.item(
|
main_menu.item(Button::new_menu_item(
|
||||||
Button::with_text(address_title)
|
address_title,
|
||||||
.styled(theme::menu_item_title())
|
theme::menu_item_title(),
|
||||||
.with_text_align(Alignment::Start)
|
));
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
unwrap!(main_menu_items.push(MENU_ITEM_ADDRESS_INFO));
|
unwrap!(main_menu_items.push(MENU_ITEM_ADDRESS_INFO));
|
||||||
}
|
}
|
||||||
if account_params {
|
if account_params {
|
||||||
main_menu.item(
|
main_menu.item(Button::new_menu_item(
|
||||||
Button::with_text(TR::address_details__account_info.into())
|
TR::address_details__account_info.into(),
|
||||||
.styled(theme::menu_item_title())
|
theme::menu_item_title(),
|
||||||
.with_text_align(Alignment::Start)
|
));
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
unwrap!(main_menu_items.push(MENU_ITEM_ACCOUNT_INFO));
|
unwrap!(main_menu_items.push(MENU_ITEM_ACCOUNT_INFO));
|
||||||
}
|
}
|
||||||
main_menu.item(
|
main_menu.item(Button::new_menu_item(
|
||||||
Button::with_text(cancel_menu_label)
|
cancel_menu_label,
|
||||||
.styled(theme::menu_item_title_orange())
|
theme::menu_item_title_orange(),
|
||||||
.with_text_align(Alignment::Start)
|
));
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
unwrap!(main_menu_items.push(MENU_ITEM_CANCEL));
|
unwrap!(main_menu_items.push(MENU_ITEM_CANCEL));
|
||||||
|
|
||||||
VerticalMenuScreen::<ShortMenuVec>::new(main_menu)
|
VerticalMenuScreen::<ShortMenuVec>::new(main_menu)
|
||||||
@ -436,29 +430,23 @@ pub fn new_confirm_output(
|
|||||||
let mut summary_menu_items = Vec::<usize, 3>::new();
|
let mut summary_menu_items = Vec::<usize, 3>::new();
|
||||||
|
|
||||||
if extra_menu_item {
|
if extra_menu_item {
|
||||||
summary_menu.item(
|
summary_menu.item(Button::new_menu_item(
|
||||||
Button::with_text(extra_title.unwrap_or(TString::empty()))
|
extra_title.unwrap_or(TString::empty()),
|
||||||
.styled(theme::menu_item_title())
|
theme::menu_item_title(),
|
||||||
.with_text_align(Alignment::Start)
|
));
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
unwrap!(summary_menu_items.push(MENU_ITEM_EXTRA_INFO));
|
unwrap!(summary_menu_items.push(MENU_ITEM_EXTRA_INFO));
|
||||||
}
|
}
|
||||||
if fee_menu_item {
|
if fee_menu_item {
|
||||||
summary_menu.item(
|
summary_menu.item(Button::new_menu_item(
|
||||||
Button::with_text(TR::confirm_total__title_fee.into())
|
TR::confirm_total__title_fee.into(),
|
||||||
.styled(theme::menu_item_title())
|
theme::menu_item_title(),
|
||||||
.with_text_align(Alignment::Start)
|
));
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
unwrap!(summary_menu_items.push(MENU_ITEM_FEE_INFO));
|
unwrap!(summary_menu_items.push(MENU_ITEM_FEE_INFO));
|
||||||
}
|
}
|
||||||
summary_menu.item(
|
summary_menu.item(Button::new_menu_item(
|
||||||
Button::with_text(cancel_menu_label)
|
cancel_menu_label,
|
||||||
.styled(theme::menu_item_title_orange())
|
theme::menu_item_title_orange(),
|
||||||
.with_text_align(Alignment::Start)
|
));
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
unwrap!(summary_menu_items.push(MENU_ITEM_CANCEL));
|
unwrap!(summary_menu_items.push(MENU_ITEM_CANCEL));
|
||||||
let content_summary_menu = VerticalMenuScreen::new(summary_menu)
|
let content_summary_menu = VerticalMenuScreen::new(summary_menu)
|
||||||
.with_header(Header::new(TString::empty()).with_close_button())
|
.with_header(Header::new(TString::empty()).with_close_button())
|
||||||
|
@ -8,7 +8,7 @@ use crate::{
|
|||||||
base::{Decision, DecisionBuilder as _},
|
base::{Decision, DecisionBuilder as _},
|
||||||
FlowController, FlowMsg, SwipeFlow,
|
FlowController, FlowMsg, SwipeFlow,
|
||||||
},
|
},
|
||||||
geometry::{Alignment, Direction, Offset},
|
geometry::{Alignment, Direction},
|
||||||
layout_eckhart::{component::Button, firmware::ShortMenuVec},
|
layout_eckhart::{component::Button, firmware::ShortMenuVec},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -83,14 +83,9 @@ pub fn new_confirm_reset(recovery: bool) -> Result<SwipeFlow, error::Error> {
|
|||||||
})
|
})
|
||||||
.one_button_request(br);
|
.one_button_request(br);
|
||||||
|
|
||||||
let content_menu = VerticalMenuScreen::new(
|
let content_menu = VerticalMenuScreen::new(VerticalMenu::<ShortMenuVec>::empty().with_item(
|
||||||
VerticalMenu::<ShortMenuVec>::empty().with_item(
|
Button::new_menu_item(TR::buttons__cancel.into(), theme::menu_item_title_orange()),
|
||||||
Button::with_text(TR::buttons__cancel.into())
|
))
|
||||||
.styled(theme::menu_item_title_orange())
|
|
||||||
.with_text_align(Alignment::Start)
|
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.with_header(
|
.with_header(
|
||||||
Header::new(title)
|
Header::new(title)
|
||||||
.with_right_button(Button::with_icon(theme::ICON_CROSS), HeaderMsg::Cancelled),
|
.with_right_button(Button::with_icon(theme::ICON_CROSS), HeaderMsg::Cancelled),
|
||||||
|
@ -13,7 +13,7 @@ use crate::{
|
|||||||
base::{Decision, DecisionBuilder as _},
|
base::{Decision, DecisionBuilder as _},
|
||||||
FlowController, FlowMsg, SwipeFlow,
|
FlowController, FlowMsg, SwipeFlow,
|
||||||
},
|
},
|
||||||
geometry::{Alignment, Direction, LinearPlacement, Offset},
|
geometry::{Direction, LinearPlacement},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -135,29 +135,23 @@ pub fn new_confirm_summary(
|
|||||||
let mut menu_items = Vec::<usize, 3>::new();
|
let mut menu_items = Vec::<usize, 3>::new();
|
||||||
|
|
||||||
if account_paragraphs.is_some() {
|
if account_paragraphs.is_some() {
|
||||||
menu.item(
|
menu.item(Button::new_menu_item(
|
||||||
Button::with_text(TR::address_details__account_info.into())
|
TR::address_details__account_info.into(),
|
||||||
.styled(theme::menu_item_title())
|
theme::menu_item_title(),
|
||||||
.with_text_align(Alignment::Start)
|
));
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
unwrap!(menu_items.push(MENU_ITEM_ACCOUNT_INFO));
|
unwrap!(menu_items.push(MENU_ITEM_ACCOUNT_INFO));
|
||||||
}
|
}
|
||||||
if extra_paragraphs.is_some() {
|
if extra_paragraphs.is_some() {
|
||||||
menu.item(
|
menu.item(Button::new_menu_item(
|
||||||
Button::with_text(extra_title.unwrap_or(TR::buttons__more_info.into()))
|
extra_title.unwrap_or(TR::buttons__more_info.into()),
|
||||||
.styled(theme::menu_item_title())
|
theme::menu_item_title(),
|
||||||
.with_text_align(Alignment::Start)
|
));
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
unwrap!(menu_items.push(MENU_ITEM_EXTRA_INFO));
|
unwrap!(menu_items.push(MENU_ITEM_EXTRA_INFO));
|
||||||
}
|
}
|
||||||
menu.item(
|
menu.item(Button::new_menu_item(
|
||||||
Button::with_text(verb_cancel.unwrap_or(TR::buttons__cancel.into()))
|
verb_cancel.unwrap_or(TR::buttons__cancel.into()),
|
||||||
.styled(theme::menu_item_title_orange())
|
theme::menu_item_title_orange(),
|
||||||
.with_text_align(Alignment::Start)
|
));
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
unwrap!(menu_items.push(MENU_ITEM_CANCEL));
|
unwrap!(menu_items.push(MENU_ITEM_CANCEL));
|
||||||
let content_menu = VerticalMenuScreen::new(menu)
|
let content_menu = VerticalMenuScreen::new(menu)
|
||||||
.with_header(Header::new(title).with_close_button())
|
.with_header(Header::new(title).with_close_button())
|
||||||
|
@ -12,7 +12,7 @@ use crate::{
|
|||||||
base::{Decision, DecisionBuilder as _},
|
base::{Decision, DecisionBuilder as _},
|
||||||
FlowController, FlowMsg, SwipeFlow,
|
FlowController, FlowMsg, SwipeFlow,
|
||||||
},
|
},
|
||||||
geometry::{Alignment, Direction, LinearPlacement, Offset},
|
geometry::{Direction, LinearPlacement},
|
||||||
layout::util::StrOrBytes,
|
layout::util::StrOrBytes,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -105,18 +105,14 @@ pub fn new_confirm_value_intro(
|
|||||||
});
|
});
|
||||||
|
|
||||||
let menu_items = VerticalMenu::<ShortMenuVec>::empty()
|
let menu_items = VerticalMenu::<ShortMenuVec>::empty()
|
||||||
.with_item(
|
.with_item(Button::new_menu_item(
|
||||||
Button::with_text(value_menu_label)
|
value_menu_label,
|
||||||
.styled(theme::menu_item_title())
|
theme::menu_item_title(),
|
||||||
.with_text_align(Alignment::Start)
|
))
|
||||||
.with_content_offset(Offset::x(12)),
|
.with_item(Button::new_menu_item(
|
||||||
)
|
cancel_menu_label,
|
||||||
.with_item(
|
theme::menu_item_title_orange(),
|
||||||
Button::with_text(cancel_menu_label)
|
));
|
||||||
.styled(theme::menu_item_title_orange())
|
|
||||||
.with_text_align(Alignment::Start)
|
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
|
|
||||||
let content_menu = VerticalMenuScreen::new(menu_items)
|
let content_menu = VerticalMenuScreen::new(menu_items)
|
||||||
.with_header(Header::new(TString::empty()).with_close_button())
|
.with_header(Header::new(TString::empty()).with_close_button())
|
||||||
|
@ -9,7 +9,7 @@ use crate::{
|
|||||||
base::{Decision, DecisionBuilder as _},
|
base::{Decision, DecisionBuilder as _},
|
||||||
FlowController, FlowMsg, SwipeFlow,
|
FlowController, FlowMsg, SwipeFlow,
|
||||||
},
|
},
|
||||||
geometry::{Alignment, Direction, Offset},
|
geometry::Direction,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -83,20 +83,16 @@ pub fn new_confirm_with_menu<T: AllowedTextContent + MaybeTrace + 'static>(
|
|||||||
let mut menu_items = VerticalMenu::<ShortMenuVec>::empty();
|
let mut menu_items = VerticalMenu::<ShortMenuVec>::empty();
|
||||||
|
|
||||||
if let Some(extra_menu_label) = extra_menu_label {
|
if let Some(extra_menu_label) = extra_menu_label {
|
||||||
menu_items.item(
|
menu_items.item(Button::new_menu_item(
|
||||||
Button::with_text(extra_menu_label)
|
extra_menu_label,
|
||||||
.styled(theme::menu_item_title())
|
theme::menu_item_title(),
|
||||||
.with_text_align(Alignment::Start)
|
));
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_items.item(
|
menu_items.item(Button::new_menu_item(
|
||||||
Button::with_text(cancel_menu_label)
|
cancel_menu_label,
|
||||||
.styled(theme::menu_item_title_orange())
|
theme::menu_item_title_orange(),
|
||||||
.with_text_align(Alignment::Start)
|
));
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
|
|
||||||
let content_menu = VerticalMenuScreen::new(menu_items)
|
let content_menu = VerticalMenuScreen::new(menu_items)
|
||||||
.with_header(Header::new(TString::empty()).with_close_button())
|
.with_header(Header::new(TString::empty()).with_close_button())
|
||||||
|
@ -15,7 +15,7 @@ use crate::{
|
|||||||
base::{Decision, DecisionBuilder as _},
|
base::{Decision, DecisionBuilder as _},
|
||||||
FlowController, FlowMsg, SwipeFlow,
|
FlowController, FlowMsg, SwipeFlow,
|
||||||
},
|
},
|
||||||
geometry::{Alignment, Direction, LinearPlacement, Offset},
|
geometry::{Direction, LinearPlacement},
|
||||||
layout::util::RecoveryType,
|
layout::util::RecoveryType,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -207,14 +207,10 @@ pub fn new_continue_recovery_homepage(
|
|||||||
));
|
));
|
||||||
|
|
||||||
let res = if show_instructions {
|
let res = if show_instructions {
|
||||||
let content_menu = VerticalMenuScreen::new(
|
let content_menu =
|
||||||
VerticalMenu::<ShortMenuVec>::empty().with_item(
|
VerticalMenuScreen::new(VerticalMenu::<ShortMenuVec>::empty().with_item(
|
||||||
Button::with_text(cancel_btn.into())
|
Button::new_menu_item(cancel_btn.into(), theme::menu_item_title_orange()),
|
||||||
.styled(theme::menu_item_title_orange())
|
))
|
||||||
.with_text_align(Alignment::Start)
|
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.with_header(Header::new(TString::empty()).with_close_button())
|
.with_header(Header::new(TString::empty()).with_close_button())
|
||||||
.map(|msg| match msg {
|
.map(|msg| match msg {
|
||||||
VerticalMenuScreenMsg::Selected(i) => Some(FlowMsg::Choice(i)),
|
VerticalMenuScreenMsg::Selected(i) => Some(FlowMsg::Choice(i)),
|
||||||
@ -229,22 +225,16 @@ pub fn new_continue_recovery_homepage(
|
|||||||
} else if pages.is_none() {
|
} else if pages.is_none() {
|
||||||
let content_menu = VerticalMenuScreen::new(
|
let content_menu = VerticalMenuScreen::new(
|
||||||
VerticalMenu::<ShortMenuVec>::empty()
|
VerticalMenu::<ShortMenuVec>::empty()
|
||||||
.with_item(
|
.with_item(Button::new_menu_item_with_subtext(
|
||||||
Button::with_text_and_subtext(
|
|
||||||
TR::words__recovery_share.into(),
|
TR::words__recovery_share.into(),
|
||||||
|
theme::menu_item_title(),
|
||||||
TR::buttons__more_info.into(),
|
TR::buttons__more_info.into(),
|
||||||
None,
|
None,
|
||||||
)
|
))
|
||||||
.styled(theme::menu_item_title())
|
.with_item(Button::new_menu_item(
|
||||||
.with_text_align(Alignment::Start)
|
cancel_btn.into(),
|
||||||
.with_content_offset(Offset::x(12)),
|
theme::menu_item_title_orange(),
|
||||||
)
|
)),
|
||||||
.with_item(
|
|
||||||
Button::with_text(cancel_btn.into())
|
|
||||||
.styled(theme::menu_item_title_orange())
|
|
||||||
.with_text_align(Alignment::Start)
|
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.with_header(Header::new(TR::recovery__title.into()).with_close_button())
|
.with_header(Header::new(TR::recovery__title.into()).with_close_button())
|
||||||
.map(|msg| match msg {
|
.map(|msg| match msg {
|
||||||
@ -281,18 +271,14 @@ pub fn new_continue_recovery_homepage(
|
|||||||
} else {
|
} else {
|
||||||
let content_menu = VerticalMenuScreen::new(
|
let content_menu = VerticalMenuScreen::new(
|
||||||
VerticalMenu::<ShortMenuVec>::empty()
|
VerticalMenu::<ShortMenuVec>::empty()
|
||||||
.with_item(
|
.with_item(Button::new_menu_item(
|
||||||
Button::with_text(TR::recovery__title_remaining_shares.into())
|
TR::recovery__title_remaining_shares.into(),
|
||||||
.styled(theme::menu_item_title())
|
theme::menu_item_title(),
|
||||||
.with_text_align(Alignment::Start)
|
))
|
||||||
.with_content_offset(Offset::x(12)),
|
.with_item(Button::new_menu_item(
|
||||||
)
|
cancel_btn.into(),
|
||||||
.with_item(
|
theme::menu_item_title_orange(),
|
||||||
Button::with_text(cancel_btn.into())
|
)),
|
||||||
.styled(theme::menu_item_title_orange())
|
|
||||||
.with_text_align(Alignment::Start)
|
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.with_header(Header::new(TString::empty()).with_close_button())
|
.with_header(Header::new(TString::empty()).with_close_button())
|
||||||
.map(|msg| match msg {
|
.map(|msg| match msg {
|
||||||
|
@ -13,7 +13,7 @@ use crate::{
|
|||||||
base::{Decision, DecisionBuilder as _},
|
base::{Decision, DecisionBuilder as _},
|
||||||
FlowController, FlowMsg, SwipeFlow,
|
FlowController, FlowMsg, SwipeFlow,
|
||||||
},
|
},
|
||||||
geometry::{Alignment, Direction, LinearPlacement, Offset},
|
geometry::{Direction, LinearPlacement},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use heapless::Vec;
|
use heapless::Vec;
|
||||||
@ -135,24 +135,18 @@ pub fn new_get_address(
|
|||||||
|
|
||||||
let content_menu = VerticalMenuScreen::new(
|
let content_menu = VerticalMenuScreen::new(
|
||||||
VerticalMenu::<ShortMenuVec>::empty()
|
VerticalMenu::<ShortMenuVec>::empty()
|
||||||
.with_item(
|
.with_item(Button::new_menu_item(
|
||||||
Button::with_text(TR::address__qr_code.into())
|
TR::address__qr_code.into(),
|
||||||
.styled(theme::menu_item_title())
|
theme::menu_item_title(),
|
||||||
.with_text_align(Alignment::Start)
|
))
|
||||||
.with_content_offset(Offset::x(12)),
|
.with_item(Button::new_menu_item(
|
||||||
)
|
TR::address_details__account_info.into(),
|
||||||
.with_item(
|
theme::menu_item_title(),
|
||||||
Button::with_text(TR::address_details__account_info.into())
|
))
|
||||||
.styled(theme::menu_item_title())
|
.with_item(Button::new_menu_item(
|
||||||
.with_text_align(Alignment::Start)
|
TR::buttons__cancel.into(),
|
||||||
.with_content_offset(Offset::x(12)),
|
theme::menu_item_title_orange(),
|
||||||
)
|
)),
|
||||||
.with_item(
|
|
||||||
Button::with_text(TR::buttons__cancel.into())
|
|
||||||
.styled(theme::menu_item_title_orange())
|
|
||||||
.with_text_align(Alignment::Start)
|
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.with_header(
|
.with_header(
|
||||||
Header::new(flow_title)
|
Header::new(flow_title)
|
||||||
|
@ -11,7 +11,7 @@ use crate::{
|
|||||||
base::{Decision, DecisionBuilder as _},
|
base::{Decision, DecisionBuilder as _},
|
||||||
FlowController, FlowMsg, SwipeFlow,
|
FlowController, FlowMsg, SwipeFlow,
|
||||||
},
|
},
|
||||||
geometry::{Alignment, Direction, LinearPlacement, Offset},
|
geometry::{Direction, LinearPlacement},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -72,14 +72,12 @@ pub fn new_prompt_backup() -> Result<SwipeFlow, error::Error> {
|
|||||||
_ => None,
|
_ => None,
|
||||||
});
|
});
|
||||||
|
|
||||||
let content_menu = VerticalMenuScreen::new(
|
let content_menu = VerticalMenuScreen::new(VerticalMenu::<ShortMenuVec>::empty().with_item(
|
||||||
VerticalMenu::<ShortMenuVec>::empty().with_item(
|
Button::new_menu_item(
|
||||||
Button::with_text(TR::backup__title_skip.into())
|
TR::backup__title_skip.into(),
|
||||||
.styled(theme::menu_item_title_orange())
|
theme::menu_item_title_orange(),
|
||||||
.with_text_align(Alignment::Start)
|
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
),
|
),
|
||||||
)
|
))
|
||||||
.with_header(
|
.with_header(
|
||||||
Header::new(title)
|
Header::new(title)
|
||||||
.with_right_button(Button::with_icon(theme::ICON_CROSS), HeaderMsg::Cancelled),
|
.with_right_button(Button::with_icon(theme::ICON_CROSS), HeaderMsg::Cancelled),
|
||||||
|
@ -8,7 +8,7 @@ use crate::{
|
|||||||
base::{Decision, DecisionBuilder as _},
|
base::{Decision, DecisionBuilder as _},
|
||||||
FlowController, FlowMsg, SwipeFlow,
|
FlowController, FlowMsg, SwipeFlow,
|
||||||
},
|
},
|
||||||
geometry::{Alignment, Direction, Offset},
|
geometry::Direction,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -88,18 +88,14 @@ pub fn new_request_number(
|
|||||||
});
|
});
|
||||||
|
|
||||||
let menu_items = VerticalMenu::<ShortMenuVec>::empty()
|
let menu_items = VerticalMenu::<ShortMenuVec>::empty()
|
||||||
.with_item(
|
.with_item(Button::new_menu_item(
|
||||||
Button::with_text(TR::buttons__more_info.into())
|
TR::buttons__more_info.into(),
|
||||||
.styled(theme::menu_item_title())
|
theme::menu_item_title(),
|
||||||
.with_text_align(Alignment::Start)
|
))
|
||||||
.with_content_offset(Offset::x(12)),
|
.with_item(Button::new_menu_item(
|
||||||
)
|
TR::buttons__cancel.into(),
|
||||||
.with_item(
|
theme::menu_item_title_orange(),
|
||||||
Button::with_text(TR::buttons__cancel.into())
|
));
|
||||||
.styled(theme::menu_item_title_orange())
|
|
||||||
.with_text_align(Alignment::Start)
|
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
);
|
|
||||||
|
|
||||||
let content_menu = VerticalMenuScreen::new(menu_items)
|
let content_menu = VerticalMenuScreen::new(menu_items)
|
||||||
.with_header(Header::new(TString::empty()).with_close_button())
|
.with_header(Header::new(TString::empty()).with_close_button())
|
||||||
|
@ -11,7 +11,7 @@ use crate::{
|
|||||||
base::{Decision, DecisionBuilder as _},
|
base::{Decision, DecisionBuilder as _},
|
||||||
FlowController, FlowMsg, SwipeFlow,
|
FlowController, FlowMsg, SwipeFlow,
|
||||||
},
|
},
|
||||||
geometry::{Alignment, Direction, LinearPlacement, Offset},
|
geometry::{Direction, LinearPlacement},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -91,18 +91,11 @@ pub fn new_show_danger(
|
|||||||
let content_menu = VerticalMenuScreen::new(
|
let content_menu = VerticalMenuScreen::new(
|
||||||
VerticalMenu::<ShortMenuVec>::empty()
|
VerticalMenu::<ShortMenuVec>::empty()
|
||||||
.with_separators()
|
.with_separators()
|
||||||
.with_item(
|
.with_item(Button::new_menu_item(verb_cancel, theme::menu_item_title()))
|
||||||
Button::with_text(verb_cancel)
|
.with_item(Button::new_menu_item(
|
||||||
.styled(theme::menu_item_title())
|
TR::words__continue_anyway.into(),
|
||||||
.with_text_align(Alignment::Start)
|
theme::menu_item_title_orange(),
|
||||||
.with_content_offset(Offset::x(12)),
|
)),
|
||||||
)
|
|
||||||
.with_item(
|
|
||||||
Button::with_text(TR::words__continue_anyway.into())
|
|
||||||
.styled(theme::menu_item_title_orange())
|
|
||||||
.with_text_align(Alignment::Start)
|
|
||||||
.with_content_offset(Offset::x(12)),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.with_header(
|
.with_header(
|
||||||
Header::new(menu_title.unwrap_or("".into()))
|
Header::new(menu_title.unwrap_or("".into()))
|
||||||
|
Loading…
Reference in New Issue
Block a user