Files
AareDAQ/tests/unit/gui/test_styles.py
T
duan_jandClaude Fable 5.1 bf11528e86 fix(gui): zoom-proof the Dewar table and control heights, theme the mounted HUD ink
Dewar "#" column sat 1px above the other rows at some zoom steps: the
frozen-column overlay sizes its own header from "#" alone while the main
header also sees the symbol columns, whose fallback-font glyphs have a
taller line box. The overlay header is now pinned to the main header
height on resize and (deferred, receiver-bound) on font/style change.

Zoom also left columns at their startup widths (headers truncated) and
clipped descenders in every button/combo/entry box: the 16px height pin
in both sheets was raw px while the body font grew to 18/21px. Columns
re-autosize on FontChange and the pin scales with the font ladder.

Camera "Currently mounted" HUD: black ink on a white halo in the light
themes, white on black in Sunset, instead of white-on-black everywhere.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 18:44:56 +02:00

21 lines
784 B
Python

"""App stylesheet knobs that must track the font zoom ladder."""
from aare.gui import styles
def test_control_height_scales_with_font_ladder():
"""Buttons/inputs pinned at 16px clipped descenders at 125/150%; the pin
must scale with the ladder in both sheets."""
try:
styles.set_font_scale(1.0)
for theme in (styles.THEME_SUNRISE, styles.THEME_SUNSET):
assert "max-height: 16px" in styles.build_app_stylesheet(theme), theme
styles.set_font_scale(1.5)
for theme in (styles.THEME_SUNRISE, styles.THEME_SUNSET):
sheet = styles.build_app_stylesheet(theme)
assert "max-height: 24px" in sheet, theme
assert "max-height: 16px" not in sheet, theme
finally:
styles.set_font_scale(1.0)