|
|
|
@ -39,10 +39,11 @@ class RustLayout(LayoutParentType[T]):
|
|
|
|
|
BACKLIGHT_LEVEL = ui.style.BACKLIGHT_NORMAL
|
|
|
|
|
|
|
|
|
|
# pylint: disable=super-init-not-called
|
|
|
|
|
def __init__(self, layout: trezorui2.LayoutObj[T]):
|
|
|
|
|
def __init__(self, layout: trezorui2.LayoutObj[T], color: int | None = None):
|
|
|
|
|
self.layout = layout
|
|
|
|
|
self.timer = loop.Timer()
|
|
|
|
|
self.layout.attach_timer_fn(self.set_timer)
|
|
|
|
|
self.color = color
|
|
|
|
|
|
|
|
|
|
def set_timer(self, token: int, deadline: int) -> None:
|
|
|
|
|
self.timer.schedule(deadline, token)
|
|
|
|
@ -55,8 +56,11 @@ class RustLayout(LayoutParentType[T]):
|
|
|
|
|
import storage.cache as storage_cache
|
|
|
|
|
|
|
|
|
|
painted = self.layout.paint()
|
|
|
|
|
|
|
|
|
|
if self.color is not None:
|
|
|
|
|
print("PAINTING")
|
|
|
|
|
ui.display.bar(0, 0, ui.WIDTH, ui.HEIGHT - 60, self.color)
|
|
|
|
|
ui.refresh()
|
|
|
|
|
|
|
|
|
|
if storage_cache.homescreen_shown is not None and painted:
|
|
|
|
|
storage_cache.homescreen_shown = None
|
|
|
|
|
|
|
|
|
@ -255,6 +259,7 @@ def confirm_action(
|
|
|
|
|
reverse: bool = False,
|
|
|
|
|
exc: ExceptionType = ActionCancelled,
|
|
|
|
|
br_code: ButtonRequestType = BR_TYPE_OTHER,
|
|
|
|
|
color: int | None = None,
|
|
|
|
|
) -> Awaitable[None]:
|
|
|
|
|
if verb is not None:
|
|
|
|
|
verb = verb.upper()
|
|
|
|
@ -276,7 +281,8 @@ def confirm_action(
|
|
|
|
|
hold=hold,
|
|
|
|
|
hold_danger=hold_danger,
|
|
|
|
|
reverse=reverse,
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
color=color,
|
|
|
|
|
),
|
|
|
|
|
br_type,
|
|
|
|
|
br_code,
|
|
|
|
|