fix(ui): Make configuration dialogs respect in-app theme choice #15

Merged
Ghost merged 4 commits from fix/themes into main 2025-11-02 02:08:38 +00:00

The Configuration and Properties dialogs were determining their theme (light/dark) exclusively by checking the operating system's palette, which I attempted to fix yesterday but didn't fully check the UI Themes. This created a visual bug where if a user selected an explicit dark theme within the Citron UI (e.g., "Midnight Blue") while their OS was in light mode, the dialogs would incorrectly render with a light background, causing unreadable text and a broken appearance. This was essentially the reverse problem of the original testing I saw & did, and failed to swap between Dark in-Citron UI themes to test the Operating System clash, as already mentioned.

This commit refactors the theme detection logic to correctly prioritize the user's in-app selection.

  1. The IsDarkMode() helper function has been updated to follow a clear hierarchy. It first checks if the currently selected theme in UISettings is one of the known dark themes. If it is, dark mode is enforced for the dialogs, regardless of the system theme.

  2. If the selected theme is an adaptive one ("Default" or "Default Colorful"), the function falls back to the original behavior of querying the system palette. This ensures the "follow system" functionality remains intact.

  3. The dialogs now also handle the QEvent::PaletteChange to dynamically update their appearance if the OS theme is changed while they are open, improving the user experience for adaptive themes.

The Configuration and Properties dialogs were determining their theme (light/dark) exclusively by checking the operating system's palette, which I attempted to fix yesterday but didn't fully check the UI Themes. This created a visual bug where if a user selected an explicit dark theme within the Citron UI (e.g., "Midnight Blue") while their OS was in light mode, the dialogs would incorrectly render with a light background, causing unreadable text and a broken appearance. This was essentially the reverse problem of the original testing I saw & did, and failed to swap between Dark in-Citron UI themes to test the Operating System clash, as already mentioned. This commit refactors the theme detection logic to correctly prioritize the user's in-app selection. 1. The IsDarkMode() helper function has been updated to follow a clear hierarchy. It first checks if the currently selected theme in UISettings is one of the known dark themes. If it is, dark mode is enforced for the dialogs, regardless of the system theme. 2. If the selected theme is an adaptive one ("Default" or "Default Colorful"), the function falls back to the original behavior of querying the system palette. This ensures the "follow system" functionality remains intact. 3. The dialogs now also handle the QEvent::PaletteChange to dynamically update their appearance if the OS theme is changed while they are open, improving the user experience for adaptive themes.
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>
Ghost merged commit 2fde88b2b5 into main 2025-11-02 02:08:38 +00:00
Ghost deleted branch fix/themes 2025-11-02 02:08:45 +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!15
No description provided.