|
|
@ -63,14 +63,20 @@ 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 |
|
|
|
self._set_current_layout(MainState.ONROAD) |
|
|
|
else: |
|
|
|
else: |
|
|
|
self._current_mode = MainState.HOME |
|
|
|
self._set_current_layout(MainState.HOME) |
|
|
|
self._sidebar.set_visible(True) |
|
|
|
self._sidebar.set_visible(True) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _set_current_layout(self, layout: MainState): |
|
|
|
|
|
|
|
if layout != self._current_mode: |
|
|
|
|
|
|
|
self._layouts[self._current_mode].hide_event() |
|
|
|
|
|
|
|
self._current_mode = layout |
|
|
|
|
|
|
|
self._layouts[self._current_mode].show_event() |
|
|
|
|
|
|
|
|
|
|
|
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._current_mode = MainState.SETTINGS |
|
|
|
self._set_current_layout(MainState.SETTINGS) |
|
|
|
self._sidebar.set_visible(False) |
|
|
|
self._sidebar.set_visible(False) |
|
|
|
|
|
|
|
|
|
|
|
def _on_settings_clicked(self): |
|
|
|
def _on_settings_clicked(self): |
|
|
|