mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-19 00:02:08 +08:00
Big UI: Cleanup
This commit is contained in:
@@ -2057,7 +2057,7 @@ def draw_list_group_shell(
|
||||
*,
|
||||
fill: rl.Color | None = None,
|
||||
border: rl.Color | None = None,
|
||||
radius: float = 0.055,
|
||||
radius: float = 0.08,
|
||||
segments: int = 18,
|
||||
style: PanelStyle = DEFAULT_PANEL_STYLE,
|
||||
):
|
||||
@@ -3424,7 +3424,7 @@ class AetherSettingsView(PanelManagerView):
|
||||
pressed=pressed,
|
||||
is_last=is_last,
|
||||
show_chevron=row.on_click is not None,
|
||||
title_size=34, subtitle_size=22, value_size=28,
|
||||
title_size=41, subtitle_size=28, value_size=34,
|
||||
style=self._panel_style,
|
||||
)
|
||||
elif row.type == "action":
|
||||
@@ -3440,8 +3440,8 @@ class AetherSettingsView(PanelManagerView):
|
||||
pressed=pressed,
|
||||
is_last=is_last,
|
||||
action_pill=True,
|
||||
title_size=34, subtitle_size=22,
|
||||
action_pill_height=AETHER_LIST_METRICS.toggle_height, action_text_size=24,
|
||||
title_size=41, subtitle_size=28,
|
||||
action_pill_height=AETHER_LIST_METRICS.toggle_height, action_text_size=28,
|
||||
action_text_color=action_text_color,
|
||||
action_fill=action_fill,
|
||||
action_border=action_border,
|
||||
@@ -3485,19 +3485,14 @@ class CardHubManagerView(AetherSettingsView):
|
||||
def _render(self, rect: rl.Rectangle):
|
||||
self.set_rect(rect)
|
||||
self._interactive_rects.clear()
|
||||
mx = float(self._metrics.outer_margin_x)
|
||||
my = float(self._metrics.outer_margin_y)
|
||||
grid_x = rect.x + mx
|
||||
grid_y = rect.y + my
|
||||
grid_w = rect.width - mx * 2
|
||||
grid_h = rect.y + rect.height - grid_y - my
|
||||
self._scroll_rect = rl.Rectangle(grid_x, grid_y, grid_w, grid_h)
|
||||
self._content_height = grid_h
|
||||
frame, scroll_rect, content_width = init_list_panel(rect, self._panel_style, self._metrics)
|
||||
self._scroll_rect = scroll_rect
|
||||
self._content_height = scroll_rect.height
|
||||
self._scroll_panel.set_enabled(self.is_visible)
|
||||
self._scroll_offset = self._scroll_panel.update(
|
||||
self._scroll_rect, self._scroll_rect.height)
|
||||
scroll_rect, scroll_rect.height)
|
||||
self._scroll_offset = 0.0
|
||||
self._draw_scroll_content(self._scroll_rect, self._scroll_rect.width)
|
||||
self._draw_scroll_content(scroll_rect, content_width)
|
||||
|
||||
def _draw_scroll_content(self, rect: rl.Rectangle, width: float):
|
||||
y = rect.y + self._scroll_offset
|
||||
|
||||
@@ -275,7 +275,7 @@ class StarPilotLayout(Widget):
|
||||
def _render(self, rect: rl.Rectangle):
|
||||
TOP_BAR_HEIGHT = 72
|
||||
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)
|
||||
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)
|
||||
|
||||
@@ -259,7 +259,7 @@ class SoundsManagerView(AdjustorTogglesPanelView):
|
||||
|
||||
def _draw_utility_column(self, y: float, x: float, width: float):
|
||||
draw_list_group_shell(rl.Rectangle(x, y, width, self._tiles_container_h), style=PANEL_STYLE)
|
||||
header_y = draw_group_header(x + 24, y + 4, width - 48, tr("ALERTS"))
|
||||
header_y = draw_group_header(x + 24, y + 4, width - 48, tr("Alerts"))
|
||||
avail_h = self._tiles_container_h - (header_y - y)
|
||||
self._render_page_grid(self._toggle_grid, rl.Rectangle(x + 12, header_y, width - 24, max(0.0, avail_h - 12)))
|
||||
|
||||
|
||||
@@ -551,15 +551,15 @@ class SystemSettingsManagerView(PanelManagerView):
|
||||
adj_container_h = self._system_max_container_h
|
||||
|
||||
draw_list_group_shell(rl.Rectangle(x, y, column_w, adj_container_h), style=PANEL_STYLE)
|
||||
|
||||
|
||||
current_y = y + 4
|
||||
current_y = draw_group_header(x + 24, current_y, column_w - 48, tr("DISPLAY"))
|
||||
current_y = draw_group_header(x + 24, current_y, column_w - 48, tr("Display"))
|
||||
for index, key in enumerate(self._display_slider_keys):
|
||||
current_y = self._draw_slider_row(rl.Rectangle(x, current_y, column_w, 0), key, is_last=index == len(self._display_slider_keys) - 1)
|
||||
|
||||
current_y += SECTION_GAP
|
||||
|
||||
current_y = draw_group_header(x + 24, current_y, column_w - 48, tr("POWER"))
|
||||
current_y = draw_group_header(x + 24, current_y, column_w - 48, tr("Power"))
|
||||
for index, key in enumerate(self._power_slider_keys):
|
||||
current_y = self._draw_slider_row(rl.Rectangle(x, current_y, column_w, 0), key, is_last=index == len(self._power_slider_keys) - 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user