diff --git a/selfdrive/ui/layouts/settings/settings.py b/selfdrive/ui/layouts/settings/settings.py index ab632494e..5b54909b3 100644 --- a/selfdrive/ui/layouts/settings/settings.py +++ b/selfdrive/ui/layouts/settings/settings.py @@ -19,7 +19,7 @@ SIDEBAR_WIDTH = 500 CLOSE_BTN_SIZE = 200 CLOSE_ICON_SIZE = 70 NAV_BTN_HEIGHT = 110 -PANEL_MARGIN = 50 +PANEL_MARGIN = 10 # Colors SIDEBAR_COLOR = rl.BLACK @@ -158,7 +158,7 @@ class SettingsLayout(Widget): def _draw_current_panel(self, rect: rl.Rectangle): rl.draw_rectangle_rounded(rl.Rectangle(rect.x + 10, rect.y + 10, rect.width - 20, rect.height - 20), 0.04, 30, PANEL_COLOR) - content_rect = rl.Rectangle(rect.x + PANEL_MARGIN, rect.y + 25, rect.width - (PANEL_MARGIN * 2), rect.height - 50) + content_rect = rl.Rectangle(rect.x + PANEL_MARGIN, rect.y + 10, rect.width - (PANEL_MARGIN * 2), rect.height - 20) # rl.draw_rectangle_rounded(content_rect, 0.03, 30, PANEL_COLOR) panel = self._panels[self._current_panel] if panel.instance: diff --git a/selfdrive/ui/layouts/settings/starpilot/aethergrid.py b/selfdrive/ui/layouts/settings/starpilot/aethergrid.py index 09f8b7f27..c079ecff3 100644 --- a/selfdrive/ui/layouts/settings/starpilot/aethergrid.py +++ b/selfdrive/ui/layouts/settings/starpilot/aethergrid.py @@ -294,12 +294,12 @@ class AetherListColors: @dataclass(frozen=True) class AetherListMetrics: - max_content_width: int = 1560 - outer_margin_x: int = 18 - outer_margin_y: int = 24 - panel_padding_x: int = 16 - panel_padding_top: int = 28 - panel_padding_bottom: int = 22 + max_content_width: int = 100000 + outer_margin_x: int = 10 + outer_margin_y: int = 10 + panel_padding_x: int = 0 + panel_padding_top: int = 0 + panel_padding_bottom: int = 0 header_height: int = 0 section_gap: int = 28 section_header_height: int = 87 @@ -311,7 +311,7 @@ class AetherListMetrics: header_button_height: int = 84 header_button_gap: int = 14 # noqa: used implicitly by driving_model fade_height: int = 24 - content_right_gutter: int = 18 + content_right_gutter: int = 0 toggle_width: int = 113 toggle_height: int = 61 toggle_right_inset: int = 49 diff --git a/selfdrive/ui/layouts/settings/starpilot/appearance.py b/selfdrive/ui/layouts/settings/starpilot/appearance.py index 13af52420..889819005 100644 --- a/selfdrive/ui/layouts/settings/starpilot/appearance.py +++ b/selfdrive/ui/layouts/settings/starpilot/appearance.py @@ -148,8 +148,8 @@ class AppearanceManagerView(AetherSettingsView): self.set_rect(rect) self._interactive_rects.clear() - margin_x = 18.0 - margin_y = 24.0 + margin_x = 10.0 + margin_y = 10.0 grid_x = rect.x + margin_x grid_y = rect.y + margin_y diff --git a/selfdrive/ui/layouts/settings/starpilot/lateral.py b/selfdrive/ui/layouts/settings/starpilot/lateral.py index 841f68a9e..0c26ef592 100644 --- a/selfdrive/ui/layouts/settings/starpilot/lateral.py +++ b/selfdrive/ui/layouts/settings/starpilot/lateral.py @@ -104,8 +104,8 @@ class SteeringManagerView(AetherSettingsView): self.set_rect(rect) self._interactive_rects.clear() - margin_x = 18.0 - margin_y = 24.0 + margin_x = 10.0 + margin_y = 10.0 grid_x = rect.x + margin_x grid_y = rect.y + margin_y diff --git a/selfdrive/ui/layouts/settings/starpilot/longitudinal.py b/selfdrive/ui/layouts/settings/starpilot/longitudinal.py index cce1133c2..6bdabd3f2 100644 --- a/selfdrive/ui/layouts/settings/starpilot/longitudinal.py +++ b/selfdrive/ui/layouts/settings/starpilot/longitudinal.py @@ -93,8 +93,8 @@ class AdaptiveSpeedView(Widget): )) def _render(self, rect: rl.Rectangle): - margin_x = 18.0 - margin_y = 24.0 + margin_x = 10.0 + margin_y = 10.0 grid_x = rect.x + margin_x grid_y = rect.y + margin_y grid_w = rect.width - margin_x * 2 @@ -185,8 +185,8 @@ class LongitudinalManagerView(AetherSettingsView): self.set_rect(rect) self._interactive_rects.clear() - margin_x = 18.0 - margin_y = 24.0 + margin_x = 10.0 + margin_y = 10.0 grid_x = rect.x + margin_x grid_y = rect.y + margin_y @@ -213,13 +213,7 @@ class LongitudinalManagerView(AetherSettingsView): class ConditionalDriveModeView(PanelManagerView): - METRICS = replace( - COMPACT_PANEL_METRICS, - outer_margin_y=14, - panel_padding_top=16, - panel_padding_bottom=14, - header_height=0, - ) + METRICS = COMPACT_PANEL_METRICS TAB_HEIGHT = 98 TAB_BOTTOM_GAP = 26 @@ -469,7 +463,7 @@ class ConditionalDriveModeView(PanelManagerView): def _draw_scroll_content(self, rect: rl.Rectangle, content_width: float): y = rect.y + self._scroll_offset - header_w = content_width - AETHER_LIST_METRICS.content_right_gutter + header_w = content_width bar_rect = rl.Rectangle(rect.x, y, header_w, self.TAB_HEIGHT) draw_list_group_shell(bar_rect, style=PANEL_STYLE) self._drive_mode_control.render(bar_rect) diff --git a/selfdrive/ui/layouts/settings/starpilot/main_panel.py b/selfdrive/ui/layouts/settings/starpilot/main_panel.py index eafffb557..9629496d3 100644 --- a/selfdrive/ui/layouts/settings/starpilot/main_panel.py +++ b/selfdrive/ui/layouts/settings/starpilot/main_panel.py @@ -274,7 +274,8 @@ class StarPilotLayout(Widget): def _render(self, rect: rl.Rectangle): TOP_BAR_HEIGHT = 72 - content_rect = rl.Rectangle(rect.x, rect.y + TOP_BAR_HEIGHT, rect.width, rect.height - TOP_BAR_HEIGHT) + BOTTOM_BAR_HEIGHT = 10 + content_rect = rl.Rectangle(rect.x, rect.y + TOP_BAR_HEIGHT, rect.width, rect.height - TOP_BAR_HEIGHT + BOTTOM_BAR_HEIGHT) # Standardize width to perfectly match subpanel shells shell_w = min(rect.width - AETHER_LIST_METRICS.outer_margin_x * 2, AETHER_LIST_METRICS.max_content_width) diff --git a/selfdrive/ui/layouts/settings/starpilot/maps.py b/selfdrive/ui/layouts/settings/starpilot/maps.py index d6a1774b5..d0848a9c7 100644 --- a/selfdrive/ui/layouts/settings/starpilot/maps.py +++ b/selfdrive/ui/layouts/settings/starpilot/maps.py @@ -79,7 +79,7 @@ HEADER_SUBTITLE_HEIGHT = 24 HEADER_BOTTOM_GAP = 12 BROWSER_SECTION_HEADER_HEIGHT = AETHER_LIST_METRICS.section_header_height BROWSER_SECTION_HEADER_GAP = AETHER_LIST_METRICS.section_header_gap -BROWSER_INSET = AETHER_LIST_METRICS.content_right_gutter +BROWSER_INSET = 10 BROWSER_TAB_GAP = AETHER_LIST_METRICS.section_header_gap BROWSER_CONTEXT_TAB_HEIGHT = 68 BROWSER_REGION_ROW_HEIGHT = AETHER_LIST_METRICS.row_height diff --git a/selfdrive/ui/layouts/settings/starpilot/sectioned_panel.py b/selfdrive/ui/layouts/settings/starpilot/sectioned_panel.py index 9a6cf6ae9..9144643a3 100644 --- a/selfdrive/ui/layouts/settings/starpilot/sectioned_panel.py +++ b/selfdrive/ui/layouts/settings/starpilot/sectioned_panel.py @@ -23,7 +23,7 @@ class TileSection: class SectionedTileLayout(Widget): def __init__(self, section_gap: int = 28, title_height: int = 49, title_gap: int = 17, min_row_height: int = 218, max_row_height: int = 406, top_padding: int = 0, - horizontal_padding: int = SPACING.xl, max_content_width: int | None = 1560): + horizontal_padding: int = 10, max_content_width: int | None = None): super().__init__() self._sections: list[TileSection] = [] self._section_gap = section_gap diff --git a/selfdrive/ui/layouts/settings/starpilot/sounds.py b/selfdrive/ui/layouts/settings/starpilot/sounds.py index 237473adf..d42106a12 100644 --- a/selfdrive/ui/layouts/settings/starpilot/sounds.py +++ b/selfdrive/ui/layouts/settings/starpilot/sounds.py @@ -37,9 +37,6 @@ from openpilot.selfdrive.ui.layouts.settings.starpilot.aethergrid import ( PANEL_STYLE = DEFAULT_PANEL_STYLE SOUNDS_PANEL_METRICS = replace( COMPACT_PANEL_METRICS, - outer_margin_y=10, - panel_padding_top=12, - panel_padding_bottom=14, header_height=0, ) diff --git a/selfdrive/ui/layouts/settings/starpilot/system_settings.py b/selfdrive/ui/layouts/settings/starpilot/system_settings.py index 2b38f54fe..4d6c370f8 100644 --- a/selfdrive/ui/layouts/settings/starpilot/system_settings.py +++ b/selfdrive/ui/layouts/settings/starpilot/system_settings.py @@ -95,11 +95,7 @@ REPORT_CATEGORIES = [ FADE_HEIGHT = AETHER_LIST_METRICS.fade_height PANEL_STYLE = DEFAULT_PANEL_STYLE -SYSTEM_PANEL_METRICS = replace( - AETHER_LIST_METRICS, - outer_margin_y=14, - panel_padding_bottom=14, -) +SYSTEM_PANEL_METRICS = AETHER_LIST_METRICS class SystemSettingsManagerView(PanelManagerView): diff --git a/selfdrive/ui/layouts/settings/starpilot/vehicle.py b/selfdrive/ui/layouts/settings/starpilot/vehicle.py index 165d9dbd2..554fa5739 100644 --- a/selfdrive/ui/layouts/settings/starpilot/vehicle.py +++ b/selfdrive/ui/layouts/settings/starpilot/vehicle.py @@ -71,12 +71,7 @@ PANEL_STYLE = DEFAULT_PANEL_STYLE class VehicleSettingsManagerView(PanelManagerView): - METRICS = replace(COMPACT_PANEL_METRICS, - header_height=0, - outer_margin_y=14, - panel_padding_top=16, - panel_padding_bottom=14, - ) + METRICS = COMPACT_PANEL_METRICS def __init__(self, controller: "StarPilotVehicleSettingsLayout"): super().__init__()