1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

ui: clear the screen before common layouts

This commit is contained in:
Jan Pochyla 2016-10-06 12:31:03 +02:00
parent b2299c118a
commit cc22d59eca
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
from trezor import wire from trezor import wire, ui
from trezor.utils import unimport from trezor.utils import unimport
@ -9,6 +9,7 @@ async def confirm(session_id, content=None, code=None, *args, **kwargs):
from trezor.messages.ButtonRequestType import Other from trezor.messages.ButtonRequestType import Other
from trezor.messages.wire_types import ButtonAck from trezor.messages.wire_types import ButtonAck
ui.display.clear()
dialog = ConfirmDialog(content, *args, **kwargs) dialog = ConfirmDialog(content, *args, **kwargs)
dialog.render() dialog.render()
@ -26,6 +27,7 @@ async def hold_to_confirm(session_id, content=None, code=None, *args, **kwargs):
from trezor.messages.ButtonRequestType import Other from trezor.messages.ButtonRequestType import Other
from trezor.messages.wire_types import ButtonAck from trezor.messages.wire_types import ButtonAck
ui.display.clear()
button = Button((0, 240 - 48, 240, 48), 'Hold to confirm', button = Button((0, 240 - 48, 240, 48), 'Hold to confirm',
normal_style=CONFIRM_BUTTON, normal_style=CONFIRM_BUTTON,
active_style=CONFIRM_BUTTON_ACTIVE) active_style=CONFIRM_BUTTON_ACTIVE)

View File

@ -16,7 +16,7 @@ async def request_pin(session_id, *args, **kwargs):
ButtonRequest(code=ProtectCall), ButtonRequest(code=ProtectCall),
ButtonAck) ButtonAck)
ui.clear() ui.display.clear()
matrix = PinMatrix(*args, **kwargs) matrix = PinMatrix(*args, **kwargs)
dialog = ConfirmDialog(matrix) dialog = ConfirmDialog(matrix)
if await dialog != CONFIRMED: if await dialog != CONFIRMED: