UnifiedLabel: add set_line_height

This commit is contained in:
Shane Smiskol
2026-02-23 19:37:59 -08:00
parent 19459d2b2e
commit 91930c2d0d

View File

@@ -489,6 +489,13 @@ class UnifiedLabel(Widget):
self._spacing_pixels = self._font_size * letter_spacing
self._cached_text = None # Invalidate cache
def set_line_height(self, line_height: float):
"""Update line height (multiplier, e.g., 1.0 = default)."""
new_line_height = line_height * 0.9
if self._line_height != new_line_height:
self._line_height = new_line_height
self._cached_text = None # Invalidate cache (affects total height)
def set_font_weight(self, font_weight: FontWeight):
"""Update the font weight."""
if self._font_weight != font_weight: