From 9ce9920ff7503e16f5ea6eefcbf4ab1697546299 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 4 Nov 2025 03:21:20 +0800 Subject: [PATCH] ui: fix label text eliding to account for icon width (#36539) fix label text eliding to account for icon width --- system/ui/widgets/label.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/ui/widgets/label.py b/system/ui/widgets/label.py index 4259208107..59d6a5947b 100644 --- a/system/ui/widgets/label.py +++ b/system/ui/widgets/label.py @@ -145,6 +145,8 @@ class Label(Widget): # Elide text to fit within the rectangle text_size = measure_text_cached(self._font, text, self._font_size) content_width = self._rect.width - self._text_padding * 2 + if self._icon: + content_width -= self._icon.width + ICON_PADDING if text_size.x > content_width: _ellipsis = "..." left, right = 0, len(text)