File tree Expand file tree Collapse file tree 1 file changed +25
-23
lines changed Expand file tree Collapse file tree 1 file changed +25
-23
lines changed Original file line number Diff line number Diff line change @@ -538,35 +538,37 @@ impl<'a> MultiPageMenu<'a> {
538
538
539
539
loop {
540
540
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
+ }
551
553
}
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
+ }
558
560
}
561
+ _ => ( ) ,
559
562
}
560
- _ => ( ) ,
563
+ clear_screen ( ) ;
564
+ self . pages [ index] . place ( ) ;
565
+ LEFT_ARROW . display ( ) ;
566
+ RIGHT_ARROW . display ( ) ;
567
+ crate :: ui:: screen_util:: screen_update ( ) ;
561
568
}
562
- clear_screen ( ) ;
563
- self . pages [ index] . place ( ) ;
564
- LEFT_ARROW . display ( ) ;
565
- RIGHT_ARROW . display ( ) ;
566
- crate :: ui:: screen_util:: screen_update ( ) ;
567
569
}
568
570
}
569
- } ,
571
+ }
570
572
io:: Event :: Command ( ins) => return EventOrPageIndex :: Event ( io:: Event :: Command ( ins) ) ,
571
573
io:: Event :: Ticker => {
572
574
if UxEvent :: Event . request ( ) != BOLOS_UX_OK {
You can’t perform that action at this time.
0 commit comments