mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 23:08:14 +00:00
trezor.ui: add Widget
This commit is contained in:
parent
deb09c2454
commit
910033d71c
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user