From 3548696bd7c23f65350d74ef1d3209f4ed8cb1f5 Mon Sep 17 00:00:00 2001 From: ozone10 Date: Thu, 15 May 2025 19:36:14 +0200 Subject: [PATCH] Fix updown control style not changing when toggling dark mode Fix https://github.com/notepad-plus-plus/notepad-plus-plus/pull/16548#issuecomment-2884419833, close #16553 --- PowerEditor/src/Notepad_plus.cpp | 6 ++++-- PowerEditor/src/WinControls/TabBar/TabBar.cpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index ce245e31e..fb6e6aca7 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -8606,14 +8606,16 @@ void Notepad_plus::refreshDarkMode(bool resetStyle) NppDarkMode::setDarkTitleBar(_pPublicInterface->getHSelf()); ::SetWindowPos(_pPublicInterface->getHSelf(), nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); - for (auto& docCont : _dockingManager.getContainerInfo()) + for (const auto& docCont : _dockingManager.getContainerInfo()) { + NppDarkMode::autoThemeChildControls(docCont->getTabWnd()); // for updown child + auto hwndDocCont = docCont->getCaptionWnd(); NppDarkMode::setDarkTitleBar(hwndDocCont); ::SetWindowPos(hwndDocCont, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); } - for (auto& hwndDlg : _hModelessDlgs) + for (const auto& hwndDlg : _hModelessDlgs) { NppDarkMode::setDarkTitleBar(hwndDlg); ::SendMessage(hwndDlg, NPPM_INTERNAL_REFRESHDARKMODE, 0, 0); diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index 859bfc27b..92e419a45 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -666,6 +666,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara case NPPM_INTERNAL_REFRESHDARKMODE: { + NppDarkMode::autoThemeChildControls(hwnd); // for updown child NppDarkMode::setDarkTooltips(hwnd, NppDarkMode::ToolTipsType::tabbar); setCloseBtnImageList(); setPinBtnImageList();