From a5dedeb164e3e8cca25779a1d220cab1b940ba44 Mon Sep 17 00:00:00 2001 From: firestarsdog <229254897+firestarsdog@users.noreply.github.com> Date: Mon, 11 May 2026 02:17:28 -0400 Subject: [PATCH] BigUI WIP: Accents --- .../ui/layouts/settings/starpilot/aethergrid.py | 6 +++--- .../ui/layouts/settings/starpilot/appearance.py | 4 ++-- .../ui/layouts/settings/starpilot/driving_model.py | 14 +++++++------- selfdrive/ui/layouts/settings/starpilot/lateral.py | 2 +- selfdrive/ui/layouts/settings/starpilot/maps.py | 2 +- selfdrive/ui/layouts/settings/starpilot/panel.py | 4 ++-- selfdrive/ui/layouts/settings/starpilot/sounds.py | 6 +++--- .../layouts/settings/starpilot/system_settings.py | 2 +- selfdrive/ui/layouts/settings/starpilot/vehicle.py | 4 ++-- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/selfdrive/ui/layouts/settings/starpilot/aethergrid.py b/selfdrive/ui/layouts/settings/starpilot/aethergrid.py index 645397df78..2e130d7429 100644 --- a/selfdrive/ui/layouts/settings/starpilot/aethergrid.py +++ b/selfdrive/ui/layouts/settings/starpilot/aethergrid.py @@ -3115,10 +3115,10 @@ class TileGrid(Widget): tile_idx += 1 -def draw_toggle_pill(rect: rl.Rectangle, is_on: bool, is_enabled: bool, title: str, status_str: str, hovered: bool, pressed: bool): +def draw_toggle_pill(rect: rl.Rectangle, is_on: bool, is_enabled: bool, title: str, status_str: str, hovered: bool, pressed: bool, style: PanelStyle = DEFAULT_PANEL_STYLE): rect = _snap_rect(rect) bg_color = rl.Color(28, 32, 40, 170 if not is_enabled else 255) - accent = AetherListColors.PRIMARY if is_on and is_enabled else rl.Color(255, 255, 255, 52 if is_enabled else 20) + accent = style.accent if is_on and is_enabled else rl.Color(255, 255, 255, 52 if is_enabled else 20) _draw_rounded_fill(rect, bg_color, radius_px=18) _draw_rounded_stroke(rect, _with_alpha(accent, 92 if is_on and is_enabled else accent.a), radius_px=18) @@ -3127,7 +3127,7 @@ def draw_toggle_pill(rect: rl.Rectangle, is_on: bool, is_enabled: bool, title: s _draw_rounded_fill(rect, overlay, radius_px=18) if is_on and is_enabled: - rl.draw_rectangle_rec(rl.Rectangle(rect.x, rect.y, 1, rect.height), _with_alpha(AetherListColors.PRIMARY, 160)) + rl.draw_rectangle_rec(rl.Rectangle(rect.x, rect.y, 1, rect.height), _with_alpha(style.accent, 160)) font = gui_app.font(FontWeight.BOLD) title_size = max(16, min(22, int(rect.height * 0.26))) diff --git a/selfdrive/ui/layouts/settings/starpilot/appearance.py b/selfdrive/ui/layouts/settings/starpilot/appearance.py index 8c05411bdd..ff3cc45805 100644 --- a/selfdrive/ui/layouts/settings/starpilot/appearance.py +++ b/selfdrive/ui/layouts/settings/starpilot/appearance.py @@ -542,7 +542,7 @@ class StarPilotAppearanceLayout(_SettingsPage): if res == DialogResult.CONFIRM: self._params.put_int(key, int(val)) gui_app.push_widget(AetherSliderDialog(tr(key), min_v, max_v, 1, self._params.get_int(key), on_close, - unit=unit, color="#8B5CF6")) + unit=unit, color=PANEL_STYLE.accent)) def _show_float_selector(self, key, min_v, max_v, step, unit="", convert=None, unconvert=None): current = self._params.get_float(key) @@ -557,7 +557,7 @@ class StarPilotAppearanceLayout(_SettingsPage): self._params.put_float(key, v) gui_app.push_widget(AetherSliderDialog(tr(key), min_v, max_v, step, current, on_close, - unit=unit, color="#8B5CF6")) + unit=unit, color=PANEL_STYLE.accent)) # ── Unit-aware display helpers ── diff --git a/selfdrive/ui/layouts/settings/starpilot/driving_model.py b/selfdrive/ui/layouts/settings/starpilot/driving_model.py index d7e7296ef1..f5f24e1cec 100644 --- a/selfdrive/ui/layouts/settings/starpilot/driving_model.py +++ b/selfdrive/ui/layouts/settings/starpilot/driving_model.py @@ -499,7 +499,7 @@ class DrivingModelManagerView(Widget): def _draw_downloading_action(self, rect: rl.Rectangle, progress_text: str): center = rl.Vector2(rect.x + rect.width / 2, rect.y + rect.height / 2 - 8) phase = (time.monotonic() * 240.0) % 360.0 - draw_busy_ring(center, phase, AetherListColors.PRIMARY) + draw_busy_ring(center, phase, PANEL_STYLE.accent) label = progress_text if progress_text else tr("Downloading") gui_label( @@ -543,15 +543,15 @@ class DrivingModelManagerView(Widget): # Favorite toggle button is_fav = entry.user_favorite - fav_fill = rl.Color(210, 100, 130, 44) if is_fav else AetherListColors.PRIMARY_SOFT - fav_border = rl.Color((210 if is_fav else AetherListColors.PRIMARY.r), (100 if is_fav else AetherListColors.PRIMARY.g), (130 if is_fav else AetherListColors.PRIMARY.b), min((255 if is_fav else AetherListColors.PRIMARY.a), 70)) - fav_text_color = rl.Color(210, 100, 130, 255) if is_fav else AetherListColors.PRIMARY + fav_fill = rl.Color(210, 100, 130, 44) if is_fav else rl.Color(PANEL_STYLE.accent.r, PANEL_STYLE.accent.g, PANEL_STYLE.accent.b, 26) + fav_border = rl.Color((210 if is_fav else PANEL_STYLE.accent.r), (100 if is_fav else PANEL_STYLE.accent.g), (130 if is_fav else PANEL_STYLE.accent.b), min((255 if is_fav else PANEL_STYLE.accent.a), 70)) + fav_text_color = rl.Color(210, 100, 130, 255) if is_fav else PANEL_STYLE.accent fav_label = tr("Unfavorite") if is_fav else tr("Favorite") draw_action_pill(fav_rect, fav_label, fav_fill, fav_border, fav_text_color) def _draw_current_action(self, rect: rl.Rectangle): chip_rect = rl.Rectangle(rect.x + 24, rect.y + (rect.height - 42) / 2, rect.width - 48, 42) - AetherChip(tr("Current"), rl.Color(89, 116, 151, 26), rl.Color(116, 136, 168, 52), AetherListColors.HEADER, font_size=18).render(chip_rect) + AetherChip(tr("Current"), PANEL_STYLE.current_fill, PANEL_STYLE.current_border, AetherListColors.HEADER, font_size=18).render(chip_rect) def _draw_protected_action(self, rect: rl.Rectangle): chip_rect = rl.Rectangle(rect.x + 20, rect.y + (rect.height - 42) / 2, rect.width - 40, 42) @@ -1137,10 +1137,10 @@ class StarPilotDrivingModelLayout(_SettingsPage): self._update_model_metadata() def _on_recovery_power_clicked(self): - self._show_slider("RecoveryPower", 0.5, 2.0, step=0.1, unit="x", value_type="float", title="Recovery Power") + self._show_slider("RecoveryPower", 0.5, 2.0, step=0.1, unit="x", value_type="float", title="Recovery Power", color=PANEL_STYLE.accent) def _on_stop_distance_clicked(self): - self._show_slider("StopDistance", 4.0, 10.0, step=0.1, unit="m", value_type="float", title="Stop Distance") + self._show_slider("StopDistance", 4.0, 10.0, step=0.1, unit="m", value_type="float", title="Stop Distance", color=PANEL_STYLE.accent) def _on_blacklist_clicked(self): blacklisted = [m.strip() for m in (self._params.get("BlacklistedModels", encoding="utf-8") or "").split(",") if m.strip()] diff --git a/selfdrive/ui/layouts/settings/starpilot/lateral.py b/selfdrive/ui/layouts/settings/starpilot/lateral.py index a1175e7249..71a52a4059 100644 --- a/selfdrive/ui/layouts/settings/starpilot/lateral.py +++ b/selfdrive/ui/layouts/settings/starpilot/lateral.py @@ -257,4 +257,4 @@ class StarPilotLateralLayout(_SettingsPage): if res == DialogResult.CONFIRM: self._params.put_int("LaneChangeSmoothing", int(val)) current = self._params.get_int("LaneChangeSmoothing") if self._params.get_int("LaneChangeSmoothing") > 0 else 10 - gui_app.set_modal_overlay(AetherSliderDialog(tr("Lane Change Smoothing"), 1, 10, 1, current, on_close, color="#597497")) + gui_app.set_modal_overlay(AetherSliderDialog(tr("Lane Change Smoothing"), 1, 10, 1, current, on_close, color=PANEL_STYLE.accent)) diff --git a/selfdrive/ui/layouts/settings/starpilot/maps.py b/selfdrive/ui/layouts/settings/starpilot/maps.py index 1de0b39b79..a717e9a564 100644 --- a/selfdrive/ui/layouts/settings/starpilot/maps.py +++ b/selfdrive/ui/layouts/settings/starpilot/maps.py @@ -275,7 +275,7 @@ class MapStatusCard(Widget): if self._controller._download_state.active: center = rl.Vector2(primary_rect.x + primary_rect.width - 22, primary_rect.y + primary_rect.height / 2) - draw_busy_ring(center, rl.get_time() * 160, AetherListColors.PRIMARY, inner_radius=9, outer_radius=13, sweep=210, thickness=20) + draw_busy_ring(center, rl.get_time() * 160, PANEL_STYLE.accent, inner_radius=9, outer_radius=13, sweep=210, thickness=20) class MapBrowserCard(Widget): diff --git a/selfdrive/ui/layouts/settings/starpilot/panel.py b/selfdrive/ui/layouts/settings/starpilot/panel.py index 3102c297ee..fe5b2c0d07 100644 --- a/selfdrive/ui/layouts/settings/starpilot/panel.py +++ b/selfdrive/ui/layouts/settings/starpilot/panel.py @@ -341,7 +341,7 @@ class _SettingsPage(StarPilotPanel): # ── shared dialog helpers ── def _show_slider(self, key, min_v, max_v, step=1, unit="", - value_type="int", current_value=None, title=None): + value_type="int", current_value=None, title=None, color=None): """Unified slider dialog (int/float). title: if provided, used as dialog title; otherwise uses tr(key). @@ -356,7 +356,7 @@ class _SettingsPage(StarPilotPanel): current_value = self._params.get_float(key) if value_type == "float" else self._params.get_int(key) dialog_title = tr(title) if title else tr(key) gui_app.push_widget(AetherSliderDialog(dialog_title, min_v, max_v, step, current_value, on_close, - unit=unit, color=self.SLIDER_COLOR)) + unit=unit, color=self.SLIDER_COLOR if color is None else color)) def _show_string_select(self, key, options, default="None"): """String-based multi-option selector (puts string via params.put).""" diff --git a/selfdrive/ui/layouts/settings/starpilot/sounds.py b/selfdrive/ui/layouts/settings/starpilot/sounds.py index fb16d9329b..a8c441481e 100644 --- a/selfdrive/ui/layouts/settings/starpilot/sounds.py +++ b/selfdrive/ui/layouts/settings/starpilot/sounds.py @@ -73,7 +73,7 @@ class SoundsManagerView(Widget): is_active=lambda k=key: self._active_adjustor_key == k, set_active=lambda active, k=key: self._set_active_adjustor(k, active), style=PANEL_STYLE, - color=AetherListColors.PRIMARY, + color=PANEL_STYLE.accent, ) self._adjustor_rows[key] = adjustor @@ -94,7 +94,7 @@ class SoundsManagerView(Widget): is_active=lambda: self._active_adjustor_key == cd_key, set_active=lambda active: self._set_active_adjustor(cd_key, active), style=PANEL_STYLE, - color=AetherListColors.PRIMARY, + color=PANEL_STYLE.accent, ) self._adjustor_rows[cd_key] = cd_adjustor @@ -204,7 +204,7 @@ class SoundsManagerView(Widget): status_str = tr("ON") if current_val else tr("OFF") if not is_enabled: status_str = tr(info.get("disabled_label", "UNAVAILABLE")) - draw_toggle_pill(padded_rect, current_val, is_enabled, tr(info["title"]), status_str, hovered, pressed) + draw_toggle_pill(padded_rect, current_val, is_enabled, tr(info["title"]), status_str, hovered, pressed, style=PANEL_STYLE) self._toggle_rects[key] = padded_rect diff --git a/selfdrive/ui/layouts/settings/starpilot/system_settings.py b/selfdrive/ui/layouts/settings/starpilot/system_settings.py index 7f5a2e0d7b..a6907bef85 100644 --- a/selfdrive/ui/layouts/settings/starpilot/system_settings.py +++ b/selfdrive/ui/layouts/settings/starpilot/system_settings.py @@ -760,7 +760,7 @@ class SystemSettingsManagerView(Widget): action_text_size=18, row_separator=PANEL_STYLE.divider_color, action_fill=AetherListColors.CURRENT_BG, - action_border=rl.Color(89, 116, 151, 42), + action_border=PANEL_STYLE.current_border, action_text_color=AetherListColors.HEADER, ) diff --git a/selfdrive/ui/layouts/settings/starpilot/vehicle.py b/selfdrive/ui/layouts/settings/starpilot/vehicle.py index 9e1d4e29bf..8c89b173c5 100644 --- a/selfdrive/ui/layouts/settings/starpilot/vehicle.py +++ b/selfdrive/ui/layouts/settings/starpilot/vehicle.py @@ -637,7 +637,7 @@ class StarPilotVehicleSettingsLayout(_SettingsPage): self._params.put_int("LockDoorsTimer", int(val)) gui_app.push_widget(AetherSliderDialog(tr("Lock Doors Timer"), 0, 300, 5, - self._params.get_int("LockDoorsTimer"), on_close, labels=_lock_doors_timer_labels())) + self._params.get_int("LockDoorsTimer"), on_close, labels=_lock_doors_timer_labels(), color=PANEL_STYLE.accent)) def _show_offset_selector(self): def on_close(res, val): @@ -645,7 +645,7 @@ class StarPilotVehicleSettingsLayout(_SettingsPage): self._params.put_float("ClusterOffset", float(val)) gui_app.push_widget(AetherSliderDialog(tr("Dashboard Speed Offset"), 1.000, 1.050, 0.001, - self._params.get_float("ClusterOffset"), on_close, unit="x")) + self._params.get_float("ClusterOffset"), on_close, unit="x", color=PANEL_STYLE.accent)) def _get_display_make(self) -> str: make = self._params.get("CarMake", encoding="utf-8") or ""