style(gui): soften the mounted-sample HUD ink on light themes
CI / lint (pull_request) Successful in 51s
CI / test (3.12) (pull_request) Successful in 1m18s
CI / test (3.14) (pull_request) Successful in 1m15s
CI / test (3.13) (pull_request) Successful in 1m23s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m16s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m23s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m38s
CI / test-with-coverage (pull_request) Successful in 1m41s
Docs build and publish / docker (push) Successful in 10s
CI / lint (push) Successful in 35s
CI / coverage-analysis (pull_request) Successful in 10s
CI / test (3.12) (push) Canceled after 48s
CI / test (3.13) (push) Canceled after 43s
CI / test (3.14) (push) Canceled after 43s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 38s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 38s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 33s
CI / test-with-coverage (push) Canceled after 33s
CI / coverage-analysis (push) Canceled after 0s
Build and Publish / release (push) Successful in 20s
CI / lint (pull_request) Successful in 51s
CI / test (3.12) (pull_request) Successful in 1m18s
CI / test (3.14) (pull_request) Successful in 1m15s
CI / test (3.13) (pull_request) Successful in 1m23s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m16s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m23s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m38s
CI / test-with-coverage (pull_request) Successful in 1m41s
Docs build and publish / docker (push) Successful in 10s
CI / lint (push) Successful in 35s
CI / coverage-analysis (pull_request) Successful in 10s
CI / test (3.12) (push) Canceled after 48s
CI / test (3.13) (push) Canceled after 43s
CI / test (3.14) (push) Canceled after 43s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 38s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 38s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 33s
CI / test-with-coverage (push) Canceled after 33s
CI / coverage-analysis (push) Canceled after 0s
Build and Publish / release (push) Successful in 20s
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 <noreply@anthropic.com>
This commit was merged in pull request #236.
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user