Skip to content

Commit

Permalink
Merge branch 'generic_keyboardscreen' into final_word_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmukai committed Apr 25, 2022
2 parents 2f260ae + 8b2820a commit c41614e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/seedsigner/gui/screens/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,12 +935,14 @@ def __post_init__(self):

keyboard_start_y = text_entry_display_y + text_entry_display_height + GUIConstants.COMPONENT_PADDING
button_height = int((self.canvas_height - GUIConstants.EDGE_PADDING - text_entry_display_y - text_entry_display_height - GUIConstants.COMPONENT_PADDING - (self.rows - 1) * 2) / self.rows)

if self.keyboard_font_size:
font_size = self.keyboard_font_size
else:
# Scale with button height
font_size = button_height - GUIConstants.COMPONENT_PADDING
self.keyboard_digits = Keyboard(

self.keyboard = Keyboard(
draw=self.renderer.draw,
charset=self.keys_charset,
font_name=self.keyboard_font_name,
Expand All @@ -956,7 +958,7 @@ def __post_init__(self):
auto_wrap=[Keyboard.WRAP_LEFT, Keyboard.WRAP_RIGHT],
render_now=False
)
self.keyboard_digits.set_selected_key(selected_letter=self.keys_charset[0])
self.keyboard.set_selected_key(selected_letter=self.keys_charset[0])

self.text_entry_display = TextEntryDisplay(
canvas=self.renderer.canvas,
Expand All @@ -975,7 +977,7 @@ def __post_init__(self):
def _render(self):
super()._render()

self.keyboard_digits.render_keys()
self.keyboard.render_keys()
self.text_entry_display.render()

self.renderer.show_image()
Expand Down Expand Up @@ -1022,7 +1024,7 @@ def _run(self):
# ignore
continue

ret_val = self.keyboard_digits.update_from_input(input)
ret_val = self.keyboard.update_from_input(input)

# Now process the result from the keyboard
if ret_val in Keyboard.EXIT_DIRECTIONS:
Expand Down

0 comments on commit c41614e

Please sign in to comment.