mirror of
https://github.com/SeedSigner/seedsigner.git
synced 2026-09-14 04:45:08 +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 = {
|
||||
"code": "DEL",
|
||||
"letter": SeedSignerIconConstants.DELETE,
|
||||
"font": ICON_KEY_FONT,
|
||||
"size": 2,
|
||||
"letter": SeedSignerIconConstants.DELETE,
|
||||
"font": ICON_KEY_FONT,
|
||||
"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 = {
|
||||
"code": "SPACE",
|
||||
|
||||
@@ -1129,6 +1129,8 @@ class KeyboardScreen(BaseTopNavScreen):
|
||||
return_after_n_chars: int = None
|
||||
show_save_button: bool = False
|
||||
initial_value: str = ""
|
||||
from dataclasses import dataclass, field
|
||||
custom_additional_keys: dict = field(default_factory=lambda: Keyboard.ADDITIONAL_KEYS)
|
||||
|
||||
def __post_init__(self):
|
||||
if self.keyboard_font_size is None:
|
||||
@@ -1187,6 +1189,7 @@ class KeyboardScreen(BaseTopNavScreen):
|
||||
GUIConstants.EDGE_PADDING + self.keyboard_width,
|
||||
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],
|
||||
render_now=False
|
||||
)
|
||||
|
||||
@@ -60,6 +60,7 @@ class SeedMnemonicEntryScreen(BaseTopNavScreen):
|
||||
GUIConstants.EDGE_PADDING + self.keyboard_width,
|
||||
self.canvas_height
|
||||
),
|
||||
additional_keys=[Keyboard.KEY_BACKSPACE_4],
|
||||
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT]
|
||||
)
|
||||
|
||||
@@ -547,6 +548,7 @@ class SeedBIP85SelectChildIndexScreen(KeyboardScreen):
|
||||
self.cols = 5
|
||||
self.keys_charset = "0123456789"
|
||||
self.show_save_button = True
|
||||
self.custom_additional_keys = [Keyboard.KEY_BACKSPACE_5]
|
||||
|
||||
super().__post_init__()
|
||||
|
||||
@@ -579,6 +581,7 @@ class SeedExportXpubCustomDerivationScreen(KeyboardScreen):
|
||||
self.cols = 6
|
||||
self.keys_charset = "/'0123456789"
|
||||
self.show_save_button = True
|
||||
self.custom_additional_keys = [Keyboard.KEY_BACKSPACE_6]
|
||||
|
||||
super().__post_init__()
|
||||
|
||||
@@ -757,7 +760,7 @@ class SeedAddPassphraseScreen(BaseTopNavScreen):
|
||||
Keyboard.KEY_SPACE_2,
|
||||
Keyboard.KEY_CURSOR_LEFT,
|
||||
Keyboard.KEY_CURSOR_RIGHT,
|
||||
Keyboard.KEY_BACKSPACE
|
||||
Keyboard.KEY_BACKSPACE_2
|
||||
],
|
||||
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT],
|
||||
render_now=False
|
||||
@@ -778,7 +781,7 @@ class SeedAddPassphraseScreen(BaseTopNavScreen):
|
||||
Keyboard.KEY_SPACE_2,
|
||||
Keyboard.KEY_CURSOR_LEFT,
|
||||
Keyboard.KEY_CURSOR_RIGHT,
|
||||
Keyboard.KEY_BACKSPACE
|
||||
Keyboard.KEY_BACKSPACE_2
|
||||
],
|
||||
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT],
|
||||
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.hardware.buttons import HardwareButtonsConstants
|
||||
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):
|
||||
# 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.custom_additional_keys = [Keyboard.KEY_BACKSPACE]
|
||||
|
||||
# Specify the keys in the keyboard
|
||||
self.rows = 3
|
||||
@@ -226,6 +228,7 @@ class ToolsCoinFlipEntryScreen(KeyboardScreen):
|
||||
# Override values set by the parent class
|
||||
# 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.custom_additional_keys = [Keyboard.KEY_BACKSPACE_2]
|
||||
|
||||
# Specify the keys in the keyboard
|
||||
self.rows = 1
|
||||
|
||||
Reference in New Issue
Block a user