From 56c3c55b7cccc98fc515ca5674dc2ad040040936 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sun, 9 Apr 2017 02:38:24 +0200 Subject: [PATCH] assets: update bootloader ui mockups --- assets/ui-mockup/boot_info.py | 14 +----------- assets/ui-mockup/boot_init.py | 2 +- assets/ui-mockup/boot_nofw.py | 2 +- assets/ui-mockup/boot_unsigned.py | 17 ++------------- assets/ui-mockup/install_fail.py | 17 ++------------- assets/ui-mockup/install_fw.py | 29 ++----------------------- assets/ui-mockup/install_fw_really.py | 17 ++------------- assets/ui-mockup/install_ok.py | 17 ++------------- assets/ui-mockup/install_progress.py | 4 ++-- assets/ui-mockup/install_u_fw.py | 31 +++------------------------ 10 files changed, 18 insertions(+), 132 deletions(-) diff --git a/assets/ui-mockup/boot_info.py b/assets/ui-mockup/boot_info.py index b15600b4ce..61fcb50fc4 100755 --- a/assets/ui-mockup/boot_info.py +++ b/assets/ui-mockup/boot_info.py @@ -5,18 +5,6 @@ sys.path.append('../../src') from trezor import ui, res from trezor.ui import button -DEFAULT_BUTTON = { - 'bg-color': ui.DARK_GREY, - 'fg-color': ui.GREY, - 'text-style': ui.NORMAL, - 'border-color': ui.BLACK, -} -DEFAULT_BUTTON_ACTIVE = { - 'bg-color': ui.GREY, - 'fg-color': ui.WHITE, - 'text-style': ui.BOLD, - 'border-color': ui.GREY, -} ui.display.clear() ui.display.backlight(255) @@ -26,7 +14,7 @@ ui.display.image(60, 10, image) ui.display.text_center(120, 160, "SatoshiLabs", 1, ui.WHITE, ui.BLACK) ui.display.text_center(120, 183, "v0.1.1", 1, ui.GREY, ui.BLACK) -reboot = button.Button((0, 240 - 48, 240, 48), 'Reboot', normal_style=DEFAULT_BUTTON, active_style=DEFAULT_BUTTON_ACTIVE) +reboot = button.Button((0, 240 - 48, 240, 48), 'Reboot', normal_style=button.DEFAULT_BUTTON, active_style=button.DEFAULT_BUTTON_ACTIVE) reboot.render() while True: diff --git a/assets/ui-mockup/boot_init.py b/assets/ui-mockup/boot_init.py index 2eca777e45..8ea347daf0 100755 --- a/assets/ui-mockup/boot_init.py +++ b/assets/ui-mockup/boot_init.py @@ -14,4 +14,4 @@ ui.display.text_center(120, 192, "SatoshiLabs", ui.BOLD, ui.WHITE, ui.BLACK) ui.display.text_center(120, 215, "v0.1.1", 1, ui.GREY, ui.BLACK) while True: - ui.display.refresh() \ No newline at end of file + ui.display.refresh() diff --git a/assets/ui-mockup/boot_nofw.py b/assets/ui-mockup/boot_nofw.py index 84b5ba1ff4..4b8fe1fa26 100755 --- a/assets/ui-mockup/boot_nofw.py +++ b/assets/ui-mockup/boot_nofw.py @@ -16,4 +16,4 @@ ui.display.text_center(120, 192 + 32, "Visit TREZOR.io/start", 1, ui.WHITE, ui.B while True: - ui.display.refresh() \ No newline at end of file + ui.display.refresh() diff --git a/assets/ui-mockup/boot_unsigned.py b/assets/ui-mockup/boot_unsigned.py index 1b3372a9ca..158b588bf2 100755 --- a/assets/ui-mockup/boot_unsigned.py +++ b/assets/ui-mockup/boot_unsigned.py @@ -2,23 +2,10 @@ import sys sys.path.append('../../src') -from trezor import ui, res +from trezor import ui from trezor.ui import button from bl_common import bl_header -CANCEL_BUTTON = { - 'bg-color': ui.RED, - 'fg-color': ui.LIGHT_RED, - 'text-style': ui.BOLD, - 'border-color': ui.RED, -} -CANCEL_BUTTON_ACTIVE = { - 'bg-color': ui.RED, - 'fg-color': ui.WHITE, - 'text-style': ui.BOLD, - 'border-color': ui.RED, -} - ui.display.backlight(255) # background frame @@ -39,7 +26,7 @@ ui.display.text(15, s + 1 * 23, 'bc0ae1c2f715277f', ui.MONO, ui.GREY, ui.DARK_GR ui.display.text(15, s + 2 * 23, '22b67f26c15e1f75', ui.MONO, ui.GREY, ui.DARK_GREY) ui.display.text(15, s + 3 * 23, '43b2b44913b5c255', ui.MONO, ui.GREY, ui.DARK_GREY) -cancel = button.Button((0, 240 - 48, 240, 48), 'Proceed anyway', normal_style=CANCEL_BUTTON, active_style=CANCEL_BUTTON_ACTIVE) +cancel = button.Button((0, 240 - 48, 240, 48), 'Proceed anyway', normal_style=button.CANCEL_BUTTON, active_style=button.CANCEL_BUTTON_ACTIVE) cancel.render() while True: diff --git a/assets/ui-mockup/install_fail.py b/assets/ui-mockup/install_fail.py index 0070712d89..23cdd799b0 100755 --- a/assets/ui-mockup/install_fail.py +++ b/assets/ui-mockup/install_fail.py @@ -2,23 +2,10 @@ import sys sys.path.append('../../src') -from trezor import ui, res +from trezor import ui from trezor.ui import button from bl_common import bl_header -DEFAULT_BUTTON = { - 'bg-color': ui.DARK_GREY, - 'fg-color': ui.GREY, - 'text-style': ui.NORMAL, - 'border-color': ui.BLACK, -} -DEFAULT_BUTTON_ACTIVE = { - 'bg-color': ui.GREY, - 'fg-color': ui.WHITE, - 'text-style': ui.BOLD, - 'border-color': ui.GREY, -} - ui.display.clear() ui.display.backlight(255) @@ -33,7 +20,7 @@ bl_header('Install failed') ui.display.text(10, 53, 'Some error happend', ui.NORMAL, ui.WHITE, ui.BLACK) ui.display.text(10, 79, 'Sorry, try again maybe?', ui.NORMAL, ui.WHITE, ui.BLACK) -reboot = button.Button((0, 240 - 48, 240, 48), 'Reboot', normal_style=DEFAULT_BUTTON, active_style=DEFAULT_BUTTON_ACTIVE) +reboot = button.Button((0, 240 - 48, 240, 48), 'Reboot', normal_style=button.DEFAULT_BUTTON, active_style=button.DEFAULT_BUTTON_ACTIVE) reboot.render() while True: diff --git a/assets/ui-mockup/install_fw.py b/assets/ui-mockup/install_fw.py index 67b1e8c853..450aed7dab 100755 --- a/assets/ui-mockup/install_fw.py +++ b/assets/ui-mockup/install_fw.py @@ -7,31 +7,6 @@ from trezor import ui, res from trezor.ui import button from bl_common import bl_header -CONFIRM_BUTTON = { - 'bg-color': ui.GREEN, - 'fg-color': ui.LIGHT_GREEN, - 'text-style': ui.BOLD, - 'border-color': ui.GREEN, -} -CONFIRM_BUTTON_ACTIVE = { - 'bg-color': ui.GREEN, - 'fg-color': ui.WHITE, - 'text-style': ui.BOLD, - 'border-color': ui.GREEN, -} -CANCEL_BUTTON = { - 'bg-color': ui.RED, - 'fg-color': ui.LIGHT_RED, - 'text-style': ui.BOLD, - 'border-color': ui.RED, -} -CANCEL_BUTTON_ACTIVE = { - 'bg-color': ui.RED, - 'fg-color': ui.WHITE, - 'text-style': ui.BOLD, - 'border-color': ui.RED, -} - ui.display.clear() ui.display.backlight(255) @@ -56,9 +31,9 @@ def logo(): image = res.load('./res/sl_logo.toif') ui.display.image(60, 64, image) -confirm = button.Button((121, 240 - 48, 119, 48), 'Confirm', normal_style=CONFIRM_BUTTON, active_style=CONFIRM_BUTTON_ACTIVE) +confirm = button.Button((121, 240 - 48, 119, 48), 'Confirm', normal_style=button.CONFIRM_BUTTON, active_style=button.CONFIRM_BUTTON_ACTIVE) confirm.render() -cancel = button.Button((0, 240 - 48, 119, 48), 'Cancel', normal_style=CANCEL_BUTTON, active_style=CANCEL_BUTTON_ACTIVE) +cancel = button.Button((0, 240 - 48, 119, 48), 'Cancel', normal_style=button.CANCEL_BUTTON, active_style=button.CANCEL_BUTTON_ACTIVE) cancel.render() while True: diff --git a/assets/ui-mockup/install_fw_really.py b/assets/ui-mockup/install_fw_really.py index 596609e1df..05ae3950bf 100755 --- a/assets/ui-mockup/install_fw_really.py +++ b/assets/ui-mockup/install_fw_really.py @@ -2,23 +2,10 @@ import sys sys.path.append('../../src') -from trezor import ui, res +from trezor import ui from trezor.ui import button from bl_common import bl_header -CONFIRM_BUTTON = { - 'bg-color': ui.BLUE, - 'fg-color': ui.WHITE, - 'text-style': ui.BOLD, - 'border-color': ui.BLACK, -} -CONFIRM_BUTTON_ACTIVE = { - 'bg-color': ui.BLUE, - 'fg-color': ui.WHITE, - 'text-style': ui.BOLD, - 'border-color': ui.BLACK, -} - ui.display.clear() ui.display.backlight(255) @@ -33,7 +20,7 @@ ui.display.text(10, 129, 'due to different vendor', ui.NORMAL, ui.WHITE, ui.BLAC ui.display.text(10, 151, 'your storage will be', ui.NORMAL, ui.WHITE, ui.BLACK) ui.display.text(10, 174, 'wipped!', ui.NORMAL, ui.WHITE, ui.BLACK) -confirm = button.Button((0, 240 - 48, 240, 48), 'Hold to confirm', normal_style=CONFIRM_BUTTON, active_style=CONFIRM_BUTTON_ACTIVE) +confirm = button.Button((0, 240 - 48, 240, 48), 'Hold to confirm', normal_style=button.CONFIRM_BUTTON, active_style=button.CONFIRM_BUTTON_ACTIVE) confirm.render() while True: diff --git a/assets/ui-mockup/install_ok.py b/assets/ui-mockup/install_ok.py index e96eb24252..8009271b06 100755 --- a/assets/ui-mockup/install_ok.py +++ b/assets/ui-mockup/install_ok.py @@ -2,23 +2,10 @@ import sys sys.path.append('../../src') -from trezor import ui, res +from trezor import ui from trezor.ui import button from bl_common import bl_header -DEFAULT_BUTTON = { - 'bg-color': ui.DARK_GREY, - 'fg-color': ui.GREY, - 'text-style': ui.NORMAL, - 'border-color': ui.BLACK, -} -DEFAULT_BUTTON_ACTIVE = { - 'bg-color': ui.GREY, - 'fg-color': ui.WHITE, - 'text-style': ui.BOLD, - 'border-color': ui.GREY, -} - ui.display.clear() ui.display.backlight(255) @@ -30,7 +17,7 @@ bl_header('Install done') ui.display.text(10, 53, 'Success!', ui.NORMAL, ui.WHITE, ui.BLACK) ui.display.text(10, 79, 'Time to reboot', ui.NORMAL, ui.WHITE, ui.BLACK) -reboot = button.Button((0, 240 - 48, 240, 48), 'Reboot', normal_style=DEFAULT_BUTTON, active_style=DEFAULT_BUTTON_ACTIVE) +reboot = button.Button((0, 240 - 48, 240, 48), 'Reboot', normal_style=button.DEFAULT_BUTTON, active_style=button.DEFAULT_BUTTON_ACTIVE) reboot.render() while True: diff --git a/assets/ui-mockup/install_progress.py b/assets/ui-mockup/install_progress.py index c6bd85fdb5..e43f756630 100755 --- a/assets/ui-mockup/install_progress.py +++ b/assets/ui-mockup/install_progress.py @@ -2,7 +2,7 @@ import sys sys.path.append('../../src') -from trezor import ui, res +from trezor import ui from bl_common import bl_header ui.display.clear() @@ -16,7 +16,7 @@ ui.display.text_center(120, 192 + 32, "In progress ...", 1, ui.WHITE, ui.BLACK) p = 0 while True: - ui.display.loader(p, ui.BLUE, ui.BLACK) + ui.display.loader(p, 0, ui.BLUE, ui.BLACK) ui.display.text_center(120, 240 // 2 + 14 // 2, "%d%%" % (p // 10), 2, ui.WHITE, ui.BLACK) ui.display.refresh() diff --git a/assets/ui-mockup/install_u_fw.py b/assets/ui-mockup/install_u_fw.py index 038dd0aaf3..150f506e3e 100755 --- a/assets/ui-mockup/install_u_fw.py +++ b/assets/ui-mockup/install_u_fw.py @@ -2,35 +2,10 @@ import sys sys.path.append('../../src') -from trezor import ui, res +from trezor import ui from trezor.ui import button from bl_common import bl_header -CONFIRM_BUTTON = { - 'bg-color': ui.GREEN, - 'fg-color': ui.LIGHT_GREEN, - 'text-style': ui.BOLD, - 'border-color': ui.GREEN, -} -CONFIRM_BUTTON_ACTIVE = { - 'bg-color': ui.GREEN, - 'fg-color': ui.WHITE, - 'text-style': ui.BOLD, - 'border-color': ui.GREEN, -} -CANCEL_BUTTON = { - 'bg-color': ui.RED, - 'fg-color': ui.LIGHT_RED, - 'text-style': ui.BOLD, - 'border-color': ui.RED, -} -CANCEL_BUTTON_ACTIVE = { - 'bg-color': ui.RED, - 'fg-color': ui.WHITE, - 'text-style': ui.BOLD, - 'border-color': ui.RED, -} - ui.display.clear() ui.display.backlight(255) @@ -52,9 +27,9 @@ ui.display.text(15, s + 1 * 23, 'bc0ae1c2f715277f', ui.MONO, ui.GREY, ui.DARK_GR ui.display.text(15, s + 2 * 23, '22b67f26c15e1f75', ui.MONO, ui.GREY, ui.DARK_GREY) ui.display.text(15, s + 3 * 23, '43b2b44913b5c255', ui.MONO, ui.GREY, ui.DARK_GREY) -confirm = button.Button((121, 240 - 48, 119, 48), 'Confirm', normal_style=CONFIRM_BUTTON, active_style=CONFIRM_BUTTON_ACTIVE) +confirm = button.Button((121, 240 - 48, 119, 48), 'Confirm', normal_style=button.CONFIRM_BUTTON, active_style=button.CONFIRM_BUTTON_ACTIVE) confirm.render() -cancel = button.Button((0, 240 - 48, 119, 48), 'Cancel', normal_style=CANCEL_BUTTON, active_style=CANCEL_BUTTON_ACTIVE) +cancel = button.Button((0, 240 - 48, 119, 48), 'Cancel', normal_style=button.CANCEL_BUTTON, active_style=button.CANCEL_BUTTON_ACTIVE) cancel.render() while True: