MCPcopy Create free account
hub / github.com/0x7c13/UnityEditor-DarkMode / UAHDrawMenuNCBottomLine

Function UAHDrawMenuNCBottomLine

UnityEditorDarkMode.cpp:294–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294void UAHDrawMenuNCBottomLine(HWND hWnd) {
295 MENUBARINFO mbi = { sizeof(mbi) };
296
297 if (!GetMenuBarInfo(hWnd, OBJID_MENU, 0, &mbi))
298 {
299 return;
300 }
301
302 RECT rcClient = { 0 };
303 GetClientRect(hWnd, &rcClient);
304 MapWindowPoints(hWnd, nullptr, (POINT*)&rcClient, 2);
305
306 RECT rcWindow = { 0 };
307 GetWindowRect(hWnd, &rcWindow);
308 OffsetRect(&rcClient, -rcWindow.left, -rcWindow.top);
309 // the rcBar is offset by the window rect
310 RECT rcAnnoyingLine = rcClient;
311 rcAnnoyingLine.bottom = rcAnnoyingLine.top;
312 rcAnnoyingLine.top--;
313
314 HDC hdc = GetWindowDC(hWnd);
315 FillRect(hdc, &rcAnnoyingLine, LoadThemeConfig()->menubar_bgbrush);
316 ReleaseDC(hWnd, hdc);
317}
318
319// https://stackoverflow.com/questions/16313333/drawing-rounded-and-colored-owner-draw-buttons
320void PaintODTBUTTON(const DRAWITEMSTRUCT& dis) {

Callers 1

CallWndSubClassProcFunction · 0.85

Calls 1

LoadThemeConfigFunction · 0.85

Tested by

no test coverage detected