Apply dark mode on run dialog

Fix #10251, close #10252
pull/10256/head
ozone10 2021-07-25 16:51:26 +02:00 committed by Don Ho
parent 8e84f5fbcf
commit b12c8ea541
1 changed files with 49 additions and 0 deletions

View File

@ -247,6 +247,53 @@ INT_PTR CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
return ::SendMessage(_hParent, message, wParam, lParam); return ::SendMessage(_hParent, message, wParam, lParam);
} }
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 = { 0 };
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;
}
break;
}
case NPPM_INTERNAL_REFRESHDARKMODE:
{
NppDarkMode::autoThemeChildControls(_hSelf);
return TRUE;
}
case WM_COMMAND : case WM_COMMAND :
{ {
switch (wParam) switch (wParam)
@ -369,6 +416,8 @@ void RunDlg::doDialog(bool isRTL)
if (!isCreated()) if (!isCreated())
create(IDD_RUN_DLG, isRTL); create(IDD_RUN_DLG, isRTL);
NppDarkMode::autoSubclassAndThemeChildControls(_hSelf);
// Adjust the position in the center // Adjust the position in the center
goToCenter(); goToCenter();
::SetFocus(::GetDlgItem(_hSelf, IDC_COMBO_RUN_PATH)); ::SetFocus(::GetDlgItem(_hSelf, IDC_COMBO_RUN_PATH));