parent
887c877567
commit
771372adb2
@ -0,0 +1,16 @@
|
||||
from trezor import ui, loop, wire
|
||||
from trezor.utils import unimport_gen
|
||||
|
||||
def ord(n):
|
||||
return str(n)+("th" if 4<=n%100<=20 else {1:"st",2:"nd",3:"rd"}.get(n%10, "th"))
|
||||
|
||||
@unimport_gen
|
||||
def layout_recovery_device(message):
|
||||
|
||||
msg = 'Please enter ' + ord(message.word_count) + ' word'
|
||||
|
||||
ui.clear()
|
||||
ui.display.text(10, 30, 'Recovering device', ui.BOLD, ui.LIGHT_GREEN, ui.BLACK)
|
||||
ui.display.text(10, 74, msg, ui.BOLD, ui.WHITE, ui.BLACK)
|
||||
ui.display.text(10, 104, 'of your mnemonic.', ui.BOLD, ui.WHITE, ui.BLACK)
|
||||
yield from wire.read(None)
|
@ -0,0 +1,32 @@
|
||||
from . import display
|
||||
from trezor import ui, loop, res
|
||||
|
||||
|
||||
class Scroll():
|
||||
|
||||
def __init__(self, page=0, totale_lines=0, lines_per_page=4):
|
||||
self.page = page
|
||||
self.totale_lines = totale_lines
|
||||
self.lines_per_page = lines_per_page
|
||||
|
||||
def render(self):
|
||||
count = len(self.totale_lines) // self.lines_per_page
|
||||
padding = 20
|
||||
screen_height = const(220)
|
||||
cursor = 8
|
||||
|
||||
if count * padding > screen_height:
|
||||
padding = screen_height // count
|
||||
|
||||
x = 220
|
||||
y = (10 + (screen_height // 2)) - ((count // 2) * padding)
|
||||
|
||||
for i in range(0, count):
|
||||
if (i != self.page):
|
||||
ui.display.bar(x, y + i * padding, cursor, cursor, ui.GREY)
|
||||
ui.display.bar(x, y + self.page * padding, cursor, cursor, ui.WHITE)
|
||||
|
||||
def wait(self):
|
||||
while True:
|
||||
self.render()
|
||||
|
Loading…
Reference in new issue