diff --git a/src/trezor/ui/button.py b/src/trezor/ui/button.py index f91799b3f..74c220ee1 100644 --- a/src/trezor/ui/button.py +++ b/src/trezor/ui/button.py @@ -7,7 +7,7 @@ DEFAULT_BUTTON = { 'bg-color': ui.BLACK, 'fg-color': ui.WHITE, 'text-style': ui.NORMAL, - 'border-color': ui.blend(ui.BLACK, ui.WHITE, 0.1), + 'border-color': ui.BLACK, } DEFAULT_BUTTON_ACTIVE = { 'bg-color': ui.GREY, @@ -20,7 +20,7 @@ CANCEL_BUTTON = { 'bg-color': ui.blend(ui.BLACK, ui.RED, 0.3), 'fg-color': ui.RED, 'text-style': ui.NORMAL, - 'border-color': ui.blend(ui.BLACK, ui.RED, 0.6), + 'border-color': ui.blend(ui.BLACK, ui.RED, 0.3), } CANCEL_BUTTON_ACTIVE = { 'bg-color': ui.RED, @@ -33,7 +33,7 @@ CONFIRM_BUTTON = { 'bg-color': ui.blend(ui.BLACK, ui.GREEN, 0.3), 'fg-color': ui.GREEN, 'text-style': ui.NORMAL, - 'border-color': ui.blend(ui.BLACK, ui.GREEN, 0.6), + 'border-color': ui.blend(ui.BLACK, ui.GREEN, 0.3), } CONFIRM_BUTTON_ACTIVE = { 'bg-color': ui.GREEN, diff --git a/src/trezor/ui/confirm.py b/src/trezor/ui/confirm.py index 1cf5a529c..bfab66d5a 100644 --- a/src/trezor/ui/confirm.py +++ b/src/trezor/ui/confirm.py @@ -12,10 +12,10 @@ class ConfirmDialog(): def __init__(self, content=None, confirm='Confirm', cancel='Cancel'): self.content = content - self.confirm = Button((0, 240 - 60, 120, 60), confirm, + self.confirm = Button((0, 240 - 48, 119, 48), confirm, normal_style=CONFIRM_BUTTON, active_style=CONFIRM_BUTTON_ACTIVE) - self.cancel = Button((120, 240 - 60, 120, 60), cancel, + self.cancel = Button((121, 240 - 48, 119, 48), cancel, normal_style=CANCEL_BUTTON, active_style=CANCEL_BUTTON_ACTIVE) diff --git a/src/trezor/ui/pin.py b/src/trezor/ui/pin.py index 6899bddde..29a4f385d 100644 --- a/src/trezor/ui/pin.py +++ b/src/trezor/ui/pin.py @@ -1,3 +1,5 @@ +from . import display +from trezor import ui from trezor import loop from trezor.crypto import random from .button import Button, BTN_CLICKED @@ -7,10 +9,10 @@ from .button import CANCEL_BUTTON, CANCEL_BUTTON_ACTIVE def digit_area(i): width = const(80) - height = const(60) + height = const(48) x = (i % 3) * width y = (i // 3) * height - return (x, y, width, height) + return (x, y + 48, width, height) # 48px is offset of input line def generate_digits(): @@ -27,6 +29,19 @@ class PinMatrix(): for i, d in enumerate(generate_digits())] def render(self): + + # input line with placeholder (x, y, text, style, fg-c, bg-c) + display.text_center(120, 20, 'Enter PIN', ui.BOLD, ui.GREY, ui.BLACK) + + # vertical border bars (x, y, w, h, c) + display.bar(79, 48, 2, 143, ui.blend(ui.BLACK, ui.WHITE, 0.25)) + display.bar(158, 48, 2, 143, ui.blend(ui.BLACK, ui.WHITE, 0.25)) + + # horizontal border bars + display.bar(0, 95, 240, 2, ui.blend(ui.BLACK, ui.WHITE, 0.25)) + display.bar(0, 142, 240, 2, ui.blend(ui.BLACK, ui.WHITE, 0.25)) + + # pin matrix buttons for btn in self.buttons: btn.render()