raylib: speed up network panel first load (#36062)

* debug

* debug

* clean up
pull/36065/head
Shane Smiskol 1 week ago committed by GitHub
parent 2dc0f97c93
commit 7a2f2ddf32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      system/ui/widgets/network.py

@ -44,6 +44,7 @@ class WifiManagerUI(Widget):
self.btn_width: int = 200
self.scroll_panel = GuiScrollPanel()
self.keyboard = Keyboard(max_text_size=MAX_PASSWORD_LENGTH, min_text_size=MIN_PASSWORD_LENGTH, show_password_toggle=True)
self._load_icons()
self._networks: list[NetworkInfo] = []
self._networks_buttons: dict[str, Button] = {}
@ -64,6 +65,10 @@ class WifiManagerUI(Widget):
self.wifi_manager.start()
self.wifi_manager.connect()
def _load_icons(self):
for icon in STRENGTH_ICONS + ["icons/checkmark.png", "icons/circled_slash.png", "icons/lock_closed.png"]:
gui_app.texture(icon, ICON_SIZE, ICON_SIZE)
def _render(self, rect: rl.Rectangle):
with self._lock:
if not self._networks:

Loading…
Cancel
Save