Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d9bf9c9
Add a dark theme for the Options dialog
kcinickgx Jul 4, 2026
31da57c
Dark Options: native scrollbars, fixed palette, dark filter-config di…
kcinickgx Jul 5, 2026
e3abafe
Dark Options: fix colour-well buttons and Formats checkboxes
kcinickgx Jul 5, 2026
bd99f92
Dark Options: theme-coloured background/title, flat disabled text, ad…
kcinickgx Jul 5, 2026
56e2658
Dark Options: draw the UAC shield on the owner-drawn "Modify" button
kcinickgx Jul 5, 2026
29e33d1
Dark Options: revert app dark-mode on theme-off; robust UAC shield icon
kcinickgx Jul 5, 2026
ddff644
Dark Options: centre owner-drawn button captions with accelerators
kcinickgx Jul 5, 2026
45db3b5
Dark Options: extend the dark theme to the auxiliary dialogs, docking…
kcinickgx Jul 5, 2026
08642e4
Dark Options: theme every message box via a UI-thread CBT hook
kcinickgx Jul 5, 2026
dd6ca6b
Merge remote-tracking branch 'origin/master' into dark-options-theme
kcinickgx Jul 5, 2026
90935dd
Dark Options: theme the remaining tab controls and the File Propertie…
kcinickgx Jul 6, 2026
beaf1e2
Fix crash opening the Window Size options page (upstream typo)
kcinickgx Jul 6, 2026
f2ba140
Dark Options: theme owner-drawn list rows, the Subresync grid, and fi…
kcinickgx Jul 6, 2026
cb5d226
Dark Options: hover/pressed states for sliders, and owner-draw all of…
kcinickgx Jul 6, 2026
b46521c
Dark Options: fix Subresync bar theming regressions + more aux dialogs
kcinickgx Jul 7, 2026
a9dd597
Dark Options: auto-size Subresync columns once after load (cheap)
kcinickgx Jul 7, 2026
56f17c2
Merge remote-tracking branch 'origin/master' into dark-options-theme
kcinickgx Jul 7, 2026
5e772a8
Dark Options: stop control borders flickering / breaking on scroll
kcinickgx Jul 8, 2026
fb0b197
Dark Options: fix white borders, combo border, and list-box overflow
kcinickgx Jul 11, 2026
6b8ae59
Merge remote-tracking branch 'origin/master' into dark-options-theme
kcinickgx Jul 15, 2026
edde8ac
Dark Options: fix combo focus border, edit hover flicker, Keys button…
kcinickgx Jul 15, 2026
92a83df
Dark Options: fix bar client white-flash, GoTo masked edit, combo twi…
kcinickgx Jul 17, 2026
c0eb5e5
Dark Options: owning-border rework — flicker-free dark control borders
kcinickgx Jul 21, 2026
1d5d7c8
Dark Options: dark scrollbar edge, dark border colour, drop focus accent
kcinickgx Jul 21, 2026
dc9c565
Dark Options: fix localized white bars, sunken statics, combo shades,…
kcinickgx Jul 24, 2026
eae8465
Dark Options: convert localized etched separators to owner-draw, fix …
kcinickgx Jul 29, 2026
0154fc4
Merge remote-tracking branch 'origin/master' into dark-options-theme
kcinickgx Aug 19, 2026
3ebfcfa
Dark Options: hide the localized etched separators and draw them ours…
kcinickgx Aug 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions src/ExtLib/ui/TreePropSheet/PropPageFrameDefault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ BEGIN_MESSAGE_MAP(CPropPageFrameDefault, CWnd)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

// <MPC-BE Custom Code>
bool CPropPageFrameDefault::s_bDarkMode = false;
COLORREF CPropPageFrameDefault::s_clrFace = RGB(37, 42, 47);
COLORREF CPropPageFrameDefault::s_clrText = RGB(179, 184, 189);
// </MPC-BE Custom Code>


