Skip to content

feat: three-way color mode (Light/Dark/System) replacing the DarkMode bool - #701

Merged
Hirogen merged 3 commits into
Developmentfrom
698-support-for-light-mode
Aug 28, 2026
Merged

feat: three-way color mode (Light/Dark/System) replacing the DarkMode bool#701
Hirogen merged 3 commits into
Developmentfrom
698-support-for-light-mode

Conversation

@Hirogen

@Hirogen Hirogen commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #698

What

Replaces the boolean Dark Mode preference with a three-way Color mode setting:

  • Light – forced light mode (SystemColorMode.Classic), ignores the Windows theme
  • Dark – forced dark mode (SystemColorMode.Dark)
  • System – follows the Windows theme (SystemColorMode.System)

The Settings dialog now shows a "Color mode (restart required)" dropdown in the Defaults group instead of the old checkbox (labels localized in en/de/zh-CN).

Why

#698: with the old bool, unchecked used to mean "follow the OS", so users on a dark Windows theme could never force light mode. The interim fix mapped unchecked to forced light — which in turn made "follow the OS" unreachable. The enum offers all three behaviors explicitly.

Migration

  • ColorMode is stored as a string ("Light" / "Dark" / "System") via the same StringEnumConverter pattern as the other settings enums.
  • Old settings files are migrated on load through a legacy shim (same pattern as hilightGroupList): DarkMode: trueDark, DarkMode: falseLight (unchecked meant forced light per the ruling on Support for Light mode #698).
  • An explicit ColorMode key always wins over a leftover DarkMode key, regardless of JSON key order; the legacy key is never written back.
  • Fresh installs default to Light, preserving current behavior bit-for-bit.

Tests

Six new NUnit tests (PreferencesColorModeTests) cover legacy migration in both directions, the default, key-order precedence, and serialization round-trip. Full suite: 1057 passed, 0 failed.

image

BRUNER Patrick added 2 commits August 28, 2026 09:05
… bool (#698)

The Preferences setting is now a ColorMode enum serialized as a string.
Old settings files migrate on load: DarkMode=true -> Dark, false -> Light
(unchecked meant forced light per #698); an explicit ColorMode always wins.
The Settings dialog offers the three choices in a dropdown, and startup maps
System to SystemColorMode.System so follow-OS behavior is available again.
@Hirogen Hirogen linked an issue Aug 28, 2026 that may be closed by this pull request
Comment thread src/LogExpert.UI/Dialogs/SettingsDialog.cs Fixed
@Hirogen
Hirogen merged commit d4bc43b into Development Aug 28, 2026
3 checks passed
@Hirogen
Hirogen deleted the 698-support-for-light-mode branch August 28, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Light mode

1 participant