mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-29 02:43:47 +08:00
raylib: update experimental mode homescreen button (#36344)
* update homescreen exp mode button * and here * Apply suggestions from code review
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user