Add a dark theme for the Options dialog#1178
Conversation
2d8e803 to
9fca02e
Compare
|
Quick observations:
|
9fca02e to
ff8cf9b
Compare
|
Thanks for the feedback! I've pushed an update that addresses all three points, and here's a build so people can try it: Test build (x64 installer): https://github.com/kcinickgx/MPC-BE/releases/tag/dark-options-test On the observations:
The |
|
Good idea — added a portable ZIP to the same release: Portable (x64, ZIP): https://github.com/kcinickgx/MPC-BE/releases/download/dark-options-test/MPC-BE.1.9.0.24.x64.zip Just extract and run |
|
On several option pages, when I make changes and press Apply, some of the text labels become invisible. |
Makes the Options property sheet (the "O" dialog) follow the dark look of the rest of the player instead of always rendering in the light system style. It covers the whole dialog: the navigation tree, the property pages, group boxes, edits/combos, list controls, spin buttons, sliders, tab headers, checkboxes and the scrollbars (flat, drawn through the bundled CoolSB, matching the playlist). The sheet also re-themes live when the setting is toggled while it is open. Everything is gated on the existing "Use the 'dark' theme" setting (bUseDarkTheme) and reuses the existing ThemeRGB() palette, so when the flag is off every control falls back to its original light appearance and there is no behavioural change. A new helper (controls/DarkTheme.*) centralises the theming so most of the ~26 pages are covered from CPPageBase / CPPageSheet. Small, flag-gated tweaks are made to the bundled coolsb (expose one global as extern so the header can be included from more than one TU) and to the TreePropSheet page frame (dark caption/background colours). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ff8cf9b to
d9bf9c9
Compare
…alogs - Scrollbars: drop the CoolSB custom scrollbar for the native dark one (SetWindowTheme "DarkMode_Explorer"). The custom bar fought the OS repaint and flickered/froze while dragging; the native bar is solid and consistent. - Palette is now fixed and independent of the R/G/B/Brightness sliders (those tint the player only), so the Options dialog never half-repaints or blackens its text. - Theme each page once on first activation instead of every activation, so switching pages is instant. - Owner-drawn push buttons: keep the Win11 rounding + icon, stay dark when enabled (Apply no longer flashes white), and honour BS_MULTILINE captions. - Dark-theme the internal/external filter configuration sheets (CComPropertySheet): frame, owner-drawn dark tab, page background/controls, and light radio captions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Pushed an update (
Main change: I dropped the custom (CoolSB) scrollbar and switched the Options dialog to the native dark scrollbar ( Other fixes in this build:
|
- Colour-well buttons (Interface / OSD / Subtitle Default Style) are push buttons that their page fills with the selected colour via NM_CUSTOMDRAW; skip owner-drawing them so they show the colour swatch again instead of their "B"/"O" caption. - Formats checkboxes: render them with the native visual style (unchecked / checked / mixed for the partial state) in both light and dark, and move them from the item icon (LVSIL_SMALL) to the state image (LVSIL_STATE) so the row-selection highlight no longer paints the checkbox. Rebuilt when the dark theme is toggled at runtime. This also changes the light-mode Formats checkbox from the custom SVG glyphs to the native ones, to match the other checklists. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Another update (
Fixed:
One heads-up: to make the Formats checkboxes consistent with every other checklist, the light-theme Formats checkbox now uses the native Windows checkbox (unchecked / checked / indeterminate for the "only some extensions registered" state) instead of the old custom SVG glyphs. That's a small change to the non-dark appearance — calling it out explicitly since it touches the light theme. Thanks again @Freem-di for the detailed reports! |
This doesn't need to be reverted; it's not a bug. I just mentioned it to highlight the change. |
…dressing review - The Options background now follows the R/G/B/Brightness sliders (ThemeRGB), so it matches the player, and the title bar is tinted with DWMWA_CAPTION_COLOR like the player's caption. Text stays a fixed readable colour (never driven to black). The sheet re-tints when a slider drag ends (repainting standard controls on every tick flickers, and WS_EX_COMPOSITED breaks the list controls), so it snaps to the final colour on release while the player follows live. - Theme sliders are owner-drawn and paint from a committed colour snapshot, so the one being dragged doesn't recolour under the cursor; all four move together on release. - Disabled text labels are owner-drawn flat instead of the embossed grey Windows draws on dark (addresses maintainer feedback). All Options text/glyphs are fixed, never tinted. - Elevated "Modify" Formats dialog now loads bUseDarkTheme, so it matches the theme instead of always appearing dark. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Update (
Addressing @Aleksoid1978's review:
A few honest limitations, up front, since they're inherent to theming the native Win32 controls rather than owner-drawing everything:
Making it fully live and arbitrarily-coloured would mean owner-drawing every control from scratch (a framework like MPC-HC's Happy to adjust the trade-off on any of these if you'd prefer something different. |
The elevation shield set via BCM_SETSHIELD is drawn internally by the button and is not returned by BM_GETIMAGE, so owner-drawing the button dropped it. Flag the button (MarkUacShield) and paint IDI_SHIELD ourselves when flagged, so the non-admin Formats "Modify" button shows its shield again in the dark theme. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Fixed the missing UAC shield (
The Formats "Modify" button (shown only to non-admin users) sets its elevation shield via Note for testing: the shield only appears when running without administrator rights (that's when the "Modify" elevation button is shown at all). |
|
Re-uploaded the build as 1.9.0.28 — the language files are fixed:
The "translations not compatible with this version" errors were my packaging mistake, not a code issue: I'd only been rebuilding the main binary, so the shipped |
- When the dark theme is turned off at runtime, reset the process-wide preferred app mode (FORCELIGHT + FlushMenuThemes) so the main window's immersive-dark menus revert to light immediately instead of staying dark until the app is restarted. Re-arm it when turned on. - Load the UAC shield via SHGetStockIconInfo(SIID_SHIELD) (cached) instead of LoadIcon(IDI_SHIELD), which could return null, so the Formats "Modify" button reliably shows its shield in the dark theme. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
New build 1.9.0.29 with two more fixes:
|
Measure the caption width with DT_CALCRECT (which drops the "&" accelerator prefix) instead of GetTextExtent (which counts it), so single-line owner-drawn push buttons whose caption has an accelerator (e.g. the Formats "&All" / "A&udio" association buttons) are centred instead of shifted to the left. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
What about all the other dialogs - Shader Editor, History, etc.? |
|
What about other dialogs? - Check for Updates, Command Line Switches, About..., Reset settings |
|
Follow-up build 1.9.0.32: the message-box theming now covers all of them, not just the updater — "Reset settings", "Export settings" and the rest of the Instead of wrapping ~70 call sites, a single persistent |
# Conflicts: # src/apps/mplayerc/MainFrm.cpp
…s sheet The owner spotted the Organize Favorites dialog's Files/DVDs tab rendering with a light body/frame. Native tab controls ignore SetWindowTheme, so ThemeDialog can't darken them — they need the owner-drawn CDarkTabCtrl. - Organize Favorites: its CTabCtrl is now a CDarkTabCtrl (drop-in; falls back to native when the theme is off). - File Properties (CPPageFileInfoSheet): the whole property sheet was un-themed. Theme the frame + attach CDarkTabCtrl to its tab, and each page (Details / Clip / MediaInfo) dark-themes itself in its OnInitDialog (the Res page already does, via CPPageBase). Sweep confirmed these were the last light tabs/sheets: every SysTabControl32 in the app (Organize Favorites, Internal Filters, filter-config sheet) now uses CDarkTabCtrl, and both CPropertySheet-derived dialogs are themed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Fixed the light Organize Favorites tab @Aleksoid1978 pointed out, and swept for the same issue across the app. Native tab controls ignore
Also: the branch is now merged up to the latest |
Not a dark-theme issue: commit d4ac8ca (v0lt, "use global arrays for value sets", came in via the merge with master) populates the scale-level combo with str.Format(L"%d%", scale). The trailing lone "%" is a malformed format string; MFC's FormatV calls _vscwprintf, which returns -1, and the subsequent GetBuffer(-1) crashes. Reproduces with the dark theme off and is absent from the older official release, confirming it's the upstream change. Fix the format to L"%d%%" (also what was intended: the combo now shows "50%" / "100%" / "200%" instead of "50" / "100" / "200"). Should be fixed upstream in PPageWindowSize.cpp too. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…x listview artefacts Owner-drawn / custom-drawn list content isn't reached by ThemeDialog, and a couple of list-view rendering artefacts showed up on the dark background: - Organize Favorites list: it's owner-drawn (OnDrawItem) with fixed light colours (COLOR_WINDOW background, black text) -> rows stayed white. Paint the rows in the dark palette (dark background, light text, celeste-tinted selection). - Subresync bar grid: custom-drawn with fixed light colours, and the bar isn't run through ThemeDialog, so the empty list had a white background, border and column header. Remap the per-row colours to the dark palette (keeping the play-position / edited-marker / alternating-row semantics) and theme the control (dark background / border / header). - ListViewSubclassProc: fill the empty area below the last item dark, which covers the light column separator a report list draws in an empty body (the stray vertical line in the empty Organize Favorites list); and offset the custom vertical grid lines by the header's scroll origin so they follow a horizontal scroll instead of ghosting at the unscrolled column positions (the Keys list), forcing a full repaint on WM_HSCROLL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks @xLn2. New build 1.9.0.63: 1. Listview issues — fixed.
2. Window Size page crash — fixed, but heads-up @Aleksoid1978: this one isn't from the dark theme. It's a pre-existing typo in 3. Sliders without hover/pressed state — acknowledged, not done yet. The owner-drawn trackbars paint a static thumb; adding hover/pressed feedback (mouse tracking in the subclass) is the next item. |
… them xLn2 noted some sliders had no hover/pressed feedback, and the ones left on the native control showed ugly black-on-hover / white-when-pressed thumbs (the native DarkMode trackbar states). - TrackbarSubclassProc now tracks the thumb state (WM_MOUSEMOVE + TrackMouse- Event for hover over the thumb, WM_LBUTTONDOWN/UP for pressed) and paints the thumb lighter on hover / brightest while dragging (disabled overrides). The mouse messages pass through to the default proc so dragging still works. - ThemeControl now owner-draws EVERY trackbar (not just the theme R/G/B and subtitle sliders that were explicitly converted), so OSD / Colour correction / Sound processing sliders get the same dark celeste thumb + states instead of the native black/white ones. Trackbars already subclassed are skipped so the theme sliders keep their frozen-colour snapshot flag (dwData = 1). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Build 1.9.0.64 — issue 3 (slider hover / pressed state) done. The owner-drawn sliders painted a static thumb (no feedback), and the sliders still left on the native control showed the native DarkMode thumb's black-on-hover / white-when-pressed states, which looked broken on the dark theme.
|
- Subresync bar list: theme it reversibly (new DarkTheme::RefreshThemeForControl) so it follows the "Use dark theme" toggle instead of staying dark (dark header/ border/background over light rows) after the theme is turned off. The list is themed once in Create via control subclasses that paint unconditionally, so they must be stripped, not just left installed, when the theme goes off. - Floating docking bars: apply the dark title once per mini-frame instead of on every OnWindowPosChanged, so dragging a floated bar no longer floods the DWM (RefreshImmersiveColorPolicyState + DwmSetWindowAttribute) and smears the window. - Subresync grid: remap the hard-coded light separator/grid-line greys to the dark palette - subtle grid lines, a clearly-visible group separator. - List-views: repaint fully on a column resize (header divider drag / auto-size double-click) so the hand-drawn dark grid lines don't ghost. - List-view in-place label edit (Organize Favorites, ...) now gets the dark edit colours via WM_CTLCOLOREDIT instead of showing a white box. - Subtitle "Styles..." property sheet: new CDarkPropertySheet themes its frame (dark tab + title bar + OK/Cancel/Apply); each page already themes itself. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Build 1.9.0.65 — thanks @xLn2, all four addressed. 1. Listview column auto-size artefacts — a column resize (dragging a header divider, or double-clicking the divider gripper to auto-size) bit-blts the rows to the right of the divider, which smeared the hand-drawn dark grid lines. The list now forces a full repaint on 2. Organize Favorites edit — the in-place label-edit control the list-view creates for renaming an item is a child of the list-view, so its 3. Subresync theming / separator — the row grid lines and the group separator were drawn with hard-coded light greys ( I also reworked the Subresync bar's list theming so it's reversible. It was themed once at creation via control subclasses that paint dark unconditionally, so with the dark theme off it stayed dark (dark header/border/background with light rows), and dragging the floated bar flooded the DWM (re-running the immersive dark-mode calls on every 4. Subtitle Styles window ( |
The End (4 px) and Charset (20 px) columns are created far too narrow to show their values / header captions. Size every column to fit the wider of its header caption and its first data row, once, right after the whole subtitle has been inserted (not per line). Measure the header text + first row by hand instead of SetColumnWidth( LVSCW_AUTOSIZE): the latter scans every row of all 11 columns (~5 s on a large subtitle) and forces the list to repaint mid-population, which piled up ghost separator lines until the load finished. Every row in a time/number column is the same width, so the first row is representative; columns only ever grow, so the wide Text column keeps its default width. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Build 1.9.0.74 — merged onto the latest
|
|
Maybe no changes are needed for the dark theme - from what I can see, more and more problems are popping up. All these dark dialogs look worse than the native light ones. And judging by the reviews, users don't really need it. |
The custom dark 1px border (BorderSubclassProc) was overpainted on top of the default non-client paint. Themed edits/list boxes repaint their border on hover / mouse-move, so the light->dark overpaint strobed (About, File Properties fields, Internal Filters lists), and on a multiline edit the border got dragged into the middle of the text by ScrollWindowEx (MediaInfo). - WM_NCPAINT: for controls WITHOUT scroll bars, skip the default paint entirely so the light client-edge is never drawn (no flash); for controls WITH scroll bars, let the default paint + validate the frame (so scrolling keeps it), then overpaint. - Don't custom-draw the border on scrolling multiline edits or scrolling list boxes at all - the DarkMode_Explorer theme's own border stays put and dark enough; the overpaint only fought their scroll/hover repaints. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Fair enough, @Aleksoid1978 — thanks for taking the time to review it, and thanks @xLn2 and @Freem-di for all the testing and screenshots. No problem about not merging; I get it. I'll just keep it as a fork build for anyone who does want the dark dialogs, and rebase it onto upstream Latest build (1.9.0.75) with this round's fixes — border flicker on the About / File Properties fields, the MediaInfo frame breaking on scroll, and the Subresync bar/column issues:
Thanks again. |
|
I apologize if I seem dissatisfied. My aim is to help developers by reporting all possible issues as quickly as possible. There were also issues with the dark theme in MPC-HC in the past, and it wasn't fixed in one go; there may still be issues that haven't been revealed. So, the theme issue seems quite complex and requires patience. |
|
Agreed, @xLn2. Too early to stop polishing. We're sending bugs as we find them, so we'll get there. |
|
"File properties - Details/Clip", "Internal filter - Source/Video/Audio", "Add to Favorites dialog" - border turned white. |
Follow-up to the border rework (reviewers saw issues our machine didn't): - White borders (File Properties Details/Clip big field, Internal Filters lists, Add-to-Favorites dropdown): go back to overpainting a dark frame over whatever the theme drew, so the border is dark on every machine. Skipping / clipping the default paint rendered a white border on some systems. - Overpaint now self-skips when the control reserves no non-client border (edge 0, e.g. the MediaInfo NOT-WS_BORDER edit): a frame there lands in the client and gets dragged into the text by ScrollWindowEx. So the bordered multiline edits (Details/Clip) get a dark frame with no scroll drag, and MediaInfo stays clean. - Restore the dark border on scrolling list boxes, and add one to combo boxes (the CFD combo border stayed light on some machines). - CDarkCheckListBox: clip a partially-visible last item to the client bottom (ETO_CLIPPED) so its row no longer spills below the list box into the page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks @Freem-di, @xLn2 — appreciate the persistence, and the detailed screenshots really help. 1.9.0.76 fixes this round:
|
|
Build: 1.9.0.76
|







































What
Makes the Options property sheet (the
Odialog) follow the dark look of the rest of the player instead of always rendering in the light system style.It covers the whole dialog:
The sheet also re-themes live when the setting is toggled while it is open (Interface → Use the "dark" theme → Apply), so it never ends up half light / half dark.
How it's gated
Everything is gated on the existing "Use the 'dark' theme" setting (
bUseDarkTheme) and reuses the existingThemeRGB()palette. With the flag off, every control falls back to its original light appearance, so there is no behavioural change — it's purely visual and opt-in.Implementation notes
controls/DarkTheme.*, centralises the theming (immersive dark mode +WM_CTLCOLOR*+ a few owner-drawn/subclassed controls), so most of the ~26 pages are covered fromCPPageBase/CPPageSheetwith very little per-page code.coolsb: expose one global (fThemeRGB) asexternso the header can be included from more than one translation unit.TreePropSheetpage frame: dark caption / background colours.Screenshot