system/ui: set keyboard to use full window area (#35181)

set keyboard to use full window area
pull/35184/head
Dean Lee 1 week ago committed by GitHub
parent bfadab078e
commit e62b6a38e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      system/ui/widgets/keyboard.py
  2. 2
      system/ui/widgets/network.py

@ -1,8 +1,10 @@
import pyray as rl
from openpilot.system.ui.lib.application import gui_app
from openpilot.system.ui.lib.button import gui_button
from openpilot.system.ui.lib.label import gui_label
# Constants for special keys
CONTENT_MARGIN = 50
BACKSPACE_KEY = "<-"
ENTER_KEY = "Enter"
SPACE_KEY = " "
@ -55,7 +57,8 @@ class Keyboard:
self._clear()
return result
def render(self, rect, title, sub_title):
def render(self, title, sub_title):
rect = rl.Rectangle(CONTENT_MARGIN, CONTENT_MARGIN, gui_app.width - 2 * CONTENT_MARGIN, gui_app.height - 2 * CONTENT_MARGIN)
gui_label(rl.Rectangle(rect.x, rect.y, rect.width, 95), title, 90)
gui_label(rl.Rectangle(rect.x, rect.y + 95, rect.width, 60), sub_title, 55, rl.GRAY)
if gui_button(rl.Rectangle(rect.x + rect.width - 300, rect.y, 300, 100), "Cancel"):

@ -62,7 +62,7 @@ class WifiManagerUI:
match self.state:
case StateNeedsAuth(network):
result = self.keyboard.render(rect, "Enter password", f"for {network.ssid}")
result = self.keyboard.render("Enter password", f"for {network.ssid}")
if result == 1:
self.connect_to_network(network, self.keyboard.text)
elif result == 0:

Loading…
Cancel
Save