mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-09 06:50:58 +00:00
add fingerprint layout
This commit is contained in:
parent
d746c79fb8
commit
6f9edb349c
@ -91,6 +91,7 @@ static void display_init(void)
|
||||
SDL_DestroyWindow(win);
|
||||
SDL_Quit();
|
||||
}
|
||||
SDL_SetRenderDrawColor(RENDERER, 255, 0, 0, 255);
|
||||
SDL_RenderClear(RENDERER);
|
||||
SCREEN = SDL_CreateRGBSurface(0, RESX, RESY, 16, 0xF800, 0x07E0, 0x001F, 0x0000);
|
||||
TEXTURE = SDL_CreateTexture(RENDERER, SDL_PIXELFORMAT_RGB565, SDL_TEXTUREACCESS_STREAMING, RESX, RESY);
|
||||
|
BIN
src/apps/playground_stick/fingerprint.toig
Normal file
BIN
src/apps/playground_stick/fingerprint.toig
Normal file
Binary file not shown.
@ -1,16 +1,20 @@
|
||||
from trezor import ui
|
||||
from trezor import loop
|
||||
|
||||
f = open('apps/playground_stick/fingerprint.toig', 'rb')
|
||||
c = ui.rgbcolor(0x20, 0x98, 0xD1)
|
||||
|
||||
def layout_homescreen():
|
||||
|
||||
# ui.display.bar(0, 0, 240, 240, ui.WHITE)
|
||||
|
||||
f = open('apps/playground_stick/trezor.toig', 'r')
|
||||
ui.display.bar(0, 0, 240, 48 * 4, ui.BLACK)
|
||||
ui.display.bar(0, 48 * 4, 240, 48, c)
|
||||
ui.text_center(120, 240 - 18, 'Hold to confirm', 2, ui.WHITE, c)
|
||||
p = 0
|
||||
|
||||
def func(foreground):
|
||||
f.seek(0)
|
||||
ui.display.icon(0, 0, f.read(), foreground, ui.BLACK)
|
||||
ui.display.loader(p, c, 0, f.read(), foreground)
|
||||
p = (p + 10) % 1000
|
||||
|
||||
animation = ui.animate_pulse(func, ui.WHITE, ui.GREY, speed=400000)
|
||||
|
||||
|
Binary file not shown.
@ -36,6 +36,16 @@ MONO = const(0)
|
||||
NORMAL = const(1)
|
||||
BOLD = const(2)
|
||||
|
||||
def text(x: int, y: int, text: bytes, font: int, fgcolor: int, bgcolor: int) -> None:
|
||||
display.text(x, y, text, font, fgcolor, bgcolor)
|
||||
|
||||
def text_right(x: int, y: int, text: bytes, font: int, fgcolor: int, bgcolor: int) -> None:
|
||||
w = display.text_width(text, font)
|
||||
display.text(x - w, y, text, font, fgcolor, bgcolor)
|
||||
|
||||
def text_center(x: int, y: int, text: bytes, font: int, fgcolor: int, bgcolor: int) -> None:
|
||||
w = display.text_width(text, font)
|
||||
display.text(x - w // 2, y, text, font, fgcolor, bgcolor)
|
||||
|
||||
def lerpi(a: int, b: int, t: float) -> int:
|
||||
return int(a + t * (b - a))
|
||||
|
2
vendor/trezor-crypto
vendored
2
vendor/trezor-crypto
vendored
@ -1 +1 @@
|
||||
Subproject commit b8ec5567ba701c77379f2111774456eb18b98790
|
||||
Subproject commit 242a5de275d36e2df6792c921a9cd7d8c8e8933b
|
Loading…
Reference in New Issue
Block a user