Skip to content

Commit 41995e6

Browse files
committed
Display the s_arrow properly
1 parent bc52315 commit 41995e6

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

ledger_device_sdk/src/ui/gadgets.rs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,9 @@ impl<'a> Field<'a> {
794794
loop {
795795
match get_event(&mut buttons) {
796796
Some(ButtonEvent::LeftButtonPress) => {
797-
LEFT_S_ARROW.instant_display();
797+
if (!is_first_field) {
798+
LEFT_S_ARROW.instant_display();
799+
}
798800
}
799801
Some(ButtonEvent::RightButtonPress) => {
800802
RIGHT_S_ARROW.instant_display();
@@ -933,7 +935,11 @@ impl<'a> MultiFieldReview<'a> {
933935
crate::ui::screen_util::screen_update();
934936
loop {
935937
match get_event(&mut buttons) {
938+
Some(ButtonEvent::LeftButtonPress) => {
939+
LEFT_S_ARROW.instant_display();
940+
}
936941
Some(ButtonEvent::LeftButtonRelease) => {
942+
LEFT_S_ARROW.erase();
937943
cur_page = cur_page.saturating_sub(1);
938944
break;
939945
}
@@ -951,7 +957,14 @@ impl<'a> MultiFieldReview<'a> {
951957
crate::ui::screen_util::screen_update();
952958
loop {
953959
match get_event(&mut buttons) {
960+
Some(ButtonEvent::LeftButtonPress) => {
961+
LEFT_S_ARROW.instant_display();
962+
}
963+
Some(ButtonEvent::RightButtonPress) => {
964+
RIGHT_S_ARROW.instant_display();
965+
}
954966
Some(ButtonEvent::LeftButtonRelease) => {
967+
LEFT_S_ARROW.erase();
955968
cur_page = cur_page.saturating_sub(1);
956969
if cur_page == 0 && self.fields.is_empty() {
957970
display_first_page(&first_page_opt);
@@ -961,6 +974,7 @@ impl<'a> MultiFieldReview<'a> {
961974
break;
962975
}
963976
Some(ButtonEvent::RightButtonRelease) => {
977+
RIGHT_S_ARROW.erase();
964978
cur_page += 1;
965979
break;
966980
}
@@ -1002,8 +1016,15 @@ fn display_first_page(page_opt: &Option<Page>) {
10021016

10031017
let mut buttons = ButtonsState::new();
10041018
loop {
1005-
if let Some(ButtonEvent::RightButtonRelease) = get_event(&mut buttons) {
1006-
return;
1019+
match get_event(&mut buttons) {
1020+
Some(ButtonEvent::RightButtonPress) => {
1021+
RIGHT_S_ARROW.instant_display();
1022+
}
1023+
Some(ButtonEvent::RightButtonRelease) => {
1024+
RIGHT_S_ARROW.erase();
1025+
return;
1026+
}
1027+
_ => (),
10071028
}
10081029
}
10091030
}

0 commit comments

Comments
 (0)