mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-26 01:18:28 +00:00
trezor.ui: send -> touch
This commit is contained in:
parent
dc87e14334
commit
3cb89f3ae7
@ -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
|
||||
|
@ -29,6 +29,3 @@ class Text(ui.Widget):
|
||||
style = item
|
||||
else:
|
||||
fg = item
|
||||
|
||||
def send(self, event, pos):
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user