fix(layout): clip main body to rounded bottom corners

This commit is contained in:
Meik
2026-03-05 16:40:26 +01:00
parent abd179a7e6
commit a6358d581e
3 changed files with 45 additions and 10 deletions

View File

@@ -10,7 +10,7 @@
- Hauptlayout von festen `Window.ActualWidth`-Bindings entkoppelt, damit Header/Content nicht über die gerundete Innenfläche hinausragen.
- Feste Hauptlayout-Höhen (Navigation/Content) auf die verfügbare Innenhöhe abgestimmt und Clipping im Dock-Bereich aktiviert, damit keine Inhalte in die Rundungsbereiche überlaufen.
- Initialisierung des Rounded-Clips auf den finalen Layout-Zeitpunkt erweitert (Loaded/Render), damit die Rundungsbegrenzung stabil greift.
- MainWindow-Ecküberstände beseitigt: Navigation-Rail unten links an den Fensterradius angepasst, Content-Bereich im `DockPanel` als Fill-Element geführt und zusätzlicher Surface-Clip auf Radius `20` gesetzt.
- MainWindow-Ecküberstände beseitigt: Navigation-Rail unten links an den Fensterradius angepasst, Content-Bereich im `DockPanel` als Fill-Element geführt, zusätzlicher Surface-Clip auf Radius `20` gesetzt und Body-Host per Geometrie mit gerundeten unteren Ecken begrenzt.
- Sichtbarkeit des Main-Contents wiederhergestellt: Navigations-/Content-Host auf feste Breitenaufteilung (`75 + 425`) umgestellt, damit das Inhaltspanel nicht mehr durch einen Zero-Width-Viewport abgeschnitten wird.
### Navigation und Interaktion

View File

@@ -492,13 +492,17 @@
</Border.Background>
</Border>
</Grid>
<StackPanel Orientation="Horizontal"
Width="500"
<Grid Width="500"
Height="576"
ClipToBounds="True"
x:Name="btnSP"
HorizontalAlignment="Left">
<Canvas ClipToBounds="True"
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75" />
<ColumnDefinition Width="425" />
</Grid.ColumnDefinitions>
<Canvas Grid.Column="0"
ClipToBounds="True"
Panel.ZIndex="1000"
Margin="0,0,0,0"
VerticalAlignment="Top"
@@ -938,7 +942,8 @@
</Button>
</Canvas>
<Canvas Margin="0,0,0,0"
<Canvas Grid.Column="1"
Margin="0,0,0,0"
Panel.ZIndex="1"
ClipToBounds="True"
Height="576"
@@ -988,7 +993,7 @@
</Canvas>
</Canvas>
</StackPanel>
</Grid>
</DockPanel>
<Image Source="Resources/United-Kingdom-Flag-icon.png"
Panel.ZIndex="1001"

View File

@@ -2191,9 +2191,39 @@ namespace C4IT_CustomerPanel
MainWindowSurface.Clip = new RectangleGeometry(new Rect(0d, 0d, surfaceWidth, surfaceHeight), surfaceRadius, surfaceRadius);
MainWindowContentRoot.Clip = new RectangleGeometry(new Rect(0d, 0d, contentWidth, contentHeight), contentRadius, contentRadius);
if (btnSP != null && btnSP.ActualWidth > 0d && btnSP.ActualHeight > 0d)
{
btnSP.Clip = CreateBottomRoundedRectGeometry(btnSP.ActualWidth, btnSP.ActualHeight, surfaceRadius);
}
_mainSurfaceClipInitialized = true;
}
private static Geometry CreateBottomRoundedRectGeometry(double width, double height, double radius)
{
if (width <= 0d || height <= 0d)
return Geometry.Empty;
double r = Math.Max(0d, Math.Min(radius, Math.Min(width / 2d, height / 2d)));
if (r <= 0d)
return new RectangleGeometry(new Rect(0d, 0d, width, height));
var geometry = new StreamGeometry();
using (var context = geometry.Open())
{
context.BeginFigure(new Point(0d, 0d), true, true);
context.LineTo(new Point(width, 0d), true, false);
context.LineTo(new Point(width, height - r), true, false);
context.ArcTo(new Point(width - r, height), new Size(r, r), 0d, false, SweepDirection.Clockwise, true, false);
context.LineTo(new Point(r, height), true, false);
context.ArcTo(new Point(0d, height - r), new Size(r, r), 0d, false, SweepDirection.Clockwise, true, false);
context.LineTo(new Point(0d, 0d), true, false);
}
geometry.Freeze();
return geometry;
}
}
public class cMainFunctionInfo