fix(ui): enforce rounded corners via unified root and window clip

This commit is contained in:
Meik
2026-03-05 15:59:38 +01:00
parent 0950f4bbae
commit f2604372c7
3 changed files with 20 additions and 3 deletions

View File

@@ -2175,14 +2175,31 @@ namespace C4IT_CustomerPanel
if (MainWindowSurface == null || MainWindowContentRoot == null || MainGrid == null)
return;
double gridWidth = MainGrid.ActualWidth;
double gridHeight = MainGrid.ActualHeight;
if (gridWidth <= 0 || gridHeight <= 0)
return;
double contentWidth = MainWindowContentRoot.ActualWidth;
double contentHeight = MainWindowContentRoot.ActualHeight;
if (contentWidth <= 0 || contentHeight <= 0)
return;
const double outerRadius = 20d;
const double outerInset = 0.5d;
const double contentRadius = 19d;
MainGrid.Clip = null;
double outerWidth = Math.Max(0d, gridWidth - (outerInset * 2d));
double outerHeight = Math.Max(0d, gridHeight - (outerInset * 2d));
double clippedOuterRadius = Math.Max(0d, outerRadius - outerInset);
RectangleGeometry outerClip = new RectangleGeometry(
new Rect(outerInset, outerInset, outerWidth, outerHeight),
clippedOuterRadius,
clippedOuterRadius);
MainGrid.Clip = outerClip;
this.Clip = outerClip.Clone();
MainWindowSurface.Clip = null;
MainWindowContentRoot.Clip = new RectangleGeometry(new Rect(0d, 0d, contentWidth, contentHeight), contentRadius, contentRadius);