mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-08-22 08:53:44 +08:00
mici home: alerts pill touch zone only when alerts (#37940)
* fix * clean up
This commit is contained in:
@@ -14,7 +14,6 @@ from openpilot.system.version import RELEASE_BRANCHES
|
||||
|
||||
HEAD_BUTTON_FONT_SIZE = 40
|
||||
HOME_PADDING = 8
|
||||
SETTINGS_ZONE_WIDTH = 280
|
||||
ALERTS_ZONE_WIDTH = 180
|
||||
|
||||
NetworkType = log.DeviceState.NetworkType
|
||||
@@ -205,12 +204,11 @@ class MiciHomeLayout(Widget):
|
||||
if not self._did_long_press:
|
||||
relative_x = mouse_pos.x - self.rect.x
|
||||
has_alerts = self._alert_count_callback and self._alert_count_callback() > 0
|
||||
if relative_x < SETTINGS_ZONE_WIDTH:
|
||||
if self._on_settings_click:
|
||||
self._on_settings_click()
|
||||
elif has_alerts and relative_x > self.rect.width - ALERTS_ZONE_WIDTH:
|
||||
if has_alerts and relative_x > self.rect.width - ALERTS_ZONE_WIDTH:
|
||||
if self._on_alerts_click:
|
||||
self._on_alerts_click()
|
||||
elif self._on_settings_click:
|
||||
self._on_settings_click()
|
||||
self._did_long_press = False
|
||||
|
||||
def _get_version_text(self) -> tuple[str, str, str, str] | None:
|
||||
|
||||
Reference in New Issue
Block a user