Skip to content

Add a theme switcher to the sidebar and fix black text in dark mode - #13

Merged
flysimdev merged 3 commits into
flysimdev:developfrom
MarcelL94:feature/theme-switcher
Nov 10, 2026
Merged

flysimdev merged 3 commits into
flysimdev:developfrom
MarcelL94:feature/theme-switcher

Conversation

@MarcelL94

@MarcelL94 MarcelL94 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Theme switcher in the sidebar, above "Support the project": it starts on "Windows theme" (follows Windows), and each click goes Windows theme → the opposite of Windows' look → Windows' look kept fixed → back to Windows theme (Windows' look is read from AppsUseLightTheme). The choice applies immediately and is kept in window.json (WindowPreferences.Theme, stored by name; older files without it keep following Windows).
  • Dark mode text fix: the SidebarLink, ChoiceCard and Switch styles replace Fluent's implicit style for their control, so the classic theme's black Foreground showed through on dark backgrounds (e.g. "Support the project", the quality preset cards, the switch labels). They now set TextFillColorPrimaryBrush themselves.

Changes

  • Gui/AppTheme.cs (new): AppTheme enum, ThemeChoice (label, glyph, the next one in the cycle), mapping to WPF ThemeMode, WindowsTheme (reads whether Windows shows apps light or dark).
  • Gui/ViewModels/MainViewModel.cs: Theme preference, Theme / ChangeTheme for the sidebar button.
  • Gui/App.xaml.cs: applies the saved theme at startup.
  • Gui/MainWindow.xaml: the sidebar button.
  • Gui/Theme.xaml: Foreground on the three styles.
  • tests/AppThemeTests.cs (new): theme mapping, the click cycle for a light and a dark Windows, window.json round-trip.

Testing

dotnet build (no warnings) and dotnet test --solution OrthoStreamXP.slnx: 372 passed.

Notes

  • The flight-report charts read their brushes when they render, so after a switch they keep the old colours until they next redraw.
  • The README asks for PRs against develop, but that branch doesn't exist, so this targets main.

🤖 Generated with Claude Code

MarcelL94 and others added 2 commits November 10, 2026 15:43
The sidebar button cycles Windows, Light and Dark; the choice applies at once
and is kept in window.json. The SidebarLink, ChoiceCard and Switch styles now
set their own Foreground: replacing Fluent's implicit style let the classic
theme's black text show through on dark backgrounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The window follows Windows until the first click; the button shows the look
Windows gives (read from AppsUseLightTheme) and each click switches to the
other one, which is then kept in window.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@flysimdev
flysimdev changed the base branch from main to develop November 10, 2026 17:16
@flysimdev

Copy link
Copy Markdown
Owner

Hello @MarcelL94, First of all, thanks a lot for your contribution. I really appreciate your support.
Also, I want to ask you to implement the possibility of switching back to the default behavior (switching back to auto mode, which follows the Windows theme)

Clicks go Windows theme (follows Windows), then the opposite of Windows' look,
then Windows' look kept fixed, then the Windows theme again, as asked in the
review of flysimdev#13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MarcelL94

Copy link
Copy Markdown
Contributor Author

Thanks for the review! Switching back to the default behaviour is now possible: the theme button is a 3-step cycle, so users can always return to following Windows.

  1. Windows theme: follows the Windows setting (the default)
  2. The opposite of Windows' look: e.g. Dark when Windows is Light
  3. Windows' look, kept fixed: e.g. Light, even if Windows changes later

The next click goes back to Windows theme. Every click from the default changes the colours straight away, and the choice is kept in window.json across restarts.

@flysimdev flysimdev left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcelL94 Your improvement will go to the v1.2.1 release, as well as a bug fix related to the issue you posted.
Thanks one more time

@flysimdev
flysimdev merged commit c902f1e into flysimdev:develop Nov 10, 2026
1 check passed
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.

2 participants