From f6fc098d16a90c9774a3ed17dc3f9b2db8a30c27 Mon Sep 17 00:00:00 2001 From: nayan Date: Fri, 21 Nov 2025 23:51:16 -0500 Subject: [PATCH] size adjustments --- selfdrive/ui/sunnypilot/layouts/settings/settings.py | 7 ++++--- system/ui/sunnypilot/lib/styles.py | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/selfdrive/ui/sunnypilot/layouts/settings/settings.py b/selfdrive/ui/sunnypilot/layouts/settings/settings.py index 7460219530..21f39b3b46 100644 --- a/selfdrive/ui/sunnypilot/layouts/settings/settings.py +++ b/selfdrive/ui/sunnypilot/layouts/settings/settings.py @@ -9,6 +9,7 @@ from openpilot.selfdrive.ui.layouts.settings.software import SoftwareLayout from openpilot.selfdrive.ui.layouts.settings.toggles import TogglesLayout from openpilot.system.ui.lib.application import gui_app,MousePos from openpilot.system.ui.lib.multilang import tr_noop +from openpilot.system.ui.sunnypilot.lib.styles import style from openpilot.system.ui.widgets.scroller_tici import Scroller from openpilot.system.ui.lib.text_measure import measure_text_cached from openpilot.system.ui.widgets.network import NetworkUI @@ -98,7 +99,7 @@ class SettingsLayoutSP(OP.SettingsLayout): # Draw background if selected if is_selected: self.container_rect = rl.Rectangle( - content_x - 20, rect.y, OP.SIDEBAR_WIDTH - 70, OP.NAV_BTN_HEIGHT + content_x - 50, rect.y, OP.SIDEBAR_WIDTH - 50, OP.NAV_BTN_HEIGHT ) rl.draw_rectangle_rounded(self.container_rect, 0.2, 5, OP.CLOSE_BTN_COLOR) @@ -124,7 +125,7 @@ class SettingsLayoutSP(OP.SettingsLayout): # Close button close_btn_rect = rl.Rectangle( - rect.x + (rect.width - OP.CLOSE_BTN_SIZE) / 2, rect.y + 60, OP.CLOSE_BTN_SIZE, OP.CLOSE_BTN_SIZE + rect.x + style.ITEM_PADDING * 3, rect.y + style.ITEM_PADDING * 2, style.CLOSE_BTN_SIZE, style.CLOSE_BTN_SIZE ) pressed = (rl.is_mouse_button_down(rl.MouseButton.MOUSE_BUTTON_LEFT) and @@ -163,7 +164,7 @@ class SettingsLayoutSP(OP.SettingsLayout): # Draw navigation section with scroller nav_rect = rl.Rectangle( rect.x, - rect.y + 300, # Starting Y position for nav items + self._close_btn_rect.height + style.ITEM_PADDING * 4, # Starting Y position for nav items rect.width, rect.height - 300 # Remaining height after close button ) diff --git a/system/ui/sunnypilot/lib/styles.py b/system/ui/sunnypilot/lib/styles.py index a232ac192d..f87894a6b1 100644 --- a/system/ui/sunnypilot/lib/styles.py +++ b/system/ui/sunnypilot/lib/styles.py @@ -17,6 +17,7 @@ class Base: ITEM_TEXT_FONT_SIZE = 50 ITEM_DESC_FONT_SIZE = 40 ITEM_DESC_V_OFFSET = 150 + CLOSE_BTN_SIZE = 160 # Toggle Control TOGGLE_HEIGHT = 120