From 69e6921b1c544edabc82329db09ac7936c5943fd Mon Sep 17 00:00:00 2001 From: St0RM53 Date: Sat, 21 Nov 2026 01:10:54 +0200 Subject: [PATCH] Allow negative separator margins to extend past menu padding (#2521) Skin separators with negative Main_separator_slices_X / Main2_separator_slices_X values now extend past the item rect into the menu padding, letting the divider span the full menu width. The middle (stretchable) band covers the extended area. Positive values behave exactly as before, so existing skins are unaffected. Closes #2521 --- Src/StartMenu/StartMenuDLL/MenuPaint.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Src/StartMenu/StartMenuDLL/MenuPaint.cpp b/Src/StartMenu/StartMenuDLL/MenuPaint.cpp index 9ea9d6710..5fba47071 100644 --- a/Src/StartMenu/StartMenuDLL/MenuPaint.cpp +++ b/Src/StartMenu/StartMenuDLL/MenuPaint.cpp @@ -2112,9 +2112,18 @@ void CMenuContainer::DrawBackground( HDC hdc, const RECT &drawRect ) { itemRect2.top=(itemRect2.top+itemRect2.bottom-settings.sepHeight)/2; itemRect2.bottom=itemRect2.top+settings.sepHeight; + // negative margins extend the separator past the menu padding, + // the middle (stretchable) band then spans the extended area + bool bExtendLeft=settings.sepSlicesX[0]<0; + bool bExtendRight=settings.sepSlicesX[2]<0; + if (bExtendLeft) + itemRect2.left+=settings.sepSlicesX[0]; + if (bExtendRight) + itemRect2.right-=settings.sepSlicesX[2]; + int midStart=bExtendLeft?0:settings.sepSlicesX[0]; HGDIOBJ bmp0=SelectObject(hdc2,settings.bmpSeparator.GetBitmap()); - RECT rSrc={0,0,settings.sepSlicesX[0]+settings.sepSlicesX[1]+settings.sepSlicesX[2],settings.sepHeight}; - RECT rMargins={settings.sepSlicesX[0],settings.sepHeight,settings.sepSlicesX[2],0}; + RECT rSrc={0,0,midStart+settings.sepSlicesX[1]+(bExtendRight?0:settings.sepSlicesX[2]),settings.sepHeight}; + RECT rMargins={bExtendLeft?0:settings.sepSlicesX[0],settings.sepHeight,bExtendRight?0:settings.sepSlicesX[2],0}; MarginsBlit(hdc2,hdc,rSrc,itemRect2,rMargins,settings.bmpSeparator.bIs32); SelectObject(hdc2,bmp0); }