From 14da158cad32862cb2db158feb5c78f6937a4b3b Mon Sep 17 00:00:00 2001 From: ozone10 Date: Tue, 27 Jul 2021 20:41:17 +0200 Subject: [PATCH] Apply dark mode on run a macro multiple times dlg Fix #10273, close #10274 --- .../src/WinControls/shortcut/RunMacroDlg.cpp | 48 ++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp b/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp index 1aa0d552f..c0fd56075 100644 --- a/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp +++ b/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp @@ -46,6 +46,8 @@ INT_PTR CALLBACK RunMacroDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) { case WM_INITDIALOG : { + NppDarkMode::autoSubclassAndThemeChildControls(_hSelf); + initMacroList(); ::SetDlgItemInt(_hSelf, IDC_M_RUN_TIMES, _times, FALSE); switch (_mode) @@ -62,7 +64,50 @@ INT_PTR CALLBACK RunMacroDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) return TRUE; } - + + case WM_CTLCOLOREDIT: + { + if (NppDarkMode::isEnabled()) + { + return NppDarkMode::onCtlColorSofter(reinterpret_cast(wParam)); + } + break; + } + + case WM_CTLCOLORLISTBOX: + { + if (NppDarkMode::isEnabled()) + { + return NppDarkMode::onCtlColor(reinterpret_cast(wParam)); + } + break; + } + + 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 NPPM_INTERNAL_REFRESHDARKMODE: + { + NppDarkMode::autoThemeChildControls(_hSelf); + return TRUE; + } + case WM_COMMAND : { if (HIWORD(wParam) == EN_CHANGE) @@ -132,4 +177,3 @@ int RunMacroDlg::getMacro2Exec() const bool isCurMacroPresent = ::SendMessage(_hParent, WM_GETCURRENTMACROSTATUS, 0, 0) == MACRO_RECORDING_HAS_STOPPED; return isCurMacroPresent?(_macroIndex - 1):_macroIndex; } -