feat(qt): Adapt configuration dialogs to system theme #9

Merged
Collecting merged 4 commits from feat/light-dark-fix into main 2025-11-01 03:09:53 +00:00
Owner

The main and per-game configuration dialogs used a hardcoded dark theme stylesheet. This caused a significant UI inconsistency when the rest of the application and the operating system were set to a light theme, making the dialogs difficult to read and visually jarring on both Windows and Linux.

This commit refactors the theme logic to be theme-aware.

  1. Replaces hardcoded background, text, and border colors in the .ui stylesheets with dynamic placeholders (e.g., %%BACKGROUND_COLOR%%).

  2. Implements a platform-agnostic IsDarkMode() helper that checks the application's QPalette to determine if a light or dark theme is active.

  3. Enhances the UpdateTheme() C++ method in both dialogs. It now detects the current theme and substitutes the placeholders with the correct color codes for either light or dark mode.

The configuration dialogs now seamlessly integrate with the application's appearance, correctly adapting to both light and dark system themes while retaining all custom styling features.

Thanks to @angel for reporting this issue.

The main and per-game configuration dialogs used a hardcoded dark theme stylesheet. This caused a significant UI inconsistency when the rest of the application and the operating system were set to a light theme, making the dialogs difficult to read and visually jarring on both Windows and Linux. This commit refactors the theme logic to be theme-aware. 1. Replaces hardcoded background, text, and border colors in the .ui stylesheets with dynamic placeholders (e.g., %%BACKGROUND_COLOR%%). 2. Implements a platform-agnostic IsDarkMode() helper that checks the application's QPalette to determine if a light or dark theme is active. 3. Enhances the UpdateTheme() C++ method in both dialogs. It now detects the current theme and substitutes the placeholders with the correct color codes for either light or dark mode. The configuration dialogs now seamlessly integrate with the application's appearance, correctly adapting to both light and dark system themes while retaining all custom styling features. Thanks to [@angel](https://git.citron-emu.org/angel) for reporting this [issue.](https://git.citron-emu.org/Citron/Emulator/issues/3)
Signed-off-by: Collecting <collecting@noreply.localhost>
Signed-off-by: Collecting <collecting@noreply.localhost>
Signed-off-by: Collecting <collecting@noreply.localhost>
Signed-off-by: Collecting <collecting@noreply.localhost>
Collecting deleted branch feat/light-dark-fix 2025-11-01 03:09:53 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Citron/Emulator!9
No description provided.