From 9c7c84bd038de56cbd25f9630bfcaa72b695ba8e Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 20 Dec 2025 23:30:30 -0500 Subject: [PATCH] ui: simplify non-inline action button positioning in `ListViewSP` (#1599) ui: update non-inline action button positioning in `ListViewSP` --- system/ui/sunnypilot/widgets/list_view.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/system/ui/sunnypilot/widgets/list_view.py b/system/ui/sunnypilot/widgets/list_view.py index cf69e92923..6ba41f1435 100644 --- a/system/ui/sunnypilot/widgets/list_view.py +++ b/system/ui/sunnypilot/widgets/list_view.py @@ -180,13 +180,8 @@ class ListItemSP(ListItem): return rl.Rectangle(0, 0, 0, 0) if not self.inline: - has_description = bool(self.description) and self.description_visible - - if has_description: - action_y = item_rect.y + self._text_size.y + style.ITEM_PADDING * 3 - else: - action_y = item_rect.y + item_rect.height - style.BUTTON_HEIGHT - style.ITEM_PADDING * 1.5 - + text_size = measure_text_cached(self._font, self.title, style.ITEM_TEXT_FONT_SIZE) + action_y = item_rect.y + text_size.y + style.ITEM_PADDING * 3 return rl.Rectangle(item_rect.x + style.ITEM_PADDING, action_y, item_rect.width - (style.ITEM_PADDING * 2), style.BUTTON_HEIGHT) right_width = self.action_item.get_width_hint()