From 24d3a69f0fd2dca667b330e2723780fbb36c5c8a Mon Sep 17 00:00:00 2001 From: ozone10 Date: Mon, 20 Mar 2023 16:10:03 +0100 Subject: [PATCH] Dark mode enhancement: make combobox focus more visible Use focus rectangle for list combobox with focus. Fix #13420, close #13421 --- PowerEditor/src/NppDarkMode.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/NppDarkMode.cpp b/PowerEditor/src/NppDarkMode.cpp index 6f1d9b905..b4ede8cb2 100644 --- a/PowerEditor/src/NppDarkMode.cpp +++ b/PowerEditor/src/NppDarkMode.cpp @@ -1805,8 +1805,13 @@ namespace NppDarkMode ::DrawText(hdc, buffer, -1, &rcText, DT_NOPREFIX | DT_LEFT | DT_VCENTER | DT_SINGLELINE); delete[] buffer; } + + if (hasFocus && ::SendMessage(hWnd, CB_GETDROPPEDSTATE, 0, 0) == FALSE) + { + ::DrawFocusRect(hdc, &rcTextBg); + } } - else if ((style & CBS_DROPDOWN) == CBS_DROPDOWN && hwndEdit != NULL) + else if ((style & CBS_DROPDOWN) == CBS_DROPDOWN && hwndEdit != nullptr) { hasFocus = ::GetFocus() == hwndEdit; }