1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-25 17:09:44 +00:00

limit pin length

This commit is contained in:
chren 2016-09-27 16:43:32 +02:00 committed by Pavol Rusnak
parent fe4e024088
commit 69fa5acf8b
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -35,7 +35,7 @@ class PinMatrix():
header = '*' * len(self.pin) if self.pin else self.label
# clear canvas under input line
display.bar(48, 0, 144, 48, ui.BLACK)
display.bar(0, 0, 205, 48, ui.BLACK)
# input line with a header
display.text_center(120, 30, header, ui.BOLD, ui.GREY, ui.BLACK)
@ -63,4 +63,5 @@ class PinMatrix():
self.pin = ''
for btn in self.pin_buttons:
if btn.send(event, pos) == BTN_CLICKED:
self.pin += btn.content
if len(self.pin) < 9:
self.pin += btn.content