1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

added ui header and icons

This commit is contained in:
chren 2016-10-06 16:16:59 +02:00
parent 3e9b6c09b0
commit 5a20a48745
11 changed files with 15 additions and 11 deletions

BIN
assets/recovery.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/reset.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/wipe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -16,8 +16,7 @@ async def layout_recovery_device(session_id, message):
msg = 'Please enter ' + nth(message.word_count) + ' word'
ui.display.clear()
ui.display.text(10, 30, 'Recovering device',
ui.BOLD, ui.LIGHT_GREEN, ui.BLACK)
ui.header('Recovering device', ui.ICON_RECOVERY, ui.BLACK, ui.LIGHT_GREEN)
ui.display.text(10, 74, msg, ui.BOLD, ui.WHITE, ui.BLACK)
ui.display.text(10, 104, 'of your mnemonic.', ui.BOLD, ui.WHITE, ui.BLACK)

View File

@ -74,8 +74,7 @@ async def show_mnemonic_page(page, page_count, mnemonic):
from trezor.ui.scroll import render_scrollbar, animate_swipe
ui.display.clear()
ui.display.text(
10, 34, 'Write down your seed', ui.BOLD, ui.LIGHT_GREEN, ui.BLACK)
ui.header('Write down your seed', ui.ICON_RESET, ui.BLACK, ui.LIGHT_GREEN)
render_scrollbar(page, page_count)
for pi, (wi, word) in enumerate(mnemonic[page]):

View File

@ -10,9 +10,8 @@ async def layout_wipe_device(message, session_id):
from ..common import storage
ui.display.clear()
ui.header('Wiping device', ui.ICON_WIPE, ui.BLACK, ui.LIGHT_GREEN)
content = Text(
'Wiping device',
ui.BOLD, 'Do you really want to', 'wipe the device?',
ui.NORMAL, '', 'All data will be lost.')
await hold_to_confirm(session_id, content)

Binary file not shown.

BIN
src/trezor/res/reset.toig Normal file

Binary file not shown.

BIN
src/trezor/res/wipe.toig Normal file

Binary file not shown.

View File

@ -2,7 +2,7 @@ import math
import utime
from TrezorUi import Display
from trezor import loop
from trezor import loop, res
display = Display()
@ -45,6 +45,10 @@ MONO = Display.FONT_MONO
NORMAL = Display.FONT_NORMAL
BOLD = Display.FONT_BOLD
# icons
ICON_RESET = 'trezor/res/reset.toig'
ICON_WIPE = 'trezor/res/wipe.toig'
ICON_RECOVERY = 'trezor/res/recovery.toig'
def in_area(pos: tuple, area: tuple) -> bool:
x, y = pos
@ -70,6 +74,11 @@ def animate_pulse(func, ca, cb, speed=200000, delay=30000):
func(c)
yield loop.Sleep(delay)
def header(title, icon=ICON_RESET, fg=BLACK, bg=PM_DARK_BLUE):
display.bar(0, 0, 240, 32, bg)
image = res.load(icon)
display.icon(8, 4, image, fg, bg)
display.text(8 + 24 + 8, 23, title, BOLD, fg, bg)
def rotate_coords(pos: tuple) -> tuple:
r = display.orientation()

View File

@ -1,8 +1,8 @@
from micropython import const
from trezor import ui
TEXT_HEADER_HEIGHT = const(44)
TEXT_LINE_HEIGHT = const(30)
TEXT_HEADER_HEIGHT = const(32)
TEXT_LINE_HEIGHT = const(23)
TEXT_MARGIN_LEFT = const(10)
@ -14,8 +14,6 @@ class Text:
def render(self):
offset = TEXT_LINE_HEIGHT
ui.display.text(TEXT_MARGIN_LEFT, offset,
self.header, ui.BOLD, ui.LIGHT_GREEN, ui.BLACK)
offset += TEXT_HEADER_HEIGHT
style = ui.NORMAL
for item in self.content: