mirror of
https://github.com/SeedSigner/seedsigner.git
synced 2026-10-05 15:08:25 +00:00
Merge pull request #603 from fedebuyito/resolves_issue_555
Resolves issue 555 - Improve UX navigating across DEL button (expanding it)
This commit is contained in:
@@ -34,10 +34,34 @@ class Keyboard:
|
|||||||
|
|
||||||
KEY_BACKSPACE = {
|
KEY_BACKSPACE = {
|
||||||
"code": "DEL",
|
"code": "DEL",
|
||||||
"letter": SeedSignerIconConstants.DELETE,
|
"letter": SeedSignerIconConstants.DELETE,
|
||||||
"font": ICON_KEY_FONT,
|
"font": ICON_KEY_FONT,
|
||||||
"size": 2,
|
"size": 3,
|
||||||
}
|
}
|
||||||
|
KEY_BACKSPACE_2 = {
|
||||||
|
"code": "DEL",
|
||||||
|
"letter": SeedSignerIconConstants.DELETE,
|
||||||
|
"font": ICON_KEY_FONT,
|
||||||
|
"size": 2,
|
||||||
|
}
|
||||||
|
KEY_BACKSPACE_4 = {
|
||||||
|
"code": "DEL",
|
||||||
|
"letter": SeedSignerIconConstants.DELETE,
|
||||||
|
"font": ICON_KEY_FONT,
|
||||||
|
"size": 4,
|
||||||
|
}
|
||||||
|
KEY_BACKSPACE_5 = {
|
||||||
|
"code": "DEL",
|
||||||
|
"letter": SeedSignerIconConstants.DELETE,
|
||||||
|
"font": ICON_KEY_FONT,
|
||||||
|
"size": 5,
|
||||||
|
}
|
||||||
|
KEY_BACKSPACE_6 = {
|
||||||
|
"code": "DEL",
|
||||||
|
"letter": SeedSignerIconConstants.DELETE,
|
||||||
|
"font": ICON_KEY_FONT,
|
||||||
|
"size": 6,
|
||||||
|
}
|
||||||
|
|
||||||
KEY_SPACE = {
|
KEY_SPACE = {
|
||||||
"code": "SPACE",
|
"code": "SPACE",
|
||||||
|
|||||||
@@ -1129,6 +1129,8 @@ class KeyboardScreen(BaseTopNavScreen):
|
|||||||
return_after_n_chars: int = None
|
return_after_n_chars: int = None
|
||||||
show_save_button: bool = False
|
show_save_button: bool = False
|
||||||
initial_value: str = ""
|
initial_value: str = ""
|
||||||
|
from dataclasses import dataclass, field
|
||||||
|
custom_additional_keys: dict = field(default_factory=lambda: Keyboard.ADDITIONAL_KEYS)
|
||||||
|
|
||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
if self.keyboard_font_size is None:
|
if self.keyboard_font_size is None:
|
||||||
@@ -1187,6 +1189,7 @@ class KeyboardScreen(BaseTopNavScreen):
|
|||||||
GUIConstants.EDGE_PADDING + self.keyboard_width,
|
GUIConstants.EDGE_PADDING + self.keyboard_width,
|
||||||
keyboard_start_y + self.rows * self.key_height + (self.rows - 1) * 2
|
keyboard_start_y + self.rows * self.key_height + (self.rows - 1) * 2
|
||||||
),
|
),
|
||||||
|
additional_keys=self.custom_additional_keys,
|
||||||
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT],
|
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT],
|
||||||
render_now=False
|
render_now=False
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ class SeedMnemonicEntryScreen(BaseTopNavScreen):
|
|||||||
GUIConstants.EDGE_PADDING + self.keyboard_width,
|
GUIConstants.EDGE_PADDING + self.keyboard_width,
|
||||||
self.canvas_height
|
self.canvas_height
|
||||||
),
|
),
|
||||||
|
additional_keys=[Keyboard.KEY_BACKSPACE_4],
|
||||||
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT]
|
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -547,6 +548,7 @@ class SeedBIP85SelectChildIndexScreen(KeyboardScreen):
|
|||||||
self.cols = 5
|
self.cols = 5
|
||||||
self.keys_charset = "0123456789"
|
self.keys_charset = "0123456789"
|
||||||
self.show_save_button = True
|
self.show_save_button = True
|
||||||
|
self.custom_additional_keys = [Keyboard.KEY_BACKSPACE_5]
|
||||||
|
|
||||||
super().__post_init__()
|
super().__post_init__()
|
||||||
|
|
||||||
@@ -579,6 +581,7 @@ class SeedExportXpubCustomDerivationScreen(KeyboardScreen):
|
|||||||
self.cols = 6
|
self.cols = 6
|
||||||
self.keys_charset = "/'0123456789"
|
self.keys_charset = "/'0123456789"
|
||||||
self.show_save_button = True
|
self.show_save_button = True
|
||||||
|
self.custom_additional_keys = [Keyboard.KEY_BACKSPACE_6]
|
||||||
|
|
||||||
super().__post_init__()
|
super().__post_init__()
|
||||||
|
|
||||||
@@ -757,7 +760,7 @@ class SeedAddPassphraseScreen(BaseTopNavScreen):
|
|||||||
Keyboard.KEY_SPACE_2,
|
Keyboard.KEY_SPACE_2,
|
||||||
Keyboard.KEY_CURSOR_LEFT,
|
Keyboard.KEY_CURSOR_LEFT,
|
||||||
Keyboard.KEY_CURSOR_RIGHT,
|
Keyboard.KEY_CURSOR_RIGHT,
|
||||||
Keyboard.KEY_BACKSPACE
|
Keyboard.KEY_BACKSPACE_2
|
||||||
],
|
],
|
||||||
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT],
|
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT],
|
||||||
render_now=False
|
render_now=False
|
||||||
@@ -778,7 +781,7 @@ class SeedAddPassphraseScreen(BaseTopNavScreen):
|
|||||||
Keyboard.KEY_SPACE_2,
|
Keyboard.KEY_SPACE_2,
|
||||||
Keyboard.KEY_CURSOR_LEFT,
|
Keyboard.KEY_CURSOR_LEFT,
|
||||||
Keyboard.KEY_CURSOR_RIGHT,
|
Keyboard.KEY_CURSOR_RIGHT,
|
||||||
Keyboard.KEY_BACKSPACE
|
Keyboard.KEY_BACKSPACE_2
|
||||||
],
|
],
|
||||||
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT],
|
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT],
|
||||||
render_now=False
|
render_now=False
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ from seedsigner.gui.components import FontAwesomeIconConstants, Fonts, GUIConsta
|
|||||||
from seedsigner.gui.screens.screen import RET_CODE__BACK_BUTTON, BaseScreen, ButtonListScreen, ButtonOption, KeyboardScreen
|
from seedsigner.gui.screens.screen import RET_CODE__BACK_BUTTON, BaseScreen, ButtonListScreen, ButtonOption, KeyboardScreen
|
||||||
from seedsigner.hardware.buttons import HardwareButtonsConstants
|
from seedsigner.hardware.buttons import HardwareButtonsConstants
|
||||||
from seedsigner.models.settings_definition import SettingsConstants, SettingsDefinition
|
from seedsigner.models.settings_definition import SettingsConstants, SettingsDefinition
|
||||||
|
from seedsigner.gui.keyboard import Keyboard
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -163,6 +164,7 @@ class ToolsDiceEntropyEntryScreen(KeyboardScreen):
|
|||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
# TRANSLATOR_NOTE: current roll number vs total rolls (e.g. roll 7 of 50)
|
# TRANSLATOR_NOTE: current roll number vs total rolls (e.g. roll 7 of 50)
|
||||||
self.title = _("Dice Roll {}/{}").format(1, self.return_after_n_chars)
|
self.title = _("Dice Roll {}/{}").format(1, self.return_after_n_chars)
|
||||||
|
self.custom_additional_keys = [Keyboard.KEY_BACKSPACE]
|
||||||
|
|
||||||
# Specify the keys in the keyboard
|
# Specify the keys in the keyboard
|
||||||
self.rows = 3
|
self.rows = 3
|
||||||
@@ -226,6 +228,7 @@ class ToolsCoinFlipEntryScreen(KeyboardScreen):
|
|||||||
# Override values set by the parent class
|
# Override values set by the parent class
|
||||||
# TRANSLATOR_NOTE: current coin-flip number vs total flips (e.g. flip 3 of 4)
|
# TRANSLATOR_NOTE: current coin-flip number vs total flips (e.g. flip 3 of 4)
|
||||||
self.title = _("Coin Flip {}/{}").format(1, self.return_after_n_chars)
|
self.title = _("Coin Flip {}/{}").format(1, self.return_after_n_chars)
|
||||||
|
self.custom_additional_keys = [Keyboard.KEY_BACKSPACE_2]
|
||||||
|
|
||||||
# Specify the keys in the keyboard
|
# Specify the keys in the keyboard
|
||||||
self.rows = 1
|
self.rows = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user