Add dark mode support to ColourPicker/ColourPopup's ChooseColor dialog
Fix #12148, close #12158pull/12160/head
parent
1646ea6139
commit
d03b11ebf8
|
@ -223,7 +223,8 @@ intptr_t CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
|
|||
|
||||
cc.lpCustColors = (LPDWORD) acrCustClr;
|
||||
cc.rgbResult = _colour;
|
||||
cc.Flags = CC_FULLOPEN | CC_RGBINIT;
|
||||
cc.lpfnHook = chooseColorDlgProc;
|
||||
cc.Flags = CC_FULLOPEN | CC_RGBINIT | CC_ENABLEHOOK;
|
||||
|
||||
display(false);
|
||||
|
||||
|
@ -265,3 +266,61 @@ intptr_t CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
|
|||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
uintptr_t CALLBACK ColourPopup::chooseColorDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
if (NppDarkMode::isExperimentalSupported())
|
||||
{
|
||||
NppDarkMode::setDarkTitleBar(hwnd);
|
||||
}
|
||||
NppDarkMode::autoSubclassAndThemeChildControls(hwnd);
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_CTLCOLOREDIT:
|
||||
{
|
||||
if (NppDarkMode::isEnabled())
|
||||
{
|
||||
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_CTLCOLORLISTBOX:
|
||||
case WM_CTLCOLORDLG:
|
||||
case WM_CTLCOLORSTATIC:
|
||||
{
|
||||
if (NppDarkMode::isEnabled())
|
||||
{
|
||||
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_PRINTCLIENT:
|
||||
{
|
||||
if (NppDarkMode::isEnabled())
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
{
|
||||
if (NppDarkMode::isEnabled())
|
||||
{
|
||||
RECT rc = {};
|
||||
::GetClientRect(hwnd, &rc);
|
||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -63,4 +63,5 @@ private :
|
|||
|
||||
static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
static uintptr_t CALLBACK chooseColorDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue