fix(ui): render rounded frame as explicit top overlay

This commit is contained in:
Meik
2026-03-05 17:07:49 +01:00
parent 73baa136e8
commit 071fa668f4
3 changed files with 33 additions and 2 deletions

View File

@@ -2211,6 +2211,11 @@ namespace C4IT_CustomerPanel
MainWindowCornerMaskOverlay.Data = CreateCornerOverflowMaskGeometry(surfaceWidth, surfaceHeight, surfaceRadius);
}
if (MainWindowFrameOverlay != null)
{
MainWindowFrameOverlay.Data = CreateFrameOverlayGeometry(surfaceWidth, surfaceHeight, surfaceRadius, 1d);
}
if (btnSP != null && btnSP.ActualWidth > 0d && btnSP.ActualHeight > 0d)
{
btnSP.Clip = CreateBottomRoundedRectGeometry(btnSP.ActualWidth, btnSP.ActualHeight, contentRadius);
@@ -2260,6 +2265,23 @@ namespace C4IT_CustomerPanel
return mask;
}
private static Geometry CreateFrameOverlayGeometry(double width, double height, double radius, double strokeThickness)
{
if (width <= 0d || height <= 0d)
return Geometry.Empty;
double inset = Math.Max(0d, strokeThickness / 2d);
double frameWidth = Math.Max(0d, width - strokeThickness);
double frameHeight = Math.Max(0d, height - strokeThickness);
if (frameWidth <= 0d || frameHeight <= 0d)
return Geometry.Empty;
double frameRadius = Math.Max(0d, Math.Min(radius - inset, Math.Min(frameWidth / 2d, frameHeight / 2d)));
var frame = new RectangleGeometry(new Rect(inset, inset, frameWidth, frameHeight), frameRadius, frameRadius);
frame.Freeze();
return frame;
}
private void ApplyRoundedWindowRegion()
{
if (!IsLoaded || WindowState == WindowState.Minimized)