1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 14:58:09 +00:00

trezor.ui: add Widget

This commit is contained in:
Jan Pochyla 2017-02-08 16:19:33 +01:00
parent deb09c2454
commit 910033d71c

View File

@ -121,3 +121,20 @@ def rotate_coords(pos: tuple) -> tuple:
return (240 - x, 240 - y) return (240 - x, 240 - y)
if r == 270: if r == 270:
return (240 - y, x) return (240 - y, x)
class Widget:
def render(self):
pass
def touch(self, event, pos):
pass
def __iter__(self):
while True:
self.render()
event, *pos = yield loop.Select(loop.TOUCH)
result = self.touch(event, pos)
if result is not None:
return result