Skip to content

Commit

Permalink
Merge pull request #212 from Zondax/feat/zondax
Browse files Browse the repository at this point in the history
feat: add show_from function on multipage menu
  • Loading branch information
yogh333 authored Nov 4, 2024
2 parents 3de75ec + c0065ad commit 43494b8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ledger_device_sdk/src/ui/gadgets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,19 +554,26 @@ impl<'a> MultiPageMenu<'a> {
}

pub fn show<T: TryFrom<ApduHeader>>(&mut self) -> EventOrPageIndex<T>
where
Reply: From<<T as TryFrom<ApduHeader>>::Error>,
{
self.show_from(0)
}

pub fn show_from<T: TryFrom<ApduHeader>>(&mut self, page_index: usize) -> EventOrPageIndex<T>
where
Reply: From<<T as TryFrom<ApduHeader>>::Error>,
{
clear_screen();

self.pages[0].place();
self.pages[page_index].place();

LEFT_ARROW.display();
RIGHT_ARROW.display();

crate::ui::screen_util::screen_update();

let mut index = 0;
let mut index = page_index;

loop {
match self.comm.next_event() {
Expand Down

0 comments on commit 43494b8

Please sign in to comment.