src/trezor/ui/passphrase: added space btn icon to keyboard

This commit is contained in:
Peter Jensen 2018-02-11 14:09:54 +01:00
parent 34c6fb987a
commit a83d7b9067
4 changed files with 8 additions and 3 deletions

BIN
assets/space.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

BIN
src/trezor/res/space.toig Normal file

Binary file not shown.

View File

@ -4,11 +4,12 @@ from trezor.ui import display
from trezor.ui.button import BTN_CLICKED, ICON, Button
from trezor.ui.swipe import SWIPE_HORIZONTAL, SWIPE_LEFT, SWIPE_RIGHT, Swipe
SPACE = res.load(ui.ICON_SPACE)
KEYBOARD_KEYS = (
('1', '2', '3', '4', '5', '6', '7', '8', '9', '0'),
(' ', 'abc', 'def', 'ghi', 'jkl', 'mno', 'pqrs', 'tuv', 'wxyz', '*#'),
(' ', 'ABC', 'DEF', 'GHI', 'JKL', 'MNO', 'PQRS', 'TUV', 'WXYZ', '*#'),
(SPACE, 'abc', 'def', 'ghi', 'jkl', 'mno', 'pqrs', 'tuv', 'wxyz', '*#'),
(SPACE, 'ABC', 'DEF', 'GHI', 'JKL', 'MNO', 'PQRS', 'TUV', 'WXYZ', '*#'),
('_', '.', '/', '!', '+', '-', '?', ',', ';', '$'))
@ -127,7 +128,10 @@ class PassphraseKeyboard(ui.Widget):
content = content[:-1] + btn.content[index]
else:
index = 0
content += btn.content[0]
if isinstance(btn.content[0], str):
content += btn.content[0]
else:
content += ' '
self.edit(content, btn, index)
return

View File

@ -57,6 +57,7 @@ ICON_BACK = 'trezor/res/left.toig'
ICON_NOCOPY = 'trezor/res/nocopy.toig'
ICON_SWIPE = 'trezor/res/swipedown.toig'
ICON_CHECK = 'trezor/res/check.toig'
ICON_SPACE = 'trezor/res/space.toig'
# buttons
BTN_DEFAULT = {