From b12c8ea541136218db47fa43cdd0ebbc3c7749d5 Mon Sep 17 00:00:00 2001 From: ozone10 Date: Sun, 25 Jul 2021 16:51:26 +0200 Subject: [PATCH] Apply dark mode on run dialog Fix #10251, close #10252 --- .../StaticDialog/RunDlg/RunDlg.cpp | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp index 3a5519a60..0ac7ad91a 100644 --- a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp @@ -247,6 +247,53 @@ INT_PTR CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) return ::SendMessage(_hParent, message, wParam, lParam); } + case WM_CTLCOLOREDIT: + { + if (NppDarkMode::isEnabled()) + { + return NppDarkMode::onCtlColorSofter(reinterpret_cast(wParam)); + } + break; + } + + case WM_CTLCOLORLISTBOX: + case WM_CTLCOLORDLG: + case WM_CTLCOLORSTATIC: + { + if (NppDarkMode::isEnabled()) + { + return NppDarkMode::onCtlColorDarker(reinterpret_cast(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(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); + return TRUE; + } + break; + } + + case NPPM_INTERNAL_REFRESHDARKMODE: + { + NppDarkMode::autoThemeChildControls(_hSelf); + return TRUE; + } + case WM_COMMAND : { switch (wParam) @@ -369,6 +416,8 @@ void RunDlg::doDialog(bool isRTL) if (!isCreated()) create(IDD_RUN_DLG, isRTL); + NppDarkMode::autoSubclassAndThemeChildControls(_hSelf); + // Adjust the position in the center goToCenter(); ::SetFocus(::GetDlgItem(_hSelf, IDC_COMBO_RUN_PATH));