diff --git a/selfdrive/ui/layouts/home.py b/selfdrive/ui/layouts/home.py index 70960ee22f..519e0e020a 100644 --- a/selfdrive/ui/layouts/home.py +++ b/selfdrive/ui/layouts/home.py @@ -62,6 +62,7 @@ class HomeLayout(Widget): self._setup_callbacks() def show_event(self): + self._exp_mode_button.show_event() self.last_refresh = time.monotonic() self._refresh() @@ -76,6 +77,9 @@ class HomeLayout(Widget): def _set_state(self, state: HomeLayoutState): # propagate show/hide events if state != self.current_state: + if state == HomeLayoutState.HOME: + self._exp_mode_button.show_event() + if state in self._layout_widgets: self._layout_widgets[state].show_event() if self.current_state in self._layout_widgets: diff --git a/selfdrive/ui/widgets/exp_mode_button.py b/selfdrive/ui/widgets/exp_mode_button.py index 97c399cdab..23031be306 100644 --- a/selfdrive/ui/widgets/exp_mode_button.py +++ b/selfdrive/ui/widgets/exp_mode_button.py @@ -18,6 +18,9 @@ class ExperimentalModeButton(Widget): self.chill_pixmap = gui_app.texture("icons/couch.png", self.img_width, self.img_width) self.experimental_pixmap = gui_app.texture("icons/experimental_grey.png", self.img_width, self.img_width) + def show_event(self): + self.experimental_mode = self.params.get_bool("ExperimentalMode") + def _get_gradient_colors(self): alpha = 0xCC if self.is_pressed else 0xFF