raylib: update experimental mode homescreen button (#36344)

* update homescreen exp mode button

* and here

* Apply suggestions from code review
pull/33601/merge
Shane Smiskol 2 days ago committed by GitHub
parent a2cce7f897
commit 5f0e9fce61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      selfdrive/ui/layouts/home.py
  2. 3
      selfdrive/ui/widgets/exp_mode_button.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:

@ -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

Loading…
Cancel
Save