1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-29 10:58:21 +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

@ -58,7 +58,7 @@ class HoldToConfirmDialog(Widget):
self.content.render() self.content.render()
self.button.render() self.button.render()
def send(self, event, pos): def touch(self, event, pos):
button = self.button button = self.button
was_started = button.state & BTN_STARTED was_started = button.state & BTN_STARTED
button.touch(event, pos) button.touch(event, pos)
@ -71,7 +71,7 @@ class HoldToConfirmDialog(Widget):
if self.loader.stop(): if self.loader.stop():
return CONFIRMED return CONFIRMED
if self.content is not None: if self.content is not None:
return self.content.send(event, pos) return self.content.touch(event, pos)
async def __iter__(self): async def __iter__(self):
return await loop.Wait((self._render_loop(), self._event_loop())) return await loop.Wait((self._render_loop(), self._event_loop()))
@ -85,6 +85,6 @@ class HoldToConfirmDialog(Widget):
def _event_loop(self): def _event_loop(self):
while True: while True:
event, *pos = yield loop.Select(loop.TOUCH) event, *pos = yield loop.Select(loop.TOUCH)
result = self.send(event, pos) result = self.touch(event, pos)
if result is not None: if result is not None:
return result return result

View File

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