-
Notifications
You must be signed in to change notification settings - Fork 9.8k
ui: add experimental mode toggle button with visual indicator #35446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ffb09c7
to
c26b1e9
Compare
@@ -51,6 +50,7 @@ def _setup_callbacks(self): | |||
self._layouts[MainState.SETTINGS].set_callbacks( | |||
on_close=lambda: setattr(self, '_current_callback', self._set_mode_for_state) | |||
) | |||
self._layouts[MainState.ONROAD].on_click = self._on_onrad_clicked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we make a standard set_callback function or switch to setting directly?
# Handle click events if no HUD interaction occurred | ||
if not self._hud_renderer.handle_mouse_event(): | ||
if self.on_click and rl.is_mouse_button_pressed(rl.MouseButton.MOUSE_BUTTON_LEFT): | ||
if rl.check_collision_point_rec(rl.get_mouse_position(), self._content_rect): | ||
self.on_click() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to function that handles mouse clicks to prepare for base class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think we can handle this better after #35489
self._engageable: bool = False | ||
|
||
# State hold mechanism | ||
self._hold_duration = 2.0 # seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this match qt? might be too complicated as first thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good feature and I've tested it. Qt immediately reverts to the state read from the message, so holding this state briefly helps reduce user confusion—otherwise, it might look like the icon doesn't respond after clicking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know with replay it doesn't work, but on-device is mainly what we care about. We can keep if you don't think it's too much complexity
I suggest we merge this PR first—if anything comes up, we can always tweak it along the way. Going back and forth slow down progress on other parts. |
reopen #35439 , fix issues