From 7334ea1970f0b26555a2d90e330f82be9c8e3c9f Mon Sep 17 00:00:00 2001 From: fedebuyito <126606287+fedebuyito@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:24:22 -0300 Subject: [PATCH 1/5] solves issue #555 (Update keyboard.py) Growning "del" button size property (from 2 to 3) solves navigation issue ("6th dice" -> "del"). solves issue #555 --- src/seedsigner/gui/keyboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/seedsigner/gui/keyboard.py b/src/seedsigner/gui/keyboard.py index 96f834415..e09f0acc0 100644 --- a/src/seedsigner/gui/keyboard.py +++ b/src/seedsigner/gui/keyboard.py @@ -31,7 +31,7 @@ class Keyboard: "code": "DEL", "letter": "del", "font": COMPACT_KEY_FONT, - "size": 2, + "size": 3, } KEY_SPACE = { "code": "SPACE", From 37ed4a0510e4c1b5a8bb156c3258ce52bd0992eb Mon Sep 17 00:00:00 2001 From: fedebuyito <126606287+fedebuyito@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:12:18 -0300 Subject: [PATCH 2/5] Update keyboard.py Additional differents sizes "del" buttons --- src/seedsigner/gui/keyboard.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/seedsigner/gui/keyboard.py b/src/seedsigner/gui/keyboard.py index e09f0acc0..a094f8e18 100644 --- a/src/seedsigner/gui/keyboard.py +++ b/src/seedsigner/gui/keyboard.py @@ -33,6 +33,30 @@ class Keyboard: "font": COMPACT_KEY_FONT, "size": 3, } + KEY_BACKSPACE_2 = { + "code": "DEL", + "letter": "del", + "font": COMPACT_KEY_FONT, + "size": 2, + } + KEY_BACKSPACE_4 = { + "code": "DEL", + "letter": "del", + "font": COMPACT_KEY_FONT, + "size": 4, + } + KEY_BACKSPACE_5 = { + "code": "DEL", + "letter": "del", + "font": COMPACT_KEY_FONT, + "size": 5, + } + KEY_BACKSPACE_6 = { + "code": "DEL", + "letter": "del", + "font": COMPACT_KEY_FONT, + "size": 6, + } KEY_SPACE = { "code": "SPACE", "letter": "space", From 939114a53244ffbc094d90d1ac280a07deb5575b Mon Sep 17 00:00:00 2001 From: fedebuyito <126606287+fedebuyito@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:18:49 -0300 Subject: [PATCH 3/5] Update screen.py new custom_additional_keys prop on KeyboardScreen class for can to change additional button (KEY_BACKSPACE) on its childs classes --- src/seedsigner/gui/screens/screen.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/seedsigner/gui/screens/screen.py b/src/seedsigner/gui/screens/screen.py index a77997ab2..fc1d5e8ea 100644 --- a/src/seedsigner/gui/screens/screen.py +++ b/src/seedsigner/gui/screens/screen.py @@ -1051,6 +1051,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): super().__post_init__() @@ -1106,6 +1108,7 @@ def __post_init__(self): 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 ) From 508a326e400cb0bc7d18419fae700253b03463dd Mon Sep 17 00:00:00 2001 From: fedebuyito <126606287+fedebuyito@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:30:22 -0300 Subject: [PATCH 4/5] Update seed_screens.py Changing KEY_BACKSPACE size on BIP39, SeedBIP85, SeedCustomDerivation, symbols_1, symbols_2 screens --- src/seedsigner/gui/screens/seed_screens.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/seedsigner/gui/screens/seed_screens.py b/src/seedsigner/gui/screens/seed_screens.py index 64fb7ea98..2fc669873 100644 --- a/src/seedsigner/gui/screens/seed_screens.py +++ b/src/seedsigner/gui/screens/seed_screens.py @@ -50,6 +50,7 @@ def __post_init__(self): GUIConstants.EDGE_PADDING + self.keyboard_width, self.canvas_height ), + additional_keys=[Keyboard.KEY_BACKSPACE_4], auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT] ) @@ -540,6 +541,7 @@ def __post_init__(self): self.cols = 5 self.keys_charset = "0123456789" self.show_save_button = True + self.custom_additional_keys = [Keyboard.KEY_BACKSPACE_5] super().__post_init__() @@ -572,6 +574,7 @@ def __post_init__(self): self.cols = 6 self.keys_charset = "/'0123456789" self.show_save_button = True + self.custom_additional_keys = [Keyboard.KEY_BACKSPACE_6] super().__post_init__() @@ -741,7 +744,7 @@ def __post_init__(self): 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 @@ -762,7 +765,7 @@ def __post_init__(self): 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 From bab88097b4ad487ea833be222919e4ec101c8e93 Mon Sep 17 00:00:00 2001 From: fedebuyito <126606287+fedebuyito@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:52:05 -0300 Subject: [PATCH 5/5] Update tools_screens.py Changing KEY_BACKSPACE size on ToolsDiceEntropy and ToolsCoinFlip screens --- src/seedsigner/gui/screens/tools_screens.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/seedsigner/gui/screens/tools_screens.py b/src/seedsigner/gui/screens/tools_screens.py index 13fa33beb..1b57ecf77 100644 --- a/src/seedsigner/gui/screens/tools_screens.py +++ b/src/seedsigner/gui/screens/tools_screens.py @@ -129,6 +129,7 @@ class ToolsDiceEntropyEntryScreen(KeyboardScreen): def __post_init__(self): # Override values set by the parent class self.title = f"Dice Roll 1/{self.return_after_n_chars}" + self.custom_additional_keys = [Keyboard.KEY_BACKSPACE] # Specify the keys in the keyboard self.rows = 3 @@ -187,7 +188,8 @@ class ToolsCoinFlipEntryScreen(KeyboardScreen): def __post_init__(self): # Override values set by the parent class self.title = f"Coin Flip 1/{self.return_after_n_chars}" - + self.custom_additional_keys = [Keyboard.KEY_BACKSPACE_2] + # Specify the keys in the keyboard self.rows = 1 self.cols = 4