From c585a1ab085d70a4a4e37cb3fc960f3587647da4 Mon Sep 17 00:00:00 2001 From: ozone10 Date: Tue, 25 Apr 2023 18:21:55 +0200 Subject: [PATCH] Fix incosistent key accelerator cue for groupbox in dark mode Fix #13597, close #13598 --- PowerEditor/src/NppDarkMode.cpp | 5 +++++ .../src/WinControls/StaticDialog/RunDlg/RunDlg.cpp | 10 ++++++++++ PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp | 10 ++++++++++ 3 files changed, 25 insertions(+) diff --git a/PowerEditor/src/NppDarkMode.cpp b/PowerEditor/src/NppDarkMode.cpp index 590b29589..f0b2812db 100644 --- a/PowerEditor/src/NppDarkMode.cpp +++ b/PowerEditor/src/NppDarkMode.cpp @@ -1313,6 +1313,11 @@ namespace NppDarkMode DWORD textFlags = isCenter ? DT_CENTER : DT_LEFT; + if(::SendMessage(hwnd, WM_QUERYUISTATE, 0, 0) != NULL) + { + textFlags |= DT_HIDEPREFIX; + } + DrawThemeTextEx(buttonData.hTheme, hdc, BP_GROUPBOX, iStateID, szText, -1, textFlags | DT_SINGLELINE, &rcText, &dtto); } diff --git a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp index 4778d66e3..3476763c3 100644 --- a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp @@ -294,6 +294,16 @@ intptr_t CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam return TRUE; } + case WM_CHANGEUISTATE: + { + if (NppDarkMode::isEnabled() && !NppDarkMode::isWindows11()) + { + redrawDlgItem(IDC_MAINTEXT_STATIC); + } + + return FALSE; + } + case WM_COMMAND: { switch (wParam) diff --git a/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp b/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp index caab88118..70c217e21 100644 --- a/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp +++ b/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp @@ -103,6 +103,16 @@ intptr_t CALLBACK RunMacroDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l return TRUE; } + case WM_CHANGEUISTATE: + { + if (NppDarkMode::isEnabled() && !NppDarkMode::isWindows11()) + { + redrawDlgItem(IDC_MACRO2RUN_STATIC); + } + + return FALSE; + } + case WM_COMMAND: { switch (wParam)