diff --git a/src/apps/playground_chren/layout_send_tx.py b/src/apps/playground_chren/layout_send_tx.py new file mode 100644 index 000000000..47e0add57 --- /dev/null +++ b/src/apps/playground_chren/layout_send_tx.py @@ -0,0 +1,43 @@ +from trezor import ui +from trezor import loop +from trezor import res +from trezor.ui.scroll import Scroll + +def layout_send_tx(): + + # paint background black + ui.display.bar(0, 0, 240, 240, ui.BLACK) + + # top header bar + # ui.display.bar(0, 0, 240, 48, ui.PM_BLUE, ui.BLACK, 4) + ui.display.icon(10, 9, res.load('apps/playground_chren/res/arrow-up2.toig'), ui.BLACK, ui.PM_BLUE) + ui.display.text(40, 28, 'Sending coins', ui.BOLD, ui.PM_BLUE, ui.BLACK) + + + # content + ui.display.bar(0, 42, 240, 198, ui.BLACK) + ui.display.text(10, 70, 'Amount:', ui.BOLD, ui.GREY, ui.BLACK) + ui.display.text(10, 100, '0.0000341 BTC', ui.MONO, ui.WHITE, ui.BLACK) + ui.display.text(10, 130, 'To address:', ui.BOLD, ui.GREY, ui.BLACK) + ui.display.text(10, 160, '1NDpZ2wyFekVezssS', ui.MONO, ui.WHITE, ui.BLACK) + ui.display.text(10, 185, 'Xv2tmQgmxcoHMUJ7u', ui.MONO, ui.WHITE, ui.BLACK) + + scroll = Scroll(page=0, totale_lines=20, lines_per_page=4) + scroll.render() + + + # swipe down indicator + def func_top(foreground): + ui.display.bar(102, 214, 36, 4, foreground, ui.BLACK, 2) + + def func_middle(foreground): + ui.display.bar(106, 222, 28, 4, foreground, ui.BLACK, 2) + + def func_bottom(foreground): + ui.display.bar(110, 230, 20, 4, foreground, ui.BLACK, 2) + + animation_top = ui.animate_pulse(func_top, ui.PM_BLUE, ui.PM_DARK_BLUE, speed=300000, delay=0) + animation_middle = ui.animate_pulse(func_middle, ui.PM_BLUE, ui.PM_DARK_BLUE, speed=300000, delay=200000) + animation_bottom = ui.animate_pulse(func_bottom, ui.PM_BLUE, ui.PM_DARK_BLUE, speed=300000, delay=400000) + + yield loop.Wait([animation_top, animation_middle, animation_bottom]) \ No newline at end of file diff --git a/src/apps/playground_chren/res/arrow-up2.toig b/src/apps/playground_chren/res/arrow-up2.toig new file mode 100644 index 000000000..728049bd3 Binary files /dev/null and b/src/apps/playground_chren/res/arrow-up2.toig differ diff --git a/src/trezor/ui/__init__.py b/src/trezor/ui/__init__.py index 9ca8146fe..261293dd5 100644 --- a/src/trezor/ui/__init__.py +++ b/src/trezor/ui/__init__.py @@ -37,6 +37,11 @@ BLUE_GRAY = rgbcolor(0x60, 0x7D, 0x8B) BLACK = rgbcolor(0x00, 0x00, 0x00) WHITE = rgbcolor(0xFF, 0xFF, 0xFF) +# password manager palette + +PM_DARK_BLUE = rgbcolor(0x1A, 0x29, 0x42) +PM_BLUE = rgbcolor(0x34, 0x98, 0xdb) + MONO = const(0) NORMAL = const(1) BOLD = const(2) diff --git a/src/trezor/ui/scroll.py b/src/trezor/ui/scroll.py index 956d02868..f0327c8b3 100644 --- a/src/trezor/ui/scroll.py +++ b/src/trezor/ui/scroll.py @@ -10,7 +10,7 @@ class Scroll(): self.lines_per_page = lines_per_page def render(self): - count = len(self.totale_lines) // self.lines_per_page + count = self.totale_lines // self.lines_per_page padding = 20 screen_height = const(220) cursor = 8 @@ -18,13 +18,13 @@ class Scroll(): if count * padding > screen_height: padding = screen_height // count - x = 220 - y = (10 + (screen_height // 2)) - ((count // 2) * padding) + x = 230 + y = ((screen_height // 2)) - ((count // 2) * padding) for i in range(0, count): if (i != self.page): - ui.display.bar(x, y + i * padding, cursor, cursor, ui.GREY) - ui.display.bar(x, y + self.page * padding, cursor, cursor, ui.WHITE) + ui.display.bar(x, y + i * padding, cursor, cursor, ui.GREY, ui.BLACK, 4) + ui.display.bar(x, y + self.page * padding, cursor, cursor, ui.WHITE, ui.BLACK, 4) def wait(self): while True: