parent
a6bbdeb92e
commit
e4ebeed6f9
|
@ -981,6 +981,11 @@ namespace NppDarkMode
|
|||
SetWindowSubclass(hwnd, TabSubclass, g_tabSubclassID, 0);
|
||||
}
|
||||
|
||||
void disableVisualStyle(HWND hwnd)
|
||||
{
|
||||
SetWindowTheme(hwnd, L"", L"");
|
||||
}
|
||||
|
||||
void autoSubclassAndThemeChildControls(HWND hwndParent, bool subclass, bool theme)
|
||||
{
|
||||
struct Params
|
||||
|
|
|
@ -78,6 +78,7 @@ namespace NppDarkMode
|
|||
void subclassGroupboxControl(HWND hwnd);
|
||||
void subclassToolbarControl(HWND hwnd);
|
||||
void subclassTabControl(HWND hwnd);
|
||||
void disableVisualStyle(HWND hwnd);
|
||||
|
||||
void autoSubclassAndThemeChildControls(HWND hwndParent, bool subclass = true, bool theme = true);
|
||||
void autoThemeChildControls(HWND hwndParent);
|
||||
|
|
|
@ -810,6 +810,32 @@ void ProjectPanel::notified(LPNMHDR notification)
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (notification->code == NM_CUSTOMDRAW && (notification->hwndFrom == _hToolbarMenu))
|
||||
{
|
||||
if (NppDarkMode::isEnabled())
|
||||
{
|
||||
static bool isVSDisabled = false;
|
||||
if (!isVSDisabled)
|
||||
{
|
||||
NppDarkMode::disableVisualStyle(_hToolbarMenu);
|
||||
isVSDisabled = true;
|
||||
}
|
||||
|
||||
auto nmtbcd = reinterpret_cast<LPNMTBCUSTOMDRAW>(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);
|
||||
SetWindowLongPtr(_hSelf, DWLP_MSGRESULT, CDRF_NOTIFYSUBITEMDRAW | TBCDRF_HILITEHOTTRACK);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowLongPtr(_hSelf, DWLP_MSGRESULT, CDRF_DODEFAULT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectPanel::setWorkSpaceDirty(bool isDirty)
|
||||
|
|
Loading…
Reference in New Issue