From 79bb351437b6db06369ca2388a8663e36ded850b Mon Sep 17 00:00:00 2001 From: Dawn Date: Fri, 18 Sep 2026 16:35:05 +0200 Subject: [PATCH] style(gui): soften the mounted-sample HUD ink on light themes Pure black (SHADOW) over the camera image read too harsh; use the theme text ink (TEXT) with the same white halo instead. Sunset keeps white on black. Co-Authored-By: Claude Fable 5.1 --- src/aare/gui/widgets/camera_image.py | 10 ++++++---- tests/unit/gui/test_camera_image.py | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/aare/gui/widgets/camera_image.py b/src/aare/gui/widgets/camera_image.py index bd6d417b..74565ad5 100644 --- a/src/aare/gui/widgets/camera_image.py +++ b/src/aare/gui/widgets/camera_image.py @@ -56,6 +56,7 @@ from aare.gui.styles import ( SCALE_BAR_GREY, SHADOW, TARGET_COLORS, + TEXT, THEME_SUNSET, TOOLTIP_TEXT, WHITE, @@ -1286,10 +1287,11 @@ class SampleCameraImageLabel(QGraphicsView): return bar_um, label def _mounted_hud_ink(self) -> tuple[str, str]: - """(text, shadow) for the mounted-sample HUD: black on a white halo in - the light themes, white on black in Sunset. The camera image behind - is arbitrary, so the pair follows the theme rather than the pixels.""" - return (WHITE, SHADOW) if self._dark_theme else (SHADOW, WHITE) + """(text, shadow) for the mounted-sample HUD: theme text ink on a white + halo in the light themes (pure black read too harsh over the camera), + white on black in Sunset. The camera image behind is arbitrary, so + the pair follows the theme rather than the pixels.""" + return (WHITE, SHADOW) if self._dark_theme else (TEXT, WHITE) def _draw_mounted_sample(self, painter: QPainter): # Top-left HUD line (legend sits bottom-left, scale bar bottom-right): diff --git a/tests/unit/gui/test_camera_image.py b/tests/unit/gui/test_camera_image.py index 428129ba..e94814bf 100644 --- a/tests/unit/gui/test_camera_image.py +++ b/tests/unit/gui/test_camera_image.py @@ -327,11 +327,11 @@ def test_mounted_sample_hud_follows_status(camera): def test_mounted_hud_ink_follows_theme(camera): - """Mounted-sample HUD: dark ink + white halo on light themes, inverted on Sunset.""" - from aare.gui.styles import SHADOW, THEME_SUNRISE, THEME_SUNSET, WHITE + """Mounted-sample HUD: theme text ink + white halo on light themes, inverted on Sunset.""" + from aare.gui.styles import SHADOW, TEXT, THEME_SUNRISE, THEME_SUNSET, WHITE camera.set_theme(THEME_SUNRISE) - assert camera._mounted_hud_ink() == (SHADOW, WHITE) + assert camera._mounted_hud_ink() == (TEXT, WHITE) camera.set_theme(THEME_SUNSET) assert camera._mounted_hud_ink() == (WHITE, SHADOW)