From 9c84b742a0f7bb610f7cea5f9946b28cd2c28263 Mon Sep 17 00:00:00 2001 From: Peter Jensen Date: Sun, 4 Feb 2018 20:50:07 +0100 Subject: [PATCH] ui/pin: change design of pin bullets --- src/trezor/ui/pin.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/trezor/ui/pin.py b/src/trezor/ui/pin.py index 060e51fa6d..c3e7c4cc03 100644 --- a/src/trezor/ui/pin.py +++ b/src/trezor/ui/pin.py @@ -40,9 +40,19 @@ class PinMatrix(ui.Widget): # clear canvas under input line display.bar(0, 0, 240, 45, ui.BG) - # input line with a header - header = '*' * len(self.pin) if self.pin else self.label - display.text_center(120, 36, header, ui.BOLD, ui.GREY, ui.BG) + if self.pin: + # input line with pin + 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 for btn in self.pin_buttons: