system/ui: fix Wi-Fi conneciton flow for open networks (#35285)

fix Wi-Fi conneciton flow for open networks
pull/35286/head
Dean Lee 1 week ago committed by GitHub
parent 6eecb4f986
commit 41db0557e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      system/ui/widgets/network.py

@ -150,21 +150,24 @@ class WifiManagerUI:
self._draw_signal_strength_icon(signal_icon_rect, network)
if isinstance(self.state, StateIdle) and rl.check_collision_point_rec(rl.get_mouse_position(), ssid_rect) and clicked:
if not network.is_saved:
if not network.is_saved and network.security_type != SecurityType.OPEN:
self.state = StateNeedsAuth(network)
elif not network.is_connected:
self.connect_to_network(network)
def _draw_status_icon(self, rect, network: NetworkInfo):
"""Draw the status icon based on network's connection state"""
icon_file = ""
icon_file = None
if network.is_connected:
icon_file = "icons/checkmark.png"
elif network.security_type == SecurityType.UNSUPPORTED:
icon_file = "icons/circled_slash.png"
else:
elif network.security_type != SecurityType.OPEN:
icon_file = "icons/lock_closed.png"
if not icon_file:
return
texture = gui_app.texture(icon_file, ICON_SIZE, ICON_SIZE)
icon_rect = rl.Vector2(rect.x, rect.y + (ICON_SIZE - texture.height) / 2)
rl.draw_texture_v(texture, icon_rect, rl.WHITE)

Loading…
Cancel
Save