1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 20:19:23 +00:00

src: minor visual nits

This commit is contained in:
Pavol Rusnak 2018-03-01 01:13:26 +01:00
parent 2e3dc8b29d
commit c937d73217
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
8 changed files with 16 additions and 16 deletions

View File

@ -434,8 +434,8 @@ class ConfirmContent(ui.Widget):
else:
header = 'U2F Authenticate'
ui.header(header, ui.ICON_DEFAULT, ui.GREEN, ui.BG, ui.GREEN)
ui.display.image((240 - 64) // 2, 90, self.app_icon)
ui.display.text_center(120, 185, self.app_name, ui.MONO, ui.FG, ui.BG)
ui.display.image((ui.WIDTH - 64) // 2, 64, self.app_icon)
ui.display.text_center(ui.WIDTH // 2, 176, self.app_name, ui.MONO, ui.FG, ui.BG)
_CONFIRM_STATE_TIMEOUT_MS = const(10 * 1000)

View File

@ -24,12 +24,12 @@ def display_homescreen():
if storage.is_initialized() and storage.needs_backup():
ui.display.bar(0, 0, ui.WIDTH, 30, ui.YELLOW)
ui.display.text_center(120, 22, 'NEEDS BACKUP!', ui.BOLD, ui.BLACK, ui.YELLOW)
ui.display.text_center(ui.WIDTH // 2, 22, 'NEEDS BACKUP!', ui.BOLD, ui.BLACK, ui.YELLOW)
ui.display.bar(0, 30, ui.WIDTH, ui.HEIGHT - 30, ui.BG)
else:
ui.display.bar(0, 0, ui.WIDTH, ui.HEIGHT, ui.BG)
ui.display.avatar(48, 48 - 10, image, ui.WHITE, ui.BLACK)
ui.display.text_center(120, 220, label, ui.BOLD, ui.FG, ui.BG)
ui.display.text_center(ui.WIDTH // 2, 220, label, ui.BOLD, ui.FG, ui.BG)
async def swipe_to_rotate():

View File

@ -35,13 +35,13 @@ async def lockscreen():
ui.display.clear()
ui.display.avatar(48, 48, image, ui.TITLE_GREY, ui.BG)
ui.display.text_center(120, 35, label, ui.BOLD, ui.TITLE_GREY, ui.BG)
ui.display.text_center(ui.WIDTH // 2, 35, label, ui.BOLD, ui.TITLE_GREY, ui.BG)
ui.display.bar_radius(40, 100, 160, 40, ui.TITLE_GREY, ui.BG, 4)
ui.display.bar_radius(42, 102, 156, 36, ui.BG, ui.TITLE_GREY, 4)
ui.display.text_center(120, 128, 'Locked', ui.BOLD, ui.TITLE_GREY, ui.BG)
ui.display.text_center(ui.WIDTH // 2, 128, 'Locked', ui.BOLD, ui.TITLE_GREY, ui.BG)
ui.display.text_center(130, 220, 'Tap to unlock', ui.BOLD, ui.TITLE_GREY, ui.BG)
ui.display.text_center(ui.WIDTH // 2 + 10, 220, 'Tap to unlock', ui.BOLD, ui.TITLE_GREY, ui.BG)
ui.display.icon(45, 202, res.load(ui.ICON_CLICK), ui.TITLE_GREY, ui.BG)
await ui.backlight_slide(ui.BACKLIGHT_NORMAL)

View File

@ -57,11 +57,11 @@ def rotate(pos: tuple) -> tuple:
return pos
x, y = pos
if r == 90:
return (y, 240 - x)
return (y, WIDTH - x)
if r == 180:
return (240 - x, 240 - y)
return (WIDTH - x, HEIGHT - y)
if r == 270:
return (240 - y, x)
return (HEIGHT - y, x)
def pulse(delay: int):

View File

@ -58,8 +58,8 @@ class Loader(ui.Widget):
def __iter__(self):
sleep = loop.sleep(1000000 // 30) # 30 fps
ui.display.bar(0, 32, 240, 240 - 83, ui.BG) # clear
ui.display.bar(0, 32, ui.WIDTH, ui.HEIGHT - 83, ui.BG) # clear
while self.is_active():
self.render()
yield sleep
ui.display.bar(0, 32, 240, 240 - 83, ui.BG) # clear
ui.display.bar(0, 32, ui.WIDTH, ui.HEIGHT - 83, ui.BG) # clear

View File

@ -93,7 +93,7 @@ class MnemonicKeyboard(ui.Widget):
self.back.render()
else:
# prompt
display.bar(0, 8, 240, 60, ui.BG)
display.bar(0, 8, ui.WIDTH, 60, ui.BG)
display.text(20, 40, self.prompt, ui.BOLD, ui.GREY, ui.BG)
# key buttons
for btn in self.keys:

View File

@ -89,7 +89,7 @@ class Prompt:
def render(self):
if self.dirty:
display.bar(0, 0, 240, 48, ui.BG)
display.bar(0, 0, ui.WIDTH, 48, ui.BG)
display.text_center(ui.WIDTH // 2, 32, self.text, ui.BOLD, ui.GREY, ui.BG)
self.dirty = False

View File

@ -38,7 +38,7 @@ class PinMatrix(ui.Widget):
def render(self):
# clear canvas under input line
display.bar(0, 0, 240, 45, ui.BG)
display.bar(0, 0, ui.WIDTH, 45, ui.BG)
if self.pin:
# input line with pin
@ -52,7 +52,7 @@ class PinMatrix(ui.Widget):
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)
display.text_center(ui.WIDTH // 2, 36, self.label, ui.BOLD, ui.GREY, ui.BG)
# pin matrix buttons
for btn in self.pin_buttons: