Summary
Currently colors and font sizes are defined in three places:
theme_colors.py — Python constants (the source of truth for dynamic styles)
theme.qss — hardcoded hex values that must manually match theme_colors.py
.ui files — inline styleSheet properties with hardcoded hex values
This means a color change requires updating up to 3 locations.
Proposed solution
-
Template theme.qss — Replace hardcoded hex values with @VARIABLE@ placeholders (e.g. @SUCCESS@, @FONT_BODY@). Update configure_app() to substitute them from theme_colors.py before calling setStyleSheet().
-
Strip inline styleSheet from .ui files — Move those rules into theme.qss (with templated placeholders). Keep .ui files as pure layout.
-
Single source of truth — Change a color or font size in theme_colors.py → flows to .qss, Python code, and all dialogs automatically.
Files affected
src/dashpva/gui/__init__.py — update configure_app() to do template substitution
src/dashpva/gui/theme.qss — replace ~30 hardcoded hex values with @PLACEHOLDERS@
- ~8-10
.ui files with inline styleSheet properties:
launcher/launcher.ui, workflow/workflow.ui, dashpva.ui, settings_dialog.ui, workbench.ui, metadata_converter.ui, hkl_viewer_window.ui, update_dialog.ui, install/update_dialog.ui
Risk
Medium surface area — every .ui file with styles gets touched. Needs manual visual testing of each dialog after the change.
Context
Color centralization into theme_colors.py was completed in dev-peco (ROI colors, log colors, status colors, launcher contrast). This issue covers the remaining architectural step to make .qss and .ui files also consume from that single source.
Summary
Currently colors and font sizes are defined in three places:
theme_colors.py— Python constants (the source of truth for dynamic styles)theme.qss— hardcoded hex values that must manually match theme_colors.py.uifiles — inlinestyleSheetproperties with hardcoded hex valuesThis means a color change requires updating up to 3 locations.
Proposed solution
Template
theme.qss— Replace hardcoded hex values with@VARIABLE@placeholders (e.g.@SUCCESS@,@FONT_BODY@). Updateconfigure_app()to substitute them fromtheme_colors.pybefore callingsetStyleSheet().Strip inline
styleSheetfrom.uifiles — Move those rules intotheme.qss(with templated placeholders). Keep.uifiles as pure layout.Single source of truth — Change a color or font size in
theme_colors.py→ flows to.qss, Python code, and all dialogs automatically.Files affected
src/dashpva/gui/__init__.py— updateconfigure_app()to do template substitutionsrc/dashpva/gui/theme.qss— replace ~30 hardcoded hex values with@PLACEHOLDERS@.uifiles with inlinestyleSheetproperties:launcher/launcher.ui,workflow/workflow.ui,dashpva.ui,settings_dialog.ui,workbench.ui,metadata_converter.ui,hkl_viewer_window.ui,update_dialog.ui,install/update_dialog.uiRisk
Medium surface area — every
.uifile with styles gets touched. Needs manual visual testing of each dialog after the change.Context
Color centralization into
theme_colors.pywas completed indev-peco(ROI colors, log colors, status colors, launcher contrast). This issue covers the remaining architectural step to make.qssand.uifiles also consume from that single source.