Browse Source

Use dark theme on checkbox buttons on Windows 11

-  replace style and class strings with macro

Fix #14929, close #14930
pull/14939/head
ozone10 8 months ago committed by Don Ho
parent
commit
6204f00e88
  1. 14
      PowerEditor/src/NppDarkMode.cpp

14
PowerEditor/src/NppDarkMode.cpp

@ -864,7 +864,7 @@ namespace NppDarkMode
if (!g_menuTheme)
{
g_menuTheme = OpenThemeData(hWnd, L"Menu");
g_menuTheme = OpenThemeData(hWnd, VSCLASS_MENU);
}
switch (iBackgroundStateID)
@ -1017,7 +1017,7 @@ namespace NppDarkMode
{
if (!hTheme)
{
hTheme = OpenThemeData(hwnd, WC_BUTTON);
hTheme = OpenThemeData(hwnd, VSCLASS_BUTTON);
}
return hTheme != nullptr;
}
@ -2290,12 +2290,12 @@ namespace NppDarkMode
return TRUE;
}
if (wcscmp(className, L"Static") == 0)
if (wcscmp(className, WC_STATIC) == 0)
{
return TRUE;
}
if (wcscmp(className, L"msctls_trackbar32") == 0)
if (wcscmp(className, TRACKBAR_CLASS) == 0)
{
return TRUE;
}
@ -2331,6 +2331,12 @@ namespace NppDarkMode
}
break;
}
if (NppDarkMode::isWindows11() && p._theme)
{
SetWindowTheme(hwnd, p._themeClassName, nullptr);
}
if (p._subclass)
{
NppDarkMode::subclassButtonControl(hwnd);

Loading…
Cancel
Save