Skip to content

Refactor: template theme.qss from theme_colors.py and strip inline styles from .ui files #68

Description

@pecomyint

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

  1. 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().

  2. Strip inline styleSheet from .ui files — Move those rules into theme.qss (with templated placeholders). Keep .ui files as pure layout.

  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions