Dark mode by default with light mode toggle - #3
Merged
Conversation
- New Theme class: dark (VS Code Dark+ palette) and light (previous look) themes for every surface, persisted to %APPDATA%\codeviewer\settings.txt; dark is the default - Languages.cs: semantic syntax tokens with per-theme palettes; light output identical to the old hardcoded colors - Live toggle via View > Light Mode: retints all open editors, tree, owner-drawn tabs, menus/context menus, docker panel, and the markdown preview without reopening anything - VS Code-style blue status bar in both themes - Native chrome: dark titlebar (DwmSetWindowAttribute) and dark scrollbars (SetWindowTheme), best-effort and crash-safe - ThemedTabControl paints the native tab strip/pane border that ignores BackColor - Compile Markdown (F7) still always emits the light stylesheet for standalone HTML output - Bump version to 1.1.0 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codeviewer now starts in a VS Code Dark+-style dark theme. View > Light Mode toggles the previous light look live — every open editor, the folder tree, tabs, menus, status bar, docker panel, and markdown preview restyle in place. The choice persists across runs in
%APPDATA%\codeviewer\settings.txt(missing/corrupt file falls back to dark).Changes
Theme.cs(new) — named colors for every UI surface withTheme.Dark/Theme.Lightinstances, settings persistence, and aProfessionalColorTable/ToolStripProfessionalRendererpair that themes the menu bar, context menus, and status strip.Languages.cs— syntax colors are now semantic tokens (comment, keyword, type, string, number, ...) resolved against a per-theme palette. Dark uses VS Code Dark+ token colors (#6A9955comments,#569CD6keywords,#4EC9B0types,#CE9178strings, ...); light resolves to exactly the previous hardcoded colors, so light mode looks identical to v1.0.0.MainForm.cs— theme plumbing:ApplyTheme()restyles everything live; Scintilla editors are fully re-styled in the correct order (default style →StyleClearAll→ margins/caret/selection → lexer colors); tabs are owner-drawn, and a smallThemedTabControlsubclass paints the native tab strip/pane border that ignoresBackColor; VS Code-style blue (#007ACC) status bar in both themes; native dark titlebar (DwmSetWindowAttribute) and dark scrollbars (SetWindowTheme), best-effort with silent fallback on older Windows.DockerPanel.cs— participates in theming (lists, headers, toolbar, flat-style button in dark).Testing
dotnet build -c Release: 0 warnings, 0 errors.#1E1E1E, tab strip#252526, status#007ACC), light theme via settings file, settings cleanup restores dark default.🤖 Generated with Claude Code