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