fix(ui): enforce continuous rounded window corners
This commit is contained in:
@@ -353,7 +353,7 @@
|
|||||||
</shell:WindowChrome.WindowChrome>
|
</shell:WindowChrome.WindowChrome>
|
||||||
|
|
||||||
<Grid x:Name="MainGrid"
|
<Grid x:Name="MainGrid"
|
||||||
Background="{DynamicResource backgroundColor}">
|
Background="Transparent">
|
||||||
<Border x:Name="MainWindowSurface"
|
<Border x:Name="MainWindowSurface"
|
||||||
CornerRadius="20"
|
CornerRadius="20"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
|
|||||||
@@ -2172,25 +2172,27 @@ namespace C4IT_CustomerPanel
|
|||||||
|
|
||||||
private void UpdateMainSurfaceClip()
|
private void UpdateMainSurfaceClip()
|
||||||
{
|
{
|
||||||
if (MainWindowSurface == null)
|
if (MainWindowSurface == null || MainGrid == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
double width = MainWindowSurface.ActualWidth;
|
double width = MainGrid.ActualWidth;
|
||||||
double height = MainWindowSurface.ActualHeight;
|
double height = MainGrid.ActualHeight;
|
||||||
if (width <= 0 || height <= 0)
|
if (width <= 0 || height <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const double outerRadius = 20d;
|
const double outerRadius = 20d;
|
||||||
const double clipInset = 0.5d;
|
const double clipInset = 0d;
|
||||||
double clipWidth = Math.Max(0d, width - (clipInset * 2d));
|
double clipWidth = Math.Max(0d, width - (clipInset * 2d));
|
||||||
double clipHeight = Math.Max(0d, height - (clipInset * 2d));
|
double clipHeight = Math.Max(0d, height - (clipInset * 2d));
|
||||||
double clipRadius = Math.Max(0d, outerRadius - clipInset);
|
double clipRadius = Math.Max(0d, outerRadius - clipInset);
|
||||||
|
RectangleGeometry clipGeometry = new RectangleGeometry(
|
||||||
MainWindowSurface.Clip = new RectangleGeometry(
|
|
||||||
new Rect(clipInset, clipInset, clipWidth, clipHeight),
|
new Rect(clipInset, clipInset, clipWidth, clipHeight),
|
||||||
clipRadius,
|
clipRadius,
|
||||||
clipRadius);
|
clipRadius);
|
||||||
|
|
||||||
|
MainGrid.Clip = clipGeometry;
|
||||||
|
MainWindowSurface.Clip = clipGeometry.Clone();
|
||||||
|
|
||||||
_mainSurfaceClipInitialized = true;
|
_mainSurfaceClipInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user