CPropPageFrameDefault::CPropPageFrameDefault()
{
Expand Down Expand Up @@ -299,9 +305,22 @@ CRect CPropPageFrameDefault::CalcCaptionArea()
void CPropPageFrameDefault::DrawCaption(CDC *pDc, CRect rect, LPCTSTR lpszCaption, HICON hIcon)
{
// <MPC-BE Custom Code>
COLORREF clrLeft = GetSysColor(COLOR_ACTIVECAPTION);
auto Lighten = [](COLORREF c, int d) -> COLORREF {
int r = GetRValue(c) + d; if (r > 255) { r = 255; }
int g = GetGValue(c) + d; if (g > 255) { g = 255; }
int b = GetBValue(c) + d; if (b > 255) { b = 255; }
return RGB(r, g, b);
};

COLORREF clrLeft;
COLORREF clrRight;
if (s_bDarkMode) {
clrLeft = clrRight = Lighten(s_clrFace, 14); // subtle header band above the page
} else {
clrLeft = GetSysColor(COLOR_ACTIVECAPTION);
clrRight = pDc->GetPixel(rect.right-1, rect.top);
}
// </MPC-BE Custom Code>
COLORREF clrRight = pDc->GetPixel(rect.right-1, rect.top);
FillGradientRectH(pDc, rect, clrLeft, clrRight);

// draw icon
Expand All @@ -317,7 +336,7 @@ void CPropPageFrameDefault::DrawCaption(CDC *pDc, CRect rect, LPCTSTR lpszCaptio
// draw text
rect.left += 2;

COLORREF clrPrev = pDc->SetTextColor(GetSysColor(COLOR_CAPTIONTEXT));
COLORREF clrPrev = pDc->SetTextColor(s_bDarkMode ? s_clrText : GetSysColor(COLOR_CAPTIONTEXT));
int nBkStyle = pDc->SetBkMode(TRANSPARENT);
CFont *pFont = (CFont*)pDc->SelectStockObject(SYSTEM_FONT);

Expand Down Expand Up @@ -405,6 +424,15 @@ void CPropPageFrameDefault::OnPaint()

BOOL CPropPageFrameDefault::OnEraseBkgnd(CDC* pDC)
{
// <MPC-BE Custom Code>
if (s_bDarkMode) {
CRect rect;
GetClientRect(rect);
pDC->FillSolidRect(rect, s_clrFace);
return TRUE;
}
// </MPC-BE Custom Code>

if (g_ThemeLib.IsAvailable() && g_ThemeLib.IsThemeActive())
{
HTHEME hTheme = g_ThemeLib.OpenThemeData(m_hWnd, L"Tab");
Expand Down
9 changes: 9 additions & 0 deletions src/ExtLib/ui/TreePropSheet/PropPageFrameDefault.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ class /*AFX_EXT_CLASS*/ CPropPageFrameDefault : public CWnd,
CPropPageFrameDefault();
virtual ~CPropPageFrameDefault();

// <MPC-BE Custom Code>
// Dark theme palette, set by the host (CPPageSheet) before the frame paints.
// When s_bDarkMode is false the classic (system-colored) appearance is used.
public:
static bool s_bDarkMode;
static COLORREF s_clrFace;
static COLORREF s_clrText;
// </MPC-BE Custom Code>

// operations
public:

Expand Down
4 changes: 4 additions & 0 deletions src/ExtLib/ui/coolsb/coolsblib.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@

static TCHAR szPropStr[] = _T("CoolSBSubclassPtr");

// Single definition of the theme-colour callback (declared extern in coolscroll.h so the
// header can be included from more than one translation unit without a duplicate symbol).
ptr_themeRGB fThemeRGB = NULL;

LRESULT CALLBACK CoolSBWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

SCROLLWND *GetScrollWndFromHwnd(HWND hwnd)
Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/ui/coolsb/coolscroll.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ int WINAPI CoolSB_SetScrollPos (HWND hwnd, int nBar, int nPos, BOOL fRedraw);
int WINAPI CoolSB_SetScrollRange (HWND hwnd, int nBar, int nMinPos, int nMaxPos, BOOL fRedraw);
BOOL WINAPI CoolSB_ShowScrollBar (HWND hwnd, int wBar, BOOL fShow);

ptr_themeRGB fThemeRGB;
extern ptr_themeRGB fThemeRGB;

//
// Scrollbar dimension functions
Expand Down
56 changes: 28 additions & 28 deletions src/ExtLib/ui/sizecbar/scbarg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,36 +116,36 @@ void CSizingControlBarG::NcPaintGripper(CDC* pDC, CRect rcClient)
if (!HasGripper())
return;

if (!m_bUseDarkTheme) {
// paints a simple "two raised lines" gripper
// override this if you want a more sophisticated gripper
CRect gripper = rcClient;
CRect rcbtn = m_biHide.GetRect(CSize(ScaleX(m_cyGripper), ScaleY(m_cyGripper)));
BOOL bHorz = IsHorzDocked();

gripper.DeflateRect(1, 1);
const auto sizeX = ScaleX(m_cyGripper) / 4;
const auto sizeY = ScaleY(m_cyGripper) / 4;
if (bHorz)
{ // gripper at left
gripper.left -= (ScaleX(m_cyGripper) / 2 + sizeX * 2);
gripper.right = gripper.left + sizeX;
gripper.top = rcbtn.bottom + 3;
}
else
{ // gripper at top
gripper.top -= (ScaleY(m_cyGripper) / 2 + sizeY * 2);
gripper.bottom = gripper.top + sizeY;
gripper.right = rcbtn.left - 3;
}
pDC->Draw3dRect(gripper, ::GetSysColor(COLOR_BTNHIGHLIGHT),
::GetSysColor(COLOR_BTNSHADOW));
// paints a simple "two raised lines" gripper
// override this if you want a more sophisticated gripper
CRect gripper = rcClient;
CRect rcbtn = m_biHide.GetRect(CSize(ScaleX(m_cyGripper), ScaleY(m_cyGripper)));
BOOL bHorz = IsHorzDocked();

gripper.DeflateRect(1, 1);
const auto sizeX = ScaleX(m_cyGripper) / 4;
const auto sizeY = ScaleY(m_cyGripper) / 4;
if (bHorz)
{ // gripper at left
gripper.left -= (ScaleX(m_cyGripper) / 2 + sizeX * 2);
gripper.right = gripper.left + sizeX;
gripper.top = rcbtn.bottom + 3;
}
else
{ // gripper at top
gripper.top -= (ScaleY(m_cyGripper) / 2 + sizeY * 2);
gripper.bottom = gripper.top + sizeY;
gripper.right = rcbtn.left - 3;
}

gripper.OffsetRect(bHorz ? sizeX : 0, bHorz ? 0 : sizeY);
// In the dark theme the system 3D colours are near-black on the dark frame (the gripper lines
// vanished); use themed light/dark greys so the two raised lines stay visible.
const COLORREF clrHi = m_bUseDarkTheme ? ColorThemeRGB(95, 100, 105) : ::GetSysColor(COLOR_BTNHIGHLIGHT);
const COLORREF clrLo = m_bUseDarkTheme ? ColorThemeRGB(20, 25, 30) : ::GetSysColor(COLOR_BTNSHADOW);

pDC->Draw3dRect(gripper, ::GetSysColor(COLOR_BTNHIGHLIGHT),
::GetSysColor(COLOR_BTNSHADOW));
}
pDC->Draw3dRect(gripper, clrHi, clrLo);
gripper.OffsetRect(bHorz ? sizeX : 0, bHorz ? 0 : sizeY);
pDC->Draw3dRect(gripper, clrHi, clrLo);

m_biHide.Paint(pDC, this, CSize(ScaleX(m_cyGripper), ScaleY(m_cyGripper)));
}
Expand Down
52 changes: 45 additions & 7 deletions src/ExtLib/ui/sizecbar/sizecbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ CSizingControlBar::CSizingControlBar()

m_hBrush_orig = nullptr;
m_hBrush = nullptr;
m_hBrushClient = nullptr;
m_dwBrushColor = 0;
m_bUseDarkTheme = false;

Expand All @@ -90,13 +91,15 @@ CSizingControlBar::CSizingControlBar()

CSizingControlBar::~CSizingControlBar()
{
// (m_hBrush was deleted twice here and m_hBrushFrame was guarded by m_hBrush_orig, so the frame brush
// leaked while a freed handle was passed to DeleteObject a second time. Each brush is freed once now.)
if (m_hBrush) {
::DeleteObject(m_hBrush);
}
if (m_hBrush_orig) {
::DeleteObject(m_hBrush);
if (m_hBrushClient) {
::DeleteObject(m_hBrushClient);
}
if (m_hBrush_orig) {
if (m_hBrushFrame) {
::DeleteObject(m_hBrushFrame);
}
}
Expand All @@ -106,6 +109,7 @@ BEGIN_MESSAGE_MAP(CSizingControlBar, baseCSizingControlBar)
ON_WM_CREATE()
ON_WM_PAINT()
ON_WM_NCPAINT()
ON_WM_ERASEBKGND()
ON_WM_NCCALCSIZE()
ON_WM_WINDOWPOSCHANGING()
ON_WM_CAPTURECHANGED()
Expand Down Expand Up @@ -573,15 +577,30 @@ void CSizingControlBar::OnNcPaint()
//MPC-BE custom code start
if (m_bUseDarkTheme) {
const auto dwBrushColor = ColorThemeRGB(45, 50, 55);
if (m_dwBrushColor != dwBrushColor && m_hBrush) {
::DeleteObject(m_hBrush);
m_hBrush = nullptr;
if (m_dwBrushColor != dwBrushColor) {
// the theme sliders moved - drop both cached brushes so they re-tint
if (m_hBrush) {
::DeleteObject(m_hBrush);
m_hBrush = nullptr;
}
if (m_hBrushClient) {
::DeleteObject(m_hBrushClient);
m_hBrushClient = nullptr;
}
}
m_dwBrushColor = dwBrushColor;
if (!m_hBrush) {
m_hBrush = ::CreateSolidBrush(dwBrushColor);
}
::SetClassLongPtrW(m_hWnd, GCLP_HBRBACKGROUND, (LONG_PTR)m_hBrush); //MPC-BE patch
// The CLASS background brush is what DefWindowProc uses to erase a client strip that gets exposed
// during a redock/resize (before the child dialog catches up). It must be the DARK CONTENT shade,
// not the lighter NC/caption shade above: ColorThemeRGB scales with the brightness slider, so
// (45,50,55) reads as a pale/near-white rectangle at high brightness while the hosted content
// (shader editor dialog, lists) is (22,27,32). Keep the NC frame fill below on m_hBrush.
if (!m_hBrushClient) {
m_hBrushClient = ::CreateSolidBrush(ColorThemeRGB(22, 27, 32));
}
::SetClassLongPtrW(m_hWnd, GCLP_HBRBACKGROUND, (LONG_PTR)m_hBrushClient); //MPC-BE patch

mdc.FrameRect(rcDraw, CBrush::FromHandle(m_hBrushFrame)); // Draw Black Frame

Expand Down Expand Up @@ -631,6 +650,25 @@ void CSizingControlBar::OnPaint()
CPaintDC dc(this);
}

BOOL CSizingControlBar::OnEraseBkgnd(CDC* pDC)
{
// The bar's own client background is otherwise erased by DefWindowProc with the shared window-class
// brush (light COLOR_BTNFACE), which is only swapped dark as a side effect of the dark NC paint - so
// when a child doesn't fully cover the client (e.g. a 2px inset), or right after a redock/resize/theme
// toggle before the next NC paint, the exposed strip flashed WHITE. Paint it dark deterministically.
if (m_bUseDarkTheme) {
CRect rc;
GetClientRect(rc);
// Match the DARK content the bar hosts (22,27,32), NOT the lighter NC/caption shade: ColorThemeRGB
// scales with the brightness slider, so the old (45,50,55) fill showed up as a pale/near-white
// rectangle whenever a strip was briefly exposed on redock/resize.
pDC->FillSolidRect(rc, ColorThemeRGB(22, 27, 32));
return TRUE;
}

return baseCSizingControlBar::OnEraseBkgnd(pDC);
}

LRESULT CSizingControlBar::OnNcHitTest(CPoint point)
{
CRect rcBar, rcEdge;
Expand Down
4 changes: 4 additions & 0 deletions src/ExtLib/ui/sizecbar/sizecbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ class CSizingControlBar : public baseCSizingControlBar
CSize m_szFixedFloat;

HBRUSH m_hBrush, m_hBrush_orig, m_hBrushFrame;
// Separate CLIENT background brush. m_hBrush is the lighter NC/caption shade; the client must match the
// DARK content the bar hosts (shader editor dialog / lists), or an exposed strip reads as a pale rectangle.
HBRUSH m_hBrushClient;
COLORREF m_dwBrushColor;
//MPC-BE custom code end

Expand All @@ -195,6 +198,7 @@ class CSizingControlBar : public baseCSizingControlBar
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
afx_msg void OnPaint();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnClose();
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
Expand Down
3 changes: 3 additions & 0 deletions src/apps/mplayerc/AboutDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "stdafx.h"
#include "AboutDlg.h"
#include "DSUtil/FileHandle.h"
#include "controls/DarkTheme.h"

#include "Version.h"

Expand Down Expand Up @@ -94,6 +95,8 @@ BOOL CAboutDlg::OnInitDialog()

GetDlgItem(IDOK)->SetFocus();

DarkTheme::ThemeDialog(GetSafeHwnd());

return FALSE;
}

Expand Down
3 changes: 3 additions & 0 deletions src/apps/mplayerc/AddCommandDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "stdafx.h"
#include "AddCommandDlg.h"
#include "controls/DarkTheme.h"

// CAddCommandDlg dialog

Expand Down Expand Up @@ -137,6 +138,8 @@ BOOL CAddCommandDlg::OnInitDialog()

SHAutoComplete(m_FilterEdit, SHACF_AUTOAPPEND_FORCE_OFF | SHACF_AUTOSUGGEST_FORCE_OFF);

DarkTheme::ThemeDialog(GetSafeHwnd());

return TRUE;
}

Expand Down
5 changes: 5 additions & 0 deletions src/apps/mplayerc/AppSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,11 @@ void CAppSettings::LoadSettings(bool bForce/* = false*/)
if (iLanguage < 0) {
iLanguage = CMPlayerCApp::GetDefLanguage();
}
// Read the dark-theme flag before SetLanguage: SetLanguage may pop the "language pack will not
// work with this version" message box, and DarkTheme::IsActive() must already reflect the user's
// saved preference for that box to be themed (bUseDarkTheme is otherwise not read until further
// below, so at this point it would still hold the ResetSettings default). Harmless duplicate read.
profile.ReadBool(IDS_R_THEME, IDS_RS_USEDARKTHEME, bUseDarkTheme);
CMPlayerCApp::SetLanguage(iLanguage, false);

FiltersPriority.LoadSettings();
Expand Down
3 changes: 3 additions & 0 deletions src/apps/mplayerc/AuthDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "stdafx.h"
#include "AuthDlg.h"
#include "controls/DarkTheme.h"

// CAuthDlg dialog

Expand Down Expand Up @@ -82,6 +83,8 @@ BOOL CAuthDlg::OnInitDialog()

m_usernamectrl.SetFocus();

DarkTheme::ThemeDialog(GetSafeHwnd());

return TRUE;
}

Expand Down
3 changes: 3 additions & 0 deletions src/apps/mplayerc/CmdLineHelpDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "stdafx.h"
#include "CmdLineHelpDlg.h"
#include "Misc.h"
#include "controls/DarkTheme.h"

CmdLineHelpDlg::CmdLineHelpDlg(const CStringW& cmdLine)
: CResizableDialog(CmdLineHelpDlg::IDD)
Expand Down Expand Up @@ -117,5 +118,7 @@ BOOL CmdLineHelpDlg::OnInitDialog()

EnableSaveRestore(IDS_R_DLG_CMD_LINE_HELP);

DarkTheme::ThemeDialog(GetSafeHwnd());

return FALSE;
}
Loading