Skip to content

feat(ui): tune dark theme colors and make ToolStrip icons visible - #743

Closed
mfkeeq199458 wants to merge 3 commits into
LogExperts:Developmentfrom
mfkeeq199458:feature/dark-theme-color-tuning
Closed

mfkeeq199458 wants to merge 3 commits into
LogExperts:Developmentfrom
mfkeeq199458:feature/dark-theme-color-tuning

Conversation

@mfkeeq199458

@mfkeeq199458 mfkeeq199458 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary of changes

ToolStrip dark adaptation (LogTabWindow.cs)

  • Add ConfigureToolStripDark(): installs a ToolStripManager global renderer with a VS Dark-derived color palette. Bypasses ToolStripContainer's TopToolStripPanel which forces RenderMode=System on every child bar.
  • Add DarkToolStripRenderer: OnRenderItemImage inverts dark-mode PNG glyphs via ColorMatrix so toolbar icons render as light-on-transparent against the dark bar; OnRenderItemText forces light foreground text.
  • Add DarkToolStripColorTable: override ProfessionalColorTable with VS2015 Dark Theme surface/highlight/accent colors.

Hard-coded color fixes

  • PaintHelper.cs: soft off-white foreground (220 220 220) instead of pure #FFFFFF to reduce eye strain; centralize bookmark marker color as BookmarkMarkerTextColor property (brighter orange on dark).
  • LogWindow.cs: bookmark column colors get more saturation on dark.
  • LedIndicatorService.cs: off/neutral LEDs brightened on dark; signal colors (red/orange/yellow/green) kept theme-independent.
  • ColorComboBox.cs: border / text / hatch brush adapt to Application.IsDarkModeEnabled.
  • HighlightEntryDialog.cs: preview label foreground fallback chooses Color.White on dark instead of always falling back to Color.Black.

Test plan

  • Build passes with 0 errors
  • OnRenderItemImage called and e.Image non-null at runtime
  • Run dark mode and verify: toolbar icons visible, colors readable, dropdowns, hover/pressed states, dialog previews

Risk

  • ToolStripManager.VisualStylesEnabled = false is app-global (only set in dark mode). Other dialogs with ToolStrips not yet verified.
  • ColorMatrix inverts ALL RGB channels — correct for monochrome glyphs but would flip semantic colored icons if any are added later.

## Summary of changes

### ToolStrip dark adaptation (LogTabWindow.cs)
- Add ConfigureToolStripDark(): installs a ToolStripManager global renderer
  with a VS Dark-derived color palette. Bypasses ToolStripContainer's
  TopToolStripPanel which forces RenderMode=System on every child bar.
- Add DarkToolStripRenderer: OnRenderItemImage inverts dark-mode PNG
  glyphs via ColorMatrix so toolbar icons render as light-on-transparent
  against the dark bar; OnRenderItemText forces light foreground text.
- Add DarkToolStripColorTable: override ProfessionalColorTable with
  VS2015 Dark Theme surface/highlight/accent colors.

### Hard-coded color fixes
- PaintHelper.cs: soft off-white foreground (220 220 220) instead of
  pure #FFFFFF to reduce eye strain; centralize bookmark marker color
  as BookmarkMarkerTextColor property (brighter orange on dark).
- LogWindow.cs: bookmark column colors get more saturation on dark.
- LedIndicatorService.cs: off/neutral LEDs brightened on dark; signal
  colors (red/orange/yellow/green) kept theme-independent.
- ColorComboBox.cs: border / text / hatch brush adapt to Application.IsDarkModeEnabled.
- HighlightEntryDialog.cs: preview label foreground fallback chooses
  Color.White on dark instead of always falling back to Color.Black.

## Test plan
- [x] Build passes with 0 errors
- [x] OnRenderItemImage called and e.Image non-null at runtime
- [ ] Run dark mode and verify: toolbar icons visible, colors readable,
  dropdowns, hover/pressed states, dialog previews

## Risk
- ToolStripManager.VisualStylesEnabled = false is app-global (only set
  in dark mode). Other dialogs with ToolStrips not yet verified.
- ColorMatrix inverts ALL RGB channels — correct for monochrome glyphs
  but would flip semantic colored icons if any are added later.

@Hirogen Hirogen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review

Thanks for this, the dark toolbar is a clear improvement. The colour fixes in PaintHelper, LedIndicatorService, LogWindow and ColorComboBox only apply in dark mode, and user-configured highlight colours still win. Most of my points are about the toolbar renderer: it applies to every ToolStrip in the app, and its icon inversion has a few side effects. The "Run dark mode and verify" item in the test plan is still unchecked, and most of the problems below would show up in that check.

Toolbar renderer

Icon inversion

  • Coloured icons are already inverted today, not just "if any are added later":

    • The tail button image (toolStripButtonTail, embedded in LogTabWindow.resx) is blue and becomes orange.
    • External-tool favourites take their icon from the .exe (SetToolIcon → icon.ToBitmap()). Those are always coloured and all get inverted.

    The monochrome PNGs in Resources (File_open, bookmark_bubbles, …) are fine. One option is to only invert images that come from Resources, or to ship light variants of those glyphs.

OnRenderItemImage replaces the base method without calling it

  • Disabled items are no longer greyed out, so disabled buttons look exactly like enabled ones.
  • e.ImageAttributes is ignored, so ImageTransparentColor = Magenta no longer works.
  • It sets InterpolationMode, SmoothingMode and PixelOffsetMode on the shared e.Graphics and never resets them, so later painting is affected too.

Global scope

  • ToolStripManager.Renderer and VisualStylesEnabled = false apply to the whole process.
    • Every ToolStrip and ContextMenuStrip that uses ManagerRenderMode gets the dark renderer and the inversion. That includes the tab context menu, the LogWindow context menus, the BookmarkWindow menu and plugin UIs, not just the main bars. Please check those.
    • The settings are made in the LogTabWindow constructor, so every new window sets them again.
  • Nothing resets them when switching back to light mode. That's only acceptable because changing the colour mode needs a restart. Please say so in a comment.

Text colour

  • OnRenderItemText replaces any text colour with brightness ≤ 0.5, not only the default black. Text that was deliberately coloured is overridden too.

Consistency

  • The PR says it uses a soft off-white (220, 220, 220) instead of pure white. But ColorComboBox uses Brushes.White, and the HighlightEntryDialog preview falls back to Color.White. The preview then doesn't match the grid, which now draws 220. PaintHelper.GetForeColorFromHighlightEntry, or the same constant, would keep them in line.
  • Color.FromArgb(220, 220, 220) is hard-coded in both PaintHelper and the renderer.
  • DarkToolStripColorTable hard-codes a second VS2015 palette. DockPanel already uses VS2015DarkTheme, whose ColorPalette could supply these colours.
  • PaintHelper.BookmarkMarkerTextColor reads Application.IsDarkModeEnabled directly. The other PaintHelper colour methods take a bool darkMode parameter, which keeps them testable.

Structure

About 150 lines of theming (ConfigureToolStripDark, DarkToolStripRenderer, DarkToolStripColorTable) go into LogTabWindow, which is already far too large. Please move the renderer and the colour table into their own files, for example under src/LogExpert.UI/Theming/.

Smaller points

  • LogWindow overrides BookmarkColor / AutoBookmarkColor in dark mode but has no else branch. That's fine as long as the theme is never applied again at runtime.
  • ColorComboBox creates new SolidBrush(rectColor) on every paint and never disposes it. The leak was already there, but since that hunk is edited anyway, a using would fix it.
  • using System.Windows.Forms; in HighlightEntryDialog.cs and LedIndicatorService.cs isn't needed, because implicit usings are on.

Tests

None were added. PaintHelperTests and LedIndicatorServiceTests already exist. Please cover BookmarkMarkerTextColor, the dark foreground colour and the LED dark-mode colours.

@mfkeeq199458

Copy link
Copy Markdown
Contributor Author
image image

mfkeeq199458 and others added 2 commits October 23, 2026 00:37
The renderer and colour table lived inside LogTabWindow and carried a palette
of their own, so the toolbars drifted from the dock panel colours. Move both
into LogExpert.UI/Theming, build them on the VS2015DarkTheme palette the dock
panel already uses, and install them process-wide from ToolStripTheme so every
strip in ManagerRenderMode picks them up.

PaintHelper gains GetDefaultBackColor, GetDefaultForeColor and
GetBookmarkMarkerTextColor(bool). The grid, the colour combo box, the highlight
dialog and the LED indicator now take their colours from those instead of
repeating the dark-mode ternaries, which is what let the highlight preview and
the grid disagree.

Adds tests for the renderer, the marker colour and the dark LED lookup.
@mfkeeq199458
mfkeeq199458 requested a review from Hirogen October 22, 2026 16:50
@mfkeeq199458
mfkeeq199458 deleted the feature/dark-theme-color-tuning branch October 23, 2026 02:27
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