mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-07 01:05:51 +08:00
BigUI WIP: mono
This commit is contained in:
@@ -191,7 +191,7 @@ class AetherListColors:
|
||||
CURRENT_BORDER = rl.Color(116, 136, 168, 44)
|
||||
ACTION_BG = rl.Color(255, 255, 255, 0)
|
||||
ACTION_SEPARATOR = rl.Color(255, 255, 255, 18)
|
||||
PRIMARY = hex_to_color("#597497")
|
||||
PRIMARY = hex_to_color("#8B5CF6")
|
||||
PRIMARY_SOFT = rl.Color(89, 116, 151, 48)
|
||||
DANGER = rl.Color(173, 78, 90, 255)
|
||||
DANGER_SOFT = rl.Color(173, 78, 90, 44)
|
||||
@@ -1799,6 +1799,8 @@ class AetherButton(Widget):
|
||||
rl.draw_rectangle_rounded(rect, 0.18, 12, bg)
|
||||
rl.draw_rectangle_rounded_lines_ex(rect, 0.18, 12, 1, border)
|
||||
rl.draw_rectangle_rec(rl.Rectangle(rect.x, rect.y, rect.width, 1), _with_alpha(AetherListColors.HEADER, 18 if enabled else 8))
|
||||
if self._emphasized and enabled:
|
||||
rl.draw_rectangle_rec(rl.Rectangle(rect.x + 1, rect.y + 1, rect.width - 2, 1), _with_alpha(AetherListColors.HEADER, 14))
|
||||
_draw_text_fit_common(
|
||||
gui_app.font(FontWeight.MEDIUM),
|
||||
self.text,
|
||||
@@ -2183,7 +2185,7 @@ class AetherTile(Widget):
|
||||
elif surface_color:
|
||||
self.surface_color = surface_color
|
||||
else:
|
||||
self.surface_color = hex_to_color("#3B82F6")
|
||||
self.surface_color = AetherListColors.PRIMARY
|
||||
if isinstance(substrate_color, str):
|
||||
self.substrate_color = hex_to_color(substrate_color)
|
||||
else:
|
||||
@@ -2326,7 +2328,12 @@ class AetherTile(Widget):
|
||||
def _draw_signal_edge(self, face: rl.Rectangle, color: rl.Color, width: int = 2, alpha: int = 58):
|
||||
snapped_face = _snap_rect(face)
|
||||
signal_width = max(1, int(width))
|
||||
rl.draw_rectangle_rec(rl.Rectangle(snapped_face.x, snapped_face.y, signal_width, snapped_face.height), _with_alpha(color, alpha))
|
||||
glow_color = _with_alpha(color, max(4, alpha // 3))
|
||||
core_color = _with_alpha(color, alpha)
|
||||
rl.draw_rectangle_rec(rl.Rectangle(snapped_face.x, snapped_face.y, signal_width, snapped_face.height), glow_color)
|
||||
inner_x = snapped_face.x + max(1, signal_width - 2)
|
||||
inner_w = max(1, signal_width - 1)
|
||||
rl.draw_rectangle_rec(rl.Rectangle(inner_x, snapped_face.y, inner_w, snapped_face.height), core_color)
|
||||
|
||||
def _measure_tile_stack(
|
||||
self,
|
||||
@@ -2425,7 +2432,7 @@ class AetherTile(Widget):
|
||||
icon_width = custom_icon_base_size * custom_icon_scale_mult * icon_scale
|
||||
icon_x = face.x + (face.width - icon_width) / 2
|
||||
s = icon_scale * (custom_icon_base_size / custom_icon_canvas_size) * custom_icon_scale_mult
|
||||
self._draw_custom_icon(custom_icon_key, icon_x, layout["top"], s, rl.WHITE)
|
||||
self._draw_custom_icon(custom_icon_key, icon_x, layout["top"], s, _mix_colors(rl.Color(255, 255, 255, 255), self.surface_color, 0.08))
|
||||
elif icon:
|
||||
icon_width = icon.width * icon_scale
|
||||
icon_x = face.x + (face.width - icon_width) / 2
|
||||
@@ -2499,7 +2506,7 @@ class HubTile(AetherTile):
|
||||
|
||||
def _render(self, rect: rl.Rectangle):
|
||||
face = self._render_layers(rect)
|
||||
self._draw_signal_edge(face, self.surface_color, width=TILE_SIGNAL_WIDTH, alpha=48)
|
||||
self._draw_signal_edge(face, self.surface_color, alpha=48)
|
||||
|
||||
status_text = self.get_status() if self.get_status else ""
|
||||
title_text = str(_resolve_value(self.title, ""))
|
||||
@@ -3095,7 +3102,7 @@ class AetherSliderDialog(Widget):
|
||||
presets: list[float] | None = None,
|
||||
unit: str = "",
|
||||
labels: dict[float, str] | None = None,
|
||||
color: rl.Color | str = "#F57371",
|
||||
color: rl.Color | str = "#8B5CF6",
|
||||
on_change: Callable[[float], None] | None = None,
|
||||
):
|
||||
super().__init__()
|
||||
|
||||
@@ -10,7 +10,7 @@ from openpilot.selfdrive.ui.lib.starpilot_state import starpilot_state
|
||||
from openpilot.selfdrive.ui.layouts.settings.starpilot.panel import _SettingsPage
|
||||
from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
AetherSliderDialog,
|
||||
panel_style_from_color,
|
||||
DEFAULT_PANEL_STYLE,
|
||||
)
|
||||
from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
SettingRow,
|
||||
@@ -18,7 +18,7 @@ from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
AetherSettingsView,
|
||||
)
|
||||
|
||||
PANEL_STYLE = panel_style_from_color("#8B5CF6")
|
||||
PANEL_STYLE = DEFAULT_PANEL_STYLE
|
||||
|
||||
THEME_KEY_CONFIG = {
|
||||
"BootLogo": {
|
||||
|
||||
@@ -42,7 +42,7 @@ from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
AetherChip,
|
||||
AetherListColors,
|
||||
AetherScrollbar,
|
||||
panel_style_from_color,
|
||||
DEFAULT_PANEL_STYLE,
|
||||
_point_hits,
|
||||
draw_action_rail,
|
||||
draw_action_pill,
|
||||
@@ -78,7 +78,7 @@ FADE_HEIGHT = AETHER_LIST_METRICS.fade_height
|
||||
DRIVING_MODEL_METRICS = replace(AETHER_LIST_METRICS, header_height=210)
|
||||
CONFIRM_TIMEOUT_SECONDS = 3.0
|
||||
TRANSITION_SECONDS = 0.24
|
||||
PANEL_STYLE = panel_style_from_color("#3B82F6")
|
||||
PANEL_STYLE = DEFAULT_PANEL_STYLE
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -14,11 +14,11 @@ from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
AETHER_LIST_METRICS,
|
||||
AetherSliderDialog,
|
||||
panel_style_from_color,
|
||||
DEFAULT_PANEL_STYLE,
|
||||
)
|
||||
|
||||
|
||||
PANEL_STYLE = panel_style_from_color("#3B82F6")
|
||||
PANEL_STYLE = DEFAULT_PANEL_STYLE
|
||||
|
||||
|
||||
def _confirm_reboot_toggle(params, key, state):
|
||||
|
||||
@@ -22,7 +22,7 @@ from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
AetherListColors,
|
||||
AetherScrollbar,
|
||||
AetherSliderDialog,
|
||||
panel_style_from_color,
|
||||
DEFAULT_PANEL_STYLE,
|
||||
_point_hits,
|
||||
draw_list_group_shell,
|
||||
draw_list_scroll_fades,
|
||||
@@ -43,7 +43,7 @@ from openpilot.starpilot.common.accel_profile import (
|
||||
from openpilot.starpilot.common.experimental_state import sync_persist_experimental_state
|
||||
|
||||
|
||||
PANEL_STYLE = panel_style_from_color("#3B82F6")
|
||||
PANEL_STYLE = DEFAULT_PANEL_STYLE
|
||||
COMPACT_PANEL_METRICS = replace(AETHER_LIST_METRICS, header_height=96) # noqa: re-exported
|
||||
SECTION_GAP = AETHER_LIST_METRICS.section_gap
|
||||
SECTION_HEADER_HEIGHT = AETHER_LIST_METRICS.section_header_height
|
||||
|
||||
@@ -25,37 +25,31 @@ class StarPilotLayout(Widget):
|
||||
"title": "Alerts & Sounds",
|
||||
"icon": "sound",
|
||||
"panel": "SOUNDS",
|
||||
"color": "#E63956",
|
||||
},
|
||||
{
|
||||
"title": "Driving Controls",
|
||||
"icon": "steering",
|
||||
"buttons": [("DRIVING MODEL", "DRIVING_MODEL"), ("GAS / BRAKE", "LONGITUDINAL"), ("STEERING", "LATERAL")],
|
||||
"color": "#3B82F6",
|
||||
},
|
||||
{
|
||||
"title": "Map Data",
|
||||
"icon": "navigate",
|
||||
"panel": "MAPS",
|
||||
"color": "#10B981",
|
||||
},
|
||||
{
|
||||
"title": "System",
|
||||
"icon": "system",
|
||||
"panel": "SYSTEM",
|
||||
"color": "#D946EF",
|
||||
},
|
||||
{
|
||||
"title": "Appearance",
|
||||
"icon": "display",
|
||||
"panel": "VISUALS",
|
||||
"color": "#8B5CF6",
|
||||
},
|
||||
{
|
||||
"title": "Vehicle Settings",
|
||||
"icon": "vehicle",
|
||||
"panel": "VEHICLE",
|
||||
"color": "#64748B",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
AetherButton,
|
||||
AetherListColors,
|
||||
AetherScrollbar,
|
||||
panel_style_from_color,
|
||||
DEFAULT_PANEL_STYLE,
|
||||
build_list_panel_frame,
|
||||
draw_action_pill,
|
||||
draw_busy_ring,
|
||||
@@ -84,8 +84,7 @@ STATUS_BUTTON_GAP = 8
|
||||
STATUS_REMOVE_HEIGHT = 40
|
||||
STATUS_METRIC_GAP = 18
|
||||
STATUS_SELECTION_CHIP_HEIGHT = 30
|
||||
MAPS_TILE_GREEN = rl.Color(16, 185, 129, 255)
|
||||
PANEL_STYLE = panel_style_from_color("#10B981")
|
||||
PANEL_STYLE = DEFAULT_PANEL_STYLE
|
||||
MAPS_METRICS = replace(AETHER_LIST_METRICS, header_height=240)
|
||||
|
||||
COUNTRIES_SECTION = next(section for section in MAPS_CATALOG if section["key"] == "countries")
|
||||
@@ -544,7 +543,6 @@ class StarPilotMapsLayout(StarPilotPanel):
|
||||
enabled=self._primary_action_enabled,
|
||||
emphasized=True,
|
||||
font_size=24,
|
||||
accent_color=MAPS_TILE_GREEN,
|
||||
)
|
||||
)
|
||||
self._schedule_button = self._child(
|
||||
|
||||
@@ -227,7 +227,7 @@ class _SettingsPage(StarPilotPanel):
|
||||
shared slider and selector dialog helpers.
|
||||
"""
|
||||
|
||||
SLIDER_COLOR = "#597497"
|
||||
SLIDER_COLOR = "#8B5CF6"
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
@@ -23,7 +23,7 @@ from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
AetherScrollbar,
|
||||
TileGrid,
|
||||
ToggleTile,
|
||||
panel_style_from_color,
|
||||
DEFAULT_PANEL_STYLE,
|
||||
_point_hits,
|
||||
draw_action_pill,
|
||||
draw_list_group_shell,
|
||||
@@ -34,7 +34,7 @@ from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
AetherSliderDialog,
|
||||
)
|
||||
|
||||
PANEL_STYLE = panel_style_from_color("#E63956")
|
||||
PANEL_STYLE = DEFAULT_PANEL_STYLE
|
||||
SECTION_GAP = AETHER_LIST_METRICS.section_gap
|
||||
SECTION_HEADER_HEIGHT = AETHER_LIST_METRICS.section_header_height
|
||||
SECTION_HEADER_GAP = AETHER_LIST_METRICS.section_header_gap
|
||||
|
||||
@@ -35,7 +35,7 @@ from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
AetherListColors,
|
||||
TileGrid,
|
||||
ToggleTile,
|
||||
panel_style_from_color,
|
||||
DEFAULT_PANEL_STYLE,
|
||||
init_list_panel,
|
||||
draw_list_group_shell,
|
||||
draw_list_scroll_fades,
|
||||
@@ -94,7 +94,7 @@ SECTION_HEADER_HEIGHT = AETHER_LIST_METRICS.section_header_height
|
||||
SECTION_HEADER_GAP = AETHER_LIST_METRICS.section_header_gap
|
||||
ROW_HEIGHT = AETHER_LIST_METRICS.row_height
|
||||
FADE_HEIGHT = AETHER_LIST_METRICS.fade_height
|
||||
PANEL_STYLE = panel_style_from_color("#D946EF")
|
||||
PANEL_STYLE = DEFAULT_PANEL_STYLE
|
||||
|
||||
SYSTEM_PANEL_METRICS = replace(
|
||||
AETHER_LIST_METRICS,
|
||||
|
||||
@@ -18,7 +18,7 @@ from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import (
|
||||
AetherListColors,
|
||||
AetherScrollbar,
|
||||
AetherSliderDialog,
|
||||
panel_style_from_color,
|
||||
DEFAULT_PANEL_STYLE,
|
||||
draw_list_group_shell,
|
||||
draw_list_scroll_fades,
|
||||
draw_section_header,
|
||||
@@ -89,7 +89,7 @@ SECTION_HEADER_HEIGHT = CUSTOM_METRICS.section_header_height
|
||||
SECTION_HEADER_GAP = CUSTOM_METRICS.section_header_gap
|
||||
ROW_HEIGHT = CUSTOM_METRICS.row_height
|
||||
FADE_HEIGHT = CUSTOM_METRICS.fade_height
|
||||
PANEL_STYLE = panel_style_from_color("#64748B")
|
||||
PANEL_STYLE = DEFAULT_PANEL_STYLE
|
||||
|
||||
|
||||
class VehicleSettingsManagerView(AetherInteractiveMixin, Widget):
|
||||
|
||||
Reference in New Issue
Block a user