Skip to content

Fix: Dark/Light mode dialogs Find/Replace, Goto Line, and Find in Files dialogs#20

Open
electricmessiah wants to merge 1 commit into
mgelsinger:mainfrom
electricmessiah:fix/dialog-dark-background
Open

Fix: Dark/Light mode dialogs Find/Replace, Goto Line, and Find in Files dialogs#20
electricmessiah wants to merge 1 commit into
mgelsinger:mainfrom
electricmessiah:fix/dialog-dark-background

Conversation

@electricmessiah

Copy link
Copy Markdown
  • Dialog backgrounds (the space between controls) were never explicitly painted; the window class's null hbrBackground means DefWindowProc's default WM_ERASEBKGND handling is a no-op, so add an explicit handler that fills with the theme color (dark) or COLOR_BTNFACE (light).
  • Checkbox (BS_AUTOCHECKBOX) label text ignored WM_CTLCOLORBTN's color while visual styles were active, rendering black-on-dark and unreadable; strip visual styles on checkboxes in dark mode (reversible) so the color takes effect.
  • All theming (titlebar, child-control theme, checkbox visual style) was only ever applied once at dialog creation. Since these dialogs are cached (shown/hidden, not recreated), toggling dark mode after a dialog was already open left it permanently on the stale theme, and once dark had disabled a checkbox's visual style, going back to light never restored it. Re-apply full theming on every dialog show and immediately when dark mode is toggled while a dialog is already open.
  • Fixed a pre-existing layout bug surfaced by the above: the Wrap around checkbox's bounding box (x=330..410) overlapped the button column (x=360..450) by 50px in the Find/Replace dialog; widened the dialog and shifted the button column clear of it.

…n dark mode

- Dialog backgrounds (the space between controls) were never explicitly
  painted; the window class's null hbrBackground means DefWindowProc's
  default WM_ERASEBKGND handling is a no-op, so add an explicit handler
  that fills with the theme color (dark) or COLOR_BTNFACE (light).
- Checkbox (BS_AUTOCHECKBOX) label text ignored WM_CTLCOLORBTN's color
  while visual styles were active, rendering black-on-dark and unreadable;
  strip visual styles on checkboxes in dark mode (reversible) so the
  color takes effect.
- All theming (titlebar, child-control theme, checkbox visual style) was
  only ever applied once at dialog creation. Since these dialogs are
  cached (shown/hidden, not recreated), toggling dark mode after a dialog
  was already open left it permanently on the stale theme, and once dark
  had disabled a checkbox's visual style, going back to light never
  restored it. Re-apply full theming on every dialog show and immediately
  when dark mode is toggled while a dialog is already open.
- Fixed a pre-existing layout bug surfaced by the above: the Wrap around
  checkbox's bounding box (x=330..410) overlapped the button column
  (x=360..450) by 50px in the Find/Replace dialog; widened the dialog and
  shifted the button column clear of it.
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.

1 participant