From eb94abaa14a355d65a281b7225180c144677d5fd Mon Sep 17 00:00:00 2001 From: nayan Date: Wed, 19 Nov 2025 23:44:05 -0500 Subject: [PATCH 1/6] better padding --- system/ui/sunnypilot/lib/styles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/ui/sunnypilot/lib/styles.py b/system/ui/sunnypilot/lib/styles.py index 28d50f48d7..2c694a1f38 100644 --- a/system/ui/sunnypilot/lib/styles.py +++ b/system/ui/sunnypilot/lib/styles.py @@ -5,7 +5,7 @@ from dataclasses import dataclass class Base: # Widget/Control Base Dimensions ITEM_BASE_HEIGHT = 170 - ITEM_PADDING = 20 + ITEM_PADDING = 30 ITEM_TEXT_FONT_SIZE = 50 ITEM_DESC_FONT_SIZE = 40 ITEM_DESC_V_OFFSET = 150 From 1e0564b4844acafbb733bfb7ae55b4ed0c93dd07 Mon Sep 17 00:00:00 2001 From: nayan Date: Thu, 20 Nov 2025 08:05:20 -0500 Subject: [PATCH 2/6] this --- system/ui/sunnypilot/lib/styles.py | 2 +- system/ui/sunnypilot/widgets/list_view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/ui/sunnypilot/lib/styles.py b/system/ui/sunnypilot/lib/styles.py index 2c694a1f38..28d50f48d7 100644 --- a/system/ui/sunnypilot/lib/styles.py +++ b/system/ui/sunnypilot/lib/styles.py @@ -5,7 +5,7 @@ from dataclasses import dataclass class Base: # Widget/Control Base Dimensions ITEM_BASE_HEIGHT = 170 - ITEM_PADDING = 30 + ITEM_PADDING = 20 ITEM_TEXT_FONT_SIZE = 50 ITEM_DESC_FONT_SIZE = 40 ITEM_DESC_V_OFFSET = 150 diff --git a/system/ui/sunnypilot/widgets/list_view.py b/system/ui/sunnypilot/widgets/list_view.py index 2260a0ba4c..7e118f7506 100644 --- a/system/ui/sunnypilot/widgets/list_view.py +++ b/system/ui/sunnypilot/widgets/list_view.py @@ -48,7 +48,7 @@ class ListItemSP(ListItem): style.TOGGLE_WIDTH, style.TOGGLE_HEIGHT ) - text_x = left_rect.x + left_rect.width + style.ITEM_PADDING + text_x = left_rect.x + left_rect.width + style.ITEM_PADDING * 1.5 # Draw title if self.title: From 5b03369a8f1f3450a82097da369302bdddf10fc9 Mon Sep 17 00:00:00 2001 From: nayan Date: Thu, 20 Nov 2025 17:56:26 -0500 Subject: [PATCH 3/6] listitem -> listitemsp --- system/ui/sunnypilot/widgets/list_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/ui/sunnypilot/widgets/list_view.py b/system/ui/sunnypilot/widgets/list_view.py index 7e118f7506..219118298e 100644 --- a/system/ui/sunnypilot/widgets/list_view.py +++ b/system/ui/sunnypilot/widgets/list_view.py @@ -90,6 +90,6 @@ class ListItemSP(ListItem): self._html_renderer.render(description_rect) def toggle_item_sp(title: str | Callable[[], str], description: str | Callable[[], str] | None = None, initial_state: bool = False, - callback: Callable | None = None, icon: str = "", enabled: bool | Callable[[], bool] = True, param: str | None = None) -> ListItem: + callback: Callable | None = None, icon: str = "", enabled: bool | Callable[[], bool] = True, param: str | None = None) -> ListItemSP: action = ToggleActionSP(initial_state=initial_state, enabled=enabled, callback=callback, param=param) return ListItemSP(title=title, description=description, action_item=action, icon=icon, callback=callback) From 7032e4a9727783136c14c7c38ea11092e25a19be Mon Sep 17 00:00:00 2001 From: nayan Date: Thu, 20 Nov 2025 18:00:44 -0500 Subject: [PATCH 4/6] add show_description method --- system/ui/sunnypilot/widgets/list_view.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/ui/sunnypilot/widgets/list_view.py b/system/ui/sunnypilot/widgets/list_view.py index 219118298e..86dbde2797 100644 --- a/system/ui/sunnypilot/widgets/list_view.py +++ b/system/ui/sunnypilot/widgets/list_view.py @@ -19,6 +19,9 @@ class ListItemSP(ListItem): action_item: ItemAction | None = None): ListItem.__init__(self, title, icon, description, description_visible, callback, action_item) + def show_description(self, show: bool): + self._set_description_visible(show) + def get_right_item_rect(self, item_rect: rl.Rectangle) -> rl.Rectangle: if not self.action_item: return rl.Rectangle(0, 0, 0, 0) From e6f5aae2464cea37804eeef87c0aa7793bc6fa89 Mon Sep 17 00:00:00 2001 From: nayan Date: Thu, 20 Nov 2025 18:05:12 -0500 Subject: [PATCH 5/6] =?UTF-8?q?remove=20padding=20from=20line=20separator.?= =?UTF-8?q?=20like,=20WHY=3F=20=F0=9F=98=A9=F0=9F=98=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/ui/widgets/scroller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/ui/widgets/scroller.py b/system/ui/widgets/scroller.py index a843010d56..eec75c8592 100644 --- a/system/ui/widgets/scroller.py +++ b/system/ui/widgets/scroller.py @@ -17,8 +17,8 @@ class LineSeparator(Widget): self._rect.width = parent_rect.width def _render(self, _): - rl.draw_line(int(self._rect.x) + LINE_PADDING, int(self._rect.y), - int(self._rect.x + self._rect.width) - LINE_PADDING, int(self._rect.y), + rl.draw_line(int(self._rect.x), int(self._rect.y), + int(self._rect.x + self._rect.width), int(self._rect.y), LINE_COLOR) From ed775185f2434f2383bf68887805be3260c24eef Mon Sep 17 00:00:00 2001 From: nayan Date: Fri, 21 Nov 2025 17:49:27 -0500 Subject: [PATCH 6/6] use gui_app.sunnypilot_ui() --- common/params_keys.h | 1 - selfdrive/ui/layouts/settings/developer.py | 2 +- selfdrive/ui/layouts/settings/toggles.py | 2 +- selfdrive/ui/tests/test_ui/raylib_screenshots.py | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/common/params_keys.h b/common/params_keys.h index fe08062987..38578d7ddc 100644 --- a/common/params_keys.h +++ b/common/params_keys.h @@ -173,7 +173,6 @@ inline static std::unordered_map keys = { {"ShowAdvancedControls", {PERSISTENT | BACKUP, BOOL, "0"}}, {"ShowTurnSignals", {PERSISTENT | BACKUP, BOOL, "0"}}, {"StandstillTimer", {PERSISTENT | BACKUP, BOOL, "0"}}, - {"sunnypilot_ui", {PERSISTENT, BOOL, "1"}}, {"TrueVEgoUI", {PERSISTENT | BACKUP, BOOL, "0"}}, // MADS params diff --git a/selfdrive/ui/layouts/settings/developer.py b/selfdrive/ui/layouts/settings/developer.py index d133a992ad..f47cd310ca 100644 --- a/selfdrive/ui/layouts/settings/developer.py +++ b/selfdrive/ui/layouts/settings/developer.py @@ -9,7 +9,7 @@ from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.lib.multilang import tr, tr_noop from openpilot.system.ui.widgets import DialogResult -if Params().get_bool("sunnypilot_ui"): +if gui_app.sunnypilot_ui(): from openpilot.system.ui.sunnypilot.widgets.list_view import toggle_item_sp as toggle_item # Description constants diff --git a/selfdrive/ui/layouts/settings/toggles.py b/selfdrive/ui/layouts/settings/toggles.py index 86c27aa7c8..b7f176e24f 100644 --- a/selfdrive/ui/layouts/settings/toggles.py +++ b/selfdrive/ui/layouts/settings/toggles.py @@ -9,7 +9,7 @@ from openpilot.system.ui.lib.multilang import tr, tr_noop from openpilot.system.ui.widgets import DialogResult from openpilot.selfdrive.ui.ui_state import ui_state -if Params().get_bool("sunnypilot_ui"): +if gui_app.sunnypilot_ui(): from openpilot.system.ui.sunnypilot.widgets.list_view import toggle_item_sp as toggle_item PERSONALITY_TO_INT = log.LongitudinalPersonality.schema.enumerants diff --git a/selfdrive/ui/tests/test_ui/raylib_screenshots.py b/selfdrive/ui/tests/test_ui/raylib_screenshots.py index 3cc5b01541..d3de616cc0 100755 --- a/selfdrive/ui/tests/test_ui/raylib_screenshots.py +++ b/selfdrive/ui/tests/test_ui/raylib_screenshots.py @@ -294,7 +294,6 @@ def create_screenshots(): with OpenpilotPrefix(): params = Params() params.put("DongleId", "123456789012345") - params.put_bool("sunnypilot_ui", True) # Set branch name params.put("UpdaterCurrentDescription", VERSION)