Merge remote-tracking branch 'origin/master' into only-chubbs

# Conflicts:
#	opendbc_repo
#	selfdrive/ui/sunnypilot/ui_state.py
This commit is contained in:
discountchubbs
2025-12-29 08:40:52 -07:00
3 changed files with 20 additions and 1 deletions
@@ -9,6 +9,7 @@ from enum import IntEnum
from openpilot.selfdrive.ui.mici.layouts.settings import settings as OP
from openpilot.selfdrive.ui.mici.widgets.button import BigButton
from openpilot.selfdrive.ui.sunnypilot.mici.layouts.sunnylink import SunnylinkLayoutMici
from openpilot.selfdrive.ui.mici.layouts.settings.models import ModelsLayoutMici
ICON_SIZE = 70
@@ -16,6 +17,7 @@ OP.PanelType = IntEnum( # type: ignore
"PanelType",
[es.name for es in OP.PanelType] + [
"SUNNYLINK",
"MODELS",
],
start=0,
)
@@ -27,13 +29,17 @@ class SettingsLayoutSP(OP.SettingsLayout):
sunnylink_btn = BigButton("sunnylink", "", "icons_mici/settings/developer/ssh.png")
sunnylink_btn.set_click_callback(lambda: self._set_current_panel(OP.PanelType.SUNNYLINK))
models_btn = BigButton("models", "", "../../sunnypilot/selfdrive/assets/offroad/icon_models.png")
models_btn.set_click_callback(lambda: self._set_current_panel(OP.PanelType.MODELS))
self._panels.update({
OP.PanelType.SUNNYLINK: OP.PanelInfo("sunnylink", SunnylinkLayoutMici(back_callback=lambda: self._set_current_panel(None))),
OP.PanelType.MODELS: OP.PanelInfo("models", ModelsLayoutMici(back_callback=lambda: self._set_current_panel(None))),
})
items = self._scroller._items.copy()
items.insert(1, sunnylink_btn)
items.insert(2, models_btn)
self._scroller._items.clear()
for item in items:
self._scroller.add_widget(item)
+13
View File
@@ -22,6 +22,19 @@ from openpilot.system.ui.sunnypilot.widgets.option_control import OptionControlS
from openpilot.selfdrive.ui.ui_state import ui_state
class Spacer(Widget):
def __init__(self, height: int = 1):
super().__init__()
self._rect = rl.Rectangle(0, 0, 0, height)
def set_parent_rect(self, parent_rect: rl.Rectangle) -> None:
super().set_parent_rect(parent_rect)
self._rect.width = parent_rect.width
def _render(self, _):
rl.draw_rectangle(int(self._rect.x), int(self._rect.y), int(self._rect.x + self._rect.width), int(self._rect.y), rl.Color(0,0,0,0))
class Spacer(Widget):
def __init__(self, height: int = 1):
super().__init__()