1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

ui/pin: change design of pin bullets

This commit is contained in:
Peter Jensen 2018-02-04 20:50:07 +01:00 committed by Jan Pochyla
parent ac0be4b061
commit 9c84b742a0

View File

@ -40,9 +40,19 @@ class PinMatrix(ui.Widget):
# clear canvas under input line # clear canvas under input line
display.bar(0, 0, 240, 45, ui.BG) display.bar(0, 0, 240, 45, ui.BG)
# input line with a header if self.pin:
header = '*' * len(self.pin) if self.pin else self.label # input line with pin
display.text_center(120, 36, header, ui.BOLD, ui.GREY, ui.BG) l = len(self.pin)
y = const(20)
size = const(10)
padding = const(14)
box_w = const(240)
x = (box_w - l * padding) // 2
for i in range(0, l):
ui.display.bar_radius(x + i * padding, y, size, size, ui.GREY, ui.BG, 4)
else:
# input line with header label
display.text_center(120, 36, self.label, ui.BOLD, ui.GREY, ui.BG)
# pin matrix buttons # pin matrix buttons
for btn in self.pin_buttons: for btn in self.pin_buttons: