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

fixed wipe device header

This commit is contained in:
chren 2016-10-06 16:35:36 +02:00
parent 5a20a48745
commit cb2399197f
2 changed files with 5 additions and 2 deletions

View File

@ -10,8 +10,9 @@ 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.ICON_WIPE,
ui.BOLD, 'Do you really want to', 'wipe the device?',
ui.NORMAL, '', 'All data will be lost.')
await hold_to_confirm(session_id, content)

View File

@ -8,14 +8,16 @@ TEXT_MARGIN_LEFT = const(10)
class Text:
def __init__(self, header, *content):
def __init__(self, header, icon, *content):
self.header = header
self.icon = icon
self.content = content
def render(self):
offset = TEXT_LINE_HEIGHT
offset += TEXT_HEADER_HEIGHT
style = ui.NORMAL
ui.header(self.header, self.icon, ui.BLACK, ui.LIGHT_GREEN)
for item in self.content:
if isinstance(item, str):
ui.display.text(TEXT_MARGIN_LEFT, offset,