Skip to content

Commit 0e70a47

Browse files
committed
close button
1 parent 7412be9 commit 0e70a47

File tree

4 files changed

+10
-28
lines changed

4 files changed

+10
-28
lines changed

core/embed/rust/src/ui/layout_eckhart/flow/confirm_reset.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::{
1818
use super::super::{
1919
component::Button,
2020
firmware::{
21-
ActionBar, Header, HeaderMsg, Hint, ShortMenuVec, TextScreen, TextScreenMsg, VerticalMenu,
21+
ActionBar, Header, Hint, ShortMenuVec, TextScreen, TextScreenMsg, VerticalMenu,
2222
VerticalMenuScreen, VerticalMenuScreenMsg,
2323
},
2424
theme::{self, gradient::Gradient},
@@ -90,10 +90,7 @@ pub fn new_confirm_reset(recovery: bool) -> Result<SwipeFlow, error::Error> {
9090
let content_menu = VerticalMenuScreen::new(VerticalMenu::<ShortMenuVec>::empty().with_item(
9191
Button::new_menu_item(TR::buttons__cancel.into(), theme::menu_item_title_orange()),
9292
))
93-
.with_header(
94-
Header::new(title)
95-
.with_right_button(Button::with_icon(theme::ICON_CROSS), HeaderMsg::Cancelled),
96-
)
93+
.with_header(Header::new(title).with_close_button())
9794
.map(|msg| match msg {
9895
VerticalMenuScreenMsg::Selected(i) => Some(FlowMsg::Choice(i)),
9996
VerticalMenuScreenMsg::Close => Some(FlowMsg::Cancelled),

core/embed/rust/src/ui/layout_eckhart/flow/prompt_backup.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::{
1818
use super::super::{
1919
component::Button,
2020
firmware::{
21-
ActionBar, Header, HeaderMsg, Hint, ShortMenuVec, TextScreen, TextScreenMsg, VerticalMenu,
21+
ActionBar, Header, Hint, ShortMenuVec, TextScreen, TextScreenMsg, VerticalMenu,
2222
VerticalMenuScreen, VerticalMenuScreenMsg,
2323
},
2424
theme::{self, gradient::Gradient},
@@ -79,10 +79,7 @@ pub fn new_prompt_backup() -> Result<SwipeFlow, error::Error> {
7979
theme::menu_item_title_orange(),
8080
),
8181
))
82-
.with_header(
83-
Header::new(title)
84-
.with_right_button(Button::with_icon(theme::ICON_CROSS), HeaderMsg::Cancelled),
85-
)
82+
.with_header(Header::new(title).with_close_button())
8683
.map(|msg| match msg {
8784
VerticalMenuScreenMsg::Selected(i) => Some(FlowMsg::Choice(i)),
8885
VerticalMenuScreenMsg::Close => Some(FlowMsg::Cancelled),

core/embed/rust/src/ui/layout_eckhart/flow/receive.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use heapless::Vec;
2424
use super::super::{
2525
component::Button,
2626
firmware::{
27-
ActionBar, Header, HeaderMsg, Hint, QrScreen, ShortMenuVec, TextScreen, TextScreenMsg,
27+
ActionBar, Header, Hint, QrScreen, ShortMenuVec, TextScreen, TextScreenMsg,
2828
VerticalMenu, VerticalMenuScreen, VerticalMenuScreenMsg,
2929
},
3030
theme::{self, gradient::Gradient},
@@ -159,10 +159,7 @@ pub fn new_receive(
159159
theme::menu_item_title_orange(),
160160
)),
161161
)
162-
.with_header(
163-
Header::new(title)
164-
.with_right_button(Button::with_icon(theme::ICON_CROSS), HeaderMsg::Cancelled),
165-
)
162+
.with_header(Header::new(title).with_close_button())
166163
.map(|msg| match msg {
167164
VerticalMenuScreenMsg::Selected(i) => Some(FlowMsg::Choice(i)),
168165
VerticalMenuScreenMsg::Close => Some(FlowMsg::Cancelled),
@@ -171,10 +168,7 @@ pub fn new_receive(
171168

172169
// QrCode
173170
let content_qr = QrScreen::new(qr.map(|s| Qr::new(s, case_sensitive))?)
174-
.with_header(
175-
Header::new(title_qr.into())
176-
.with_right_button(Button::with_icon(theme::ICON_CROSS), HeaderMsg::Cancelled),
177-
)
171+
.with_header(Header::new(title_qr.into()).with_close_button())
178172
.map(|_| Some(FlowMsg::Cancelled));
179173

180174
// AccountInfo
@@ -218,10 +212,7 @@ pub fn new_receive(
218212
para.into_paragraphs()
219213
.with_placement(LinearPlacement::vertical()),
220214
)
221-
.with_header(
222-
Header::new(TR::address_details__account_info.into())
223-
.with_right_button(Button::with_icon(theme::ICON_CROSS), HeaderMsg::Cancelled),
224-
)
215+
.with_header(Header::new(TR::address_details__account_info.into()).with_close_button())
225216
.map(|_| Some(FlowMsg::Cancelled));
226217

227218
// Cancel

core/embed/rust/src/ui/layout_eckhart/flow/show_danger.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::{
1919
use super::super::{
2020
component::Button,
2121
firmware::{
22-
ActionBar, Header, HeaderMsg, ShortMenuVec, TextScreen, TextScreenMsg, VerticalMenu,
22+
ActionBar, Header, ShortMenuVec, TextScreen, TextScreenMsg, VerticalMenu,
2323
VerticalMenuScreen, VerticalMenuScreenMsg,
2424
},
2525
theme,
@@ -98,10 +98,7 @@ pub fn new_show_danger(
9898
theme::menu_item_title_orange(),
9999
)),
100100
)
101-
.with_header(
102-
Header::new(menu_title.unwrap_or("".into()))
103-
.with_right_button(Button::with_icon(theme::ICON_CROSS), HeaderMsg::Cancelled),
104-
)
101+
.with_header(Header::new(menu_title.unwrap_or(TString::empty())).with_close_button())
105102
.map(|msg| match msg {
106103
VerticalMenuScreenMsg::Selected(i) => Some(FlowMsg::Choice(i)),
107104
VerticalMenuScreenMsg::Close => Some(FlowMsg::Cancelled),

0 commit comments

Comments
 (0)