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

trezor.ui: send -> touch

This commit is contained in:
Jan Pochyla 2017-05-31 19:30:06 +02:00
parent dc87e14334
commit 3cb89f3ae7
2 changed files with 5 additions and 8 deletions

View File

@ -18,8 +18,8 @@ class ConfirmDialog(Widget):
normal_style=CONFIRM_BUTTON,
active_style=CONFIRM_BUTTON_ACTIVE)
self.cancel = Button((0, 240 - 48, 119, 48), cancel,
normal_style=CANCEL_BUTTON,
active_style=CANCEL_BUTTON_ACTIVE)
normal_style=CANCEL_BUTTON,
active_style=CANCEL_BUTTON_ACTIVE)
else:
self.cancel = None
self.confirm = Button((0, 240 - 48, 240, 48), confirm,
@ -58,7 +58,7 @@ class HoldToConfirmDialog(Widget):
self.content.render()
self.button.render()
def send(self, event, pos):
def touch(self, event, pos):
button = self.button
was_started = button.state & BTN_STARTED
button.touch(event, pos)
@ -71,7 +71,7 @@ class HoldToConfirmDialog(Widget):
if self.loader.stop():
return CONFIRMED
if self.content is not None:
return self.content.send(event, pos)
return self.content.touch(event, pos)
async def __iter__(self):
return await loop.Wait((self._render_loop(), self._event_loop()))
@ -85,6 +85,6 @@ class HoldToConfirmDialog(Widget):
def _event_loop(self):
while True:
event, *pos = yield loop.Select(loop.TOUCH)
result = self.send(event, pos)
result = self.touch(event, pos)
if result is not None:
return result

View File

@ -29,6 +29,3 @@ class Text(ui.Widget):
style = item
else:
fg = item
def send(self, event, pos):
pass