1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-14 02:28:19 +00:00
trezor-firmware/core/src/trezor/ui/qr.py

16 lines
398 B
Python

from trezor import ui
class Qr(ui.Component):
def __init__(self, data: str, x: int, y: int, scale: int):
super().__init__()
self.data = data
self.x = x
self.y = y
self.scale = scale
def on_render(self) -> None:
if self.repaint:
ui.display.qrcode(self.x, self.y, self.data.encode(), self.scale)
self.repaint = False