Skip to content

Commit c561c4a

Browse files
committed
run cargo fmt
1 parent cebfbb9 commit c561c4a

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

ledger_device_sdk/src/ui/gadgets.rs

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -538,35 +538,37 @@ impl<'a> MultiPageMenu<'a> {
538538

539539
loop {
540540
match self.comm.next_event() {
541-
io::Event::Button(button) => if UxEvent::Event.request() == BOLOS_UX_OK {
542-
match button {
543-
BothButtonsRelease => return EventOrPageIndex::Index(index),
544-
b => {
545-
match b {
546-
LeftButtonRelease => {
547-
if index as i16 - 1 < 0 {
548-
index = self.pages.len() - 1;
549-
} else {
550-
index = index.saturating_sub(1);
541+
io::Event::Button(button) => {
542+
if UxEvent::Event.request() == BOLOS_UX_OK {
543+
match button {
544+
BothButtonsRelease => return EventOrPageIndex::Index(index),
545+
b => {
546+
match b {
547+
LeftButtonRelease => {
548+
if index as i16 - 1 < 0 {
549+
index = self.pages.len() - 1;
550+
} else {
551+
index = index.saturating_sub(1);
552+
}
551553
}
552-
}
553-
RightButtonRelease => {
554-
if index < self.pages.len() - 1 {
555-
index += 1;
556-
} else {
557-
index = 0;
554+
RightButtonRelease => {
555+
if index < self.pages.len() - 1 {
556+
index += 1;
557+
} else {
558+
index = 0;
559+
}
558560
}
561+
_ => (),
559562
}
560-
_ => (),
563+
clear_screen();
564+
self.pages[index].place();
565+
LEFT_ARROW.display();
566+
RIGHT_ARROW.display();
567+
crate::ui::screen_util::screen_update();
561568
}
562-
clear_screen();
563-
self.pages[index].place();
564-
LEFT_ARROW.display();
565-
RIGHT_ARROW.display();
566-
crate::ui::screen_util::screen_update();
567569
}
568570
}
569-
},
571+
}
570572
io::Event::Command(ins) => return EventOrPageIndex::Event(io::Event::Command(ins)),
571573
io::Event::Ticker => {
572574
if UxEvent::Event.request() != BOLOS_UX_OK {

0 commit comments

Comments
 (0)