diff --git a/PowerEditor/src/NppDarkMode.cpp b/PowerEditor/src/NppDarkMode.cpp index 07ced31d0..6bb0a516d 100644 --- a/PowerEditor/src/NppDarkMode.cpp +++ b/PowerEditor/src/NppDarkMode.cpp @@ -27,6 +27,7 @@ namespace NppDarkMode COLORREF darkerText = 0; COLORREF disabledText = 0; COLORREF edge = 0; + COLORREF highlightHotTrack = 0; }; struct Brushes @@ -64,7 +65,8 @@ namespace NppDarkMode HEXRGB(0xE0E0E0), // textColor HEXRGB(0xC0C0C0), // darkerTextColor HEXRGB(0x808080), // disabledTextColor - HEXRGB(0x808080) // edgeColor + HEXRGB(0x808080), // edgeColor + HEXRGB(0x414141) // highlightHotTrack }; struct Theme @@ -190,21 +192,22 @@ namespace NppDarkMode return invert_c; } - COLORREF getBackgroundColor() { return getTheme().colors.background; } - COLORREF getSofterBackgroundColor() { return getTheme().colors.softerBackground; } - COLORREF getHotBackgroundColor() { return getTheme().colors.hotBackground; } - COLORREF getDarkerBackgroundColor() { return getTheme().colors.pureBackground; } - COLORREF getErrorBackgroundColor() { return getTheme().colors.errorBackground; } - COLORREF getTextColor() { return getTheme().colors.text; } - COLORREF getDarkerTextColor() { return getTheme().colors.darkerText; } - COLORREF getDisabledTextColor() { return getTheme().colors.disabledText; } - COLORREF getEdgeColor() { return getTheme().colors.edge; } + COLORREF getBackgroundColor() { return getTheme().colors.background; } + COLORREF getSofterBackgroundColor() { return getTheme().colors.softerBackground; } + COLORREF getHotBackgroundColor() { return getTheme().colors.hotBackground; } + COLORREF getDarkerBackgroundColor() { return getTheme().colors.pureBackground; } + COLORREF getErrorBackgroundColor() { return getTheme().colors.errorBackground; } + COLORREF getTextColor() { return getTheme().colors.text; } + COLORREF getDarkerTextColor() { return getTheme().colors.darkerText; } + COLORREF getDisabledTextColor() { return getTheme().colors.disabledText; } + COLORREF getEdgeColor() { return getTheme().colors.edge; } + COLORREF getHighlightHotTrackColor() { return getTheme().colors.highlightHotTrack; } - HBRUSH getBackgroundBrush() { return getTheme().brushes.background; } - HBRUSH getSofterBackgroundBrush() { return getTheme().brushes.softerBackground; } - HBRUSH getHotBackgroundBrush() { return getTheme().brushes.hotBackground; } - HBRUSH getDarkerBackgroundBrush() { return getTheme().brushes.pureBackground; } - HBRUSH getErrorBackgroundBrush() { return getTheme().brushes.errorBackground; } + HBRUSH getBackgroundBrush() { return getTheme().brushes.background; } + HBRUSH getSofterBackgroundBrush() { return getTheme().brushes.softerBackground; } + HBRUSH getHotBackgroundBrush() { return getTheme().brushes.hotBackground; } + HBRUSH getDarkerBackgroundBrush() { return getTheme().brushes.pureBackground; } + HBRUSH getErrorBackgroundBrush() { return getTheme().brushes.errorBackground; } // handle events diff --git a/PowerEditor/src/NppDarkMode.h b/PowerEditor/src/NppDarkMode.h index 0c963f02a..6069d13c2 100644 --- a/PowerEditor/src/NppDarkMode.h +++ b/PowerEditor/src/NppDarkMode.h @@ -51,6 +51,7 @@ namespace NppDarkMode COLORREF getDarkerTextColor(); COLORREF getDisabledTextColor(); COLORREF getEdgeColor(); + COLORREF getHighlightHotTrackColor(); HBRUSH getBackgroundBrush(); HBRUSH getDarkerBackgroundBrush(); diff --git a/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp b/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp index 7dc265f5d..656af33cd 100644 --- a/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp +++ b/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp @@ -133,11 +133,9 @@ INT_PTR CALLBACK AnsiCharPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM } becomeLightMode = false; - auto nmtbcd = reinterpret_cast((LPNMHDR)lParam); + auto nmtbcd = reinterpret_cast(lParam); SetBkMode(nmtbcd->nmcd.hdc, TRANSPARENT); FillRect(nmtbcd->nmcd.hdc, &nmtbcd->nmcd.rc, NppDarkMode::getBackgroundBrush()); - nmtbcd->clrText = RGB(255, 255, 255); - SetTextColor(nmtbcd->nmcd.hdc, RGB(255, 255, 255)); SetWindowLongPtr(_hSelf, DWLP_MSGRESULT, CDRF_NOTIFYSUBITEMDRAW); } else diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp index 3c47fb8b0..4f9aefffd 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp @@ -611,12 +611,7 @@ void FunctionListPanel::notified(LPNMHDR notification) auto nmtbcd = reinterpret_cast(notification); FillRect(nmtbcd->nmcd.hdc, &nmtbcd->nmcd.rc, NppDarkMode::getBackgroundBrush()); nmtbcd->clrText = NppDarkMode::getTextColor(); - - // highlight color when hover - // same color when hovering above menu - // RGB(65, 65, 65) should be added to NppDarkMode.cpp - // needed because, visual style is disabled - nmtbcd->clrHighlightHotTrack = RGB(65, 65, 65); + nmtbcd->clrHighlightHotTrack = NppDarkMode::getHighlightHotTrackColor(); SetWindowLongPtr(_hSelf, DWLP_MSGRESULT, CDRF_NOTIFYSUBITEMDRAW | TBCDRF_HILITEHOTTRACK); } else diff --git a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp index dee8fbc22..ebd56155f 100644 --- a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp +++ b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp @@ -828,11 +828,7 @@ void ProjectPanel::notified(LPNMHDR notification) auto nmtbcd = reinterpret_cast(notification); FillRect(nmtbcd->nmcd.hdc, &nmtbcd->nmcd.rc, NppDarkMode::getBackgroundBrush()); nmtbcd->clrText = NppDarkMode::getTextColor(); - // highlight color when hover - // same color when hovering above menu - // RGB(65, 65, 65) should be added to NppDarkMode.cpp - // needed because, visual style is disabled - nmtbcd->clrHighlightHotTrack = RGB(65, 65, 65); + nmtbcd->clrHighlightHotTrack = NppDarkMode::getHighlightHotTrackColor(); SetWindowLongPtr(_hSelf, DWLP_MSGRESULT, CDRF_NOTIFYSUBITEMDRAW | TBCDRF_HILITEHOTTRACK); } else diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp index 14801175a..42f6366cc 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp @@ -80,14 +80,15 @@ INT_PTR CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, case WM_NOTIFY: { - switch (((LPNMHDR)lParam)->code) + LPNMHDR notif = reinterpret_cast(lParam); + switch (notif->code) { case NM_CUSTOMDRAW: { static bool becomeDarkMode = false; static bool becomeLightMode = false; HWND hHeader = ListView_GetHeader(_fileListView.getHSelf()); - if (NppDarkMode::isEnabled()) + if (NppDarkMode::isEnabled() && (notif->hwndFrom == hHeader)) { if (!becomeDarkMode) { @@ -96,11 +97,9 @@ INT_PTR CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, } becomeLightMode = false; - auto nmtbcd = reinterpret_cast((LPNMHDR)lParam); + auto nmtbcd = reinterpret_cast(notif); SetBkMode(nmtbcd->nmcd.hdc, TRANSPARENT); FillRect(nmtbcd->nmcd.hdc, &nmtbcd->nmcd.rc, NppDarkMode::getBackgroundBrush()); - nmtbcd->clrText = RGB(255, 255, 255); - SetTextColor(nmtbcd->nmcd.hdc, RGB(255, 255, 255)); SetWindowLongPtr(_hSelf, DWLP_MSGRESULT, CDRF_NOTIFYSUBITEMDRAW); } else @@ -115,6 +114,7 @@ INT_PTR CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, } } break; + case NM_DBLCLK: { LPNMITEMACTIVATE lpnmitem = (LPNMITEMACTIVATE) lParam;