src/trezor/ui/style: update resources and icons in dialogs
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
assets/cog.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/cross.png
Before Width: | Height: | Size: 1.1 KiB |
BIN
assets/receive.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/send.png
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
assets/wrong.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
@ -13,7 +13,7 @@ from apps.common.cache import get_state
|
||||
@ui.layout
|
||||
async def request_passphrase_entry(ctx):
|
||||
text = Text(
|
||||
'Enter passphrase', ui.ICON_DEFAULT,
|
||||
'Enter passphrase', ui.ICON_CONFIG,
|
||||
'Where to enter your', 'passphrase?')
|
||||
text.render()
|
||||
|
||||
@ -31,7 +31,7 @@ async def request_passphrase_entry(ctx):
|
||||
async def request_passphrase_ack(ctx, on_device):
|
||||
if not on_device:
|
||||
text = Text(
|
||||
'Passphrase entry', ui.ICON_DEFAULT,
|
||||
'Passphrase entry', ui.ICON_CONFIG,
|
||||
'Please, type passphrase', 'on connected host.')
|
||||
text.render()
|
||||
|
||||
|
@ -12,20 +12,20 @@ async def apply_settings(ctx, msg):
|
||||
|
||||
if msg.homescreen is not None:
|
||||
await require_confirm(ctx, Text(
|
||||
'Change homescreen', ui.ICON_DEFAULT,
|
||||
'Change homescreen', ui.ICON_CONFIG,
|
||||
'Do you really want to', 'change homescreen?'),
|
||||
code=ButtonRequestType.ProtectCall)
|
||||
|
||||
if msg.label is not None:
|
||||
await require_confirm(ctx, Text(
|
||||
'Change label', ui.ICON_DEFAULT,
|
||||
'Change label', ui.ICON_CONFIG,
|
||||
'Do you really want to', 'change label to',
|
||||
ui.BOLD, '%s?' % msg.label), # TODO: split label (bold) and '?' (normal) once we support mixed styles on one line
|
||||
code=ButtonRequestType.ProtectCall)
|
||||
|
||||
if msg.language is not None:
|
||||
await require_confirm(ctx, Text(
|
||||
'Change language', ui.ICON_DEFAULT,
|
||||
'Change language', ui.ICON_CONFIG,
|
||||
'Do you really want to', 'change language to',
|
||||
ui.BOLD, '%s?' % msg.language), # TODO: split lang (bold) and '?' (normal) once we support mixed styles on one line
|
||||
code=ButtonRequestType.ProtectCall)
|
||||
@ -33,7 +33,7 @@ async def apply_settings(ctx, msg):
|
||||
if msg.use_passphrase is not None:
|
||||
await require_confirm(ctx, Text(
|
||||
'Enable passphrase' if msg.use_passphrase else 'Disable passphrase',
|
||||
ui.ICON_DEFAULT,
|
||||
ui.ICON_CONFIG,
|
||||
'Do you really want to',
|
||||
'enable passphrase' if msg.use_passphrase else 'disable passphrase',
|
||||
'encryption?'),
|
||||
|
@ -45,19 +45,19 @@ def confirm_change_pin(ctx, msg):
|
||||
|
||||
if msg.remove and has_pin: # removing pin
|
||||
return require_confirm(ctx, Text(
|
||||
'Remove PIN', ui.ICON_DEFAULT,
|
||||
'Remove PIN', ui.ICON_CONFIG,
|
||||
'Do you really want to', ui.BOLD,
|
||||
'remove current PIN?'))
|
||||
|
||||
if not msg.remove and has_pin: # changing pin
|
||||
return require_confirm(ctx, Text(
|
||||
'Change PIN', ui.ICON_DEFAULT,
|
||||
'Change PIN', ui.ICON_CONFIG,
|
||||
'Do you really want to', ui.BOLD,
|
||||
'change current PIN?'))
|
||||
|
||||
if not msg.remove and not has_pin: # setting new pin
|
||||
return require_confirm(ctx, Text(
|
||||
'Change PIN', ui.ICON_DEFAULT,
|
||||
'Change PIN', ui.ICON_CONFIG,
|
||||
'Do you really want to', ui.BOLD,
|
||||
'set new PIN?'))
|
||||
|
||||
@ -85,10 +85,10 @@ async def request_pin_confirm(ctx, *args, **kwargs):
|
||||
@ui.layout
|
||||
async def pin_mismatch():
|
||||
text = Text(
|
||||
'PIN mismatch', ui.ICON_DEFAULT,
|
||||
'PIN mismatch', ui.ICON_WRONG,
|
||||
'Entered PINs do not',
|
||||
'match each other.',
|
||||
'',
|
||||
'Please, try again...')
|
||||
'Please, try again...', icon_color=ui.RED)
|
||||
text.render()
|
||||
await loop.sleep(3 * 1000 * 1000)
|
||||
|
@ -111,7 +111,7 @@ async def show_warning(ctx):
|
||||
|
||||
async def show_wrong_entry(ctx):
|
||||
content = Text(
|
||||
'Wrong entry!', ui.ICON_CLEAR,
|
||||
'Wrong entry!', ui.ICON_WRONG,
|
||||
'You have entered',
|
||||
'wrong seed word.',
|
||||
'Please check again.', icon_color=ui.RED)
|
||||
|
@ -30,7 +30,7 @@ async def get_address(ctx, msg):
|
||||
|
||||
async def _show_address(ctx, address: str):
|
||||
lines = _split_address(address)
|
||||
content = Text('Confirm address', ui.ICON_DEFAULT, ui.MONO, *lines)
|
||||
content = Text('Confirm address', ui.ICON_RECEIVE, ui.MONO, *lines, icon_color=ui.GREEN)
|
||||
return await confirm(
|
||||
ctx,
|
||||
content,
|
||||
@ -49,7 +49,7 @@ async def _show_qr(ctx, address: str, script_type: int):
|
||||
|
||||
content = Container(
|
||||
Qr(address, (qr_x, qr_y), qr_coef),
|
||||
Text('Confirm address', ui.ICON_DEFAULT, ui.MONO))
|
||||
Text('Confirm address', ui.ICON_RECEIVE, ui.MONO, icon_color=ui.GREEN))
|
||||
return await confirm(
|
||||
ctx,
|
||||
content,
|
||||
|
@ -25,30 +25,30 @@ async def confirm_output(ctx, output, coin):
|
||||
data = hexlify(output.op_return_data).decode()
|
||||
if len(data) >= 18 * 5:
|
||||
data = data[:(18 * 5 - 3)] + '...'
|
||||
content = Text('OP_RETURN', ui.ICON_DEFAULT,
|
||||
ui.MONO, *split_op_return(data))
|
||||
content = Text('OP_RETURN', ui.ICON_SEND,
|
||||
ui.MONO, *split_op_return(data), icon_color=ui.GREEN)
|
||||
else:
|
||||
address = output.address
|
||||
content = Text('Confirm sending', ui.ICON_DEFAULT,
|
||||
content = Text('Confirm sending', ui.ICON_SEND,
|
||||
ui.NORMAL, format_coin_amount(output.amount, coin) + ' to',
|
||||
ui.MONO, *split_address(address))
|
||||
ui.MONO, *split_address(address), icon_color=ui.GREEN)
|
||||
return await confirm(ctx, content, ButtonRequestType.ConfirmOutput)
|
||||
|
||||
|
||||
async def confirm_total(ctx, spending, fee, coin):
|
||||
content = Text('Confirm transaction', ui.ICON_DEFAULT,
|
||||
content = Text('Confirm transaction', ui.ICON_SEND,
|
||||
'Total amount:',
|
||||
ui.BOLD, format_coin_amount(spending, coin),
|
||||
ui.NORMAL, 'including fee:',
|
||||
ui.BOLD, format_coin_amount(fee, coin))
|
||||
ui.BOLD, format_coin_amount(fee, coin), icon_color=ui.GREEN)
|
||||
return await hold_to_confirm(ctx, content, ButtonRequestType.SignTx)
|
||||
|
||||
|
||||
async def confirm_feeoverthreshold(ctx, fee, coin):
|
||||
content = Text('High fee', ui.ICON_DEFAULT,
|
||||
content = Text('High fee', ui.ICON_SEND,
|
||||
'The fee of',
|
||||
ui.BOLD, format_coin_amount(fee, coin),
|
||||
ui.NORMAL, 'is unexpectedly high.',
|
||||
'Continue?')
|
||||
'Continue?', icon_color=ui.GREEN)
|
||||
|
||||
return await confirm(ctx, content, ButtonRequestType.FeeOverThreshold)
|
||||
|
BIN
src/trezor/res/header_icons/cog.toig
Normal file
BIN
src/trezor/res/header_icons/receive.toig
Normal file
BIN
src/trezor/res/header_icons/send.toig
Normal file
BIN
src/trezor/res/header_icons/wrong.toig
Normal file
@ -128,7 +128,7 @@ def header(title: str,
|
||||
bg: int=BG,
|
||||
ifg: int=BG):
|
||||
if icon is not None:
|
||||
display.icon(14, 17, res.load(icon), ifg, bg)
|
||||
display.icon(14, 15, res.load(icon), ifg, bg)
|
||||
display.text(44, 35, title, BOLD, fg, bg)
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@ from trezor.ui.loader import Loader
|
||||
CONFIRMED = const(1)
|
||||
CANCELLED = const(2)
|
||||
DEFAULT_CONFIRM = res.load(ui.ICON_CONFIRM)
|
||||
DEFAULT_CANCEL = res.load(ui.ICON_CLEAR)
|
||||
DEFAULT_CANCEL = res.load(ui.ICON_CANCEL)
|
||||
|
||||
|
||||
class ConfirmDialog(Widget):
|
||||
|
@ -45,18 +45,23 @@ BG = BLACK
|
||||
FG = WHITE
|
||||
|
||||
# icons
|
||||
ICON_DEFAULT = 'trezor/res/header_icons/reset.toig'
|
||||
ICON_RESET = 'trezor/res/header_icons/reset.toig'
|
||||
ICON_WIPE = 'trezor/res/header_icons/wipe.toig'
|
||||
ICON_RECOVERY = 'trezor/res/recovery.toig'
|
||||
ICON_CLEAR = 'trezor/res/cross2.toig'
|
||||
ICON_CONFIRM = 'trezor/res/confirm2.toig'
|
||||
ICON_CONFIRM2 = 'trezor/res/confirm.toig'
|
||||
ICON_RECOVERY = 'trezor/res/header_icons/recovery.toig'
|
||||
ICON_NOCOPY = 'trezor/res/header_icons/nocopy.toig'
|
||||
ICON_WRONG = 'trezor/res/header_icons/wrong.toig'
|
||||
ICON_CONFIG = 'trezor/res/header_icons/cog.toig'
|
||||
ICON_RECEIVE = 'trezor/res/header_icons/receive.toig'
|
||||
ICON_SEND = 'trezor/res/header_icons/send.toig'
|
||||
|
||||
ICON_DEFAULT = ICON_CONFIG
|
||||
|
||||
ICON_CANCEL = 'trezor/res/cancel.toig'
|
||||
ICON_CONFIRM = 'trezor/res/confirm.toig'
|
||||
ICON_LOCK = 'trezor/res/lock.toig'
|
||||
ICON_CLICK = 'trezor/res/click.toig'
|
||||
ICON_BACK = 'trezor/res/left.toig'
|
||||
ICON_NOCOPY = 'trezor/res/nocopy.toig'
|
||||
ICON_SWIPE = 'trezor/res/swipedown.toig'
|
||||
ICON_SWIPE = 'trezor/res/swipe.toig'
|
||||
ICON_CHECK = 'trezor/res/check.toig'
|
||||
ICON_SPACE = 'trezor/res/space.toig'
|
||||
|
||||
|