fix hide event

pull/36039/head
Shane Smiskol 6 days ago
parent 234b635965
commit c6b7a71fc2
  1. 15
      selfdrive/ui/layouts/main.py
  2. 13
      selfdrive/ui/layouts/settings/settings.py
  3. 2
      system/ui/lib/wifi_manager_v2.py

@ -63,14 +63,25 @@ class MainLayout(Widget):
# Don't hide sidebar from interactive timeout # Don't hide sidebar from interactive timeout
if self._current_mode != MainState.ONROAD: if self._current_mode != MainState.ONROAD:
self._sidebar.set_visible(False) self._sidebar.set_visible(False)
self._current_mode = MainState.ONROAD
# TODO: helper
if self._current_mode != MainState.ONROAD:
self._layouts[self._current_mode].hide_event()
self._current_mode = MainState.ONROAD
self._layouts[self._current_mode].show_event()
else: else:
self._current_mode = MainState.HOME if self._current_mode != MainState.HOME:
self._layouts[self._current_mode].hide_event()
self._current_mode = MainState.HOME
self._layouts[self._current_mode].show_event()
self._sidebar.set_visible(True) self._sidebar.set_visible(True)
def open_settings(self, panel_type: PanelType): def open_settings(self, panel_type: PanelType):
self._layouts[MainState.SETTINGS].set_current_panel(panel_type) self._layouts[MainState.SETTINGS].set_current_panel(panel_type)
self._layouts[self._current_mode].hide_event()
self._current_mode = MainState.SETTINGS self._current_mode = MainState.SETTINGS
self._layouts[self._current_mode].show_event()
self._sidebar.set_visible(False) self._sidebar.set_visible(False)
def _on_settings_clicked(self): def _on_settings_clicked(self):

@ -166,6 +166,13 @@ class SettingsLayout(Widget):
self._current_panel = panel_type self._current_panel = panel_type
self._panels[self._current_panel].instance.show_event() self._panels[self._current_panel].instance.show_event()
def close_settings(self): def hide_event(self):
if self._close_callback: for panel_info in self._panels.values():
self._close_callback() panel_info.instance.hide_event()
# def close_settings(self):
# print("Closing settings")
# self.hide_event()
#
# if self._close_callback:
# self._close_callback()

@ -205,6 +205,7 @@ class WifiManager:
print('we;re acti!!!!!!!!!!!!') print('we;re acti!!!!!!!!!!!!')
# Scan for networks every 5 seconds # Scan for networks every 5 seconds
if i % 5 == 0: if i % 5 == 0:
# TODO: should watch when scan is complete, but this is more than good enough for now
self._update_networks() self._update_networks()
self._request_scan() self._request_scan()
@ -212,6 +213,7 @@ class WifiManager:
time.sleep(1) time.sleep(1)
def set_active(self, active: bool): def set_active(self, active: bool):
print('SETTING ACTIVE', active)
self._active = active self._active = active
def _get_wifi_device(self) -> dbus.ObjectPath | None: def _get_wifi_device(self) -> dbus.ObjectPath | None:

Loading…
Cancel
Save