parent
aa17a4bc7a
commit
7e139e1ba2
|
@ -161,7 +161,22 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
{
|
||||
// Note: lParam is -1 to prevent endless loops of calls
|
||||
::SendMessage(_dockingManager.getHSelf(), WM_NCACTIVATE, wParam, -1);
|
||||
return ::DefWindowProc(hwnd, message, wParam, lParam);
|
||||
result = ::DefWindowProc(hwnd, message, wParam, lParam);
|
||||
if (NppDarkMode::isDarkMenuEnabled() && NppDarkMode::isEnabled())
|
||||
{
|
||||
NppDarkMode::drawUAHMenuNCBottomLine(hwnd);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
case WM_NCPAINT:
|
||||
{
|
||||
result = ::DefWindowProc(hwnd, message, wParam, lParam);
|
||||
if (NppDarkMode::isDarkMenuEnabled() && NppDarkMode::isEnabled())
|
||||
{
|
||||
NppDarkMode::drawUAHMenuNCBottomLine(hwnd);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
|
|
|
@ -353,6 +353,34 @@ namespace NppDarkMode
|
|||
}
|
||||
}
|
||||
|
||||
void drawUAHMenuNCBottomLine(HWND hWnd)
|
||||
{
|
||||
MENUBARINFO mbi = { sizeof(mbi) };
|
||||
if (!GetMenuBarInfo(hWnd, OBJID_MENU, 0, &mbi))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RECT rcClient = { 0 };
|
||||
GetClientRect(hWnd, &rcClient);
|
||||
MapWindowPoints(hWnd, nullptr, (POINT*)&rcClient, 2);
|
||||
|
||||
RECT rcWindow = { 0 };
|
||||
GetWindowRect(hWnd, &rcWindow);
|
||||
|
||||
OffsetRect(&rcClient, -rcWindow.left, -rcWindow.top);
|
||||
|
||||
// the rcBar is offset by the window rect
|
||||
RECT rcAnnoyingLine = rcClient;
|
||||
rcAnnoyingLine.bottom = rcAnnoyingLine.top;
|
||||
rcAnnoyingLine.top--;
|
||||
|
||||
|
||||
HDC hdc = GetWindowDC(hWnd);
|
||||
FillRect(hdc, &rcAnnoyingLine, NppDarkMode::getDarkerBackgroundBrush());
|
||||
ReleaseDC(hWnd, hdc);
|
||||
}
|
||||
|
||||
// from DarkMode.h
|
||||
|
||||
void initExperimentalDarkMode(bool fixDarkScrollbar, bool dark)
|
||||
|
|
|
@ -55,6 +55,7 @@ namespace NppDarkMode
|
|||
// processes messages related to UAH / custom menubar drawing.
|
||||
// return true if handled, false to continue with normal processing in your wndproc
|
||||
bool runUAHWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* lr);
|
||||
void drawUAHMenuNCBottomLine(HWND hWnd);
|
||||
|
||||
// from DarkMode.h
|
||||
void initExperimentalDarkMode(bool fixDarkScrollbar, bool dark);
|
||||
|
|
Loading…
Reference in New Issue