Skip to content

feat: Dark mode / system-adaptive theme #151

@MaximumTrainer

Description

@MaximumTrainer

Summary

Add a dark mode option and make the application theme respond to the operating system's dark/light preference, in addition to an explicit toggle in Preferences.

Motivation

The app currently uses a hardcoded light-grey stylesheet. Users working in dimly-lit environments (indoor trainer sessions, evening rides) benefit from a dark UI that reduces eye strain and is consistent with OS-wide dark mode.

Acceptance Criteria

  • A Theme setting in Preferences offers three options: Light, Dark, System (default: System)
  • ''System'' tracks QStyleHints::colorScheme (Qt 6.5+) and falls back to a heuristic (palette midpoint brightness) on Qt 5 / older Qt 6
  • All custom QSS stylesheets (z_stylesheet.cpp) are parameterised with two colour palettes (light and dark) instead of hard-coded colour literals
  • All custom-drawn QWT plots, progress bars, and overlay widgets respect the active palette
  • Theme changes apply immediately without restarting the application
  • The WASM build reads the browser's prefers-color-scheme media query on startup and applies it as the initial theme
  • No regressions on the existing light theme across all platforms (CI screenshots compared)
  • Unit tests verify palette switching does not produce invalid/transparent colours

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions