fix(layout): clip main body to rounded bottom corners
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
- Hauptlayout von festen `Window.ActualWidth`-Bindings entkoppelt, damit Header/Content nicht über die gerundete Innenfläche hinausragen.
|
- 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.
|
- 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.
|
- 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.
|
- 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
|
### Navigation und Interaktion
|
||||||
|
|||||||
@@ -492,13 +492,17 @@
|
|||||||
</Border.Background>
|
</Border.Background>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
<StackPanel Orientation="Horizontal"
|
<Grid Width="500"
|
||||||
Width="500"
|
Height="576"
|
||||||
Height="576"
|
ClipToBounds="True"
|
||||||
ClipToBounds="True"
|
x:Name="btnSP"
|
||||||
x:Name="btnSP"
|
HorizontalAlignment="Left">
|
||||||
HorizontalAlignment="Left">
|
<Grid.ColumnDefinitions>
|
||||||
<Canvas ClipToBounds="True"
|
<ColumnDefinition Width="75" />
|
||||||
|
<ColumnDefinition Width="425" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Canvas Grid.Column="0"
|
||||||
|
ClipToBounds="True"
|
||||||
Panel.ZIndex="1000"
|
Panel.ZIndex="1000"
|
||||||
Margin="0,0,0,0"
|
Margin="0,0,0,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
@@ -938,7 +942,8 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
|
|
||||||
<Canvas Margin="0,0,0,0"
|
<Canvas Grid.Column="1"
|
||||||
|
Margin="0,0,0,0"
|
||||||
Panel.ZIndex="1"
|
Panel.ZIndex="1"
|
||||||
ClipToBounds="True"
|
ClipToBounds="True"
|
||||||
Height="576"
|
Height="576"
|
||||||
@@ -988,7 +993,7 @@
|
|||||||
</Canvas>
|
</Canvas>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
|
|
||||||
</StackPanel>
|
</Grid>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
<Image Source="Resources/United-Kingdom-Flag-icon.png"
|
<Image Source="Resources/United-Kingdom-Flag-icon.png"
|
||||||
Panel.ZIndex="1001"
|
Panel.ZIndex="1001"
|
||||||
|
|||||||
@@ -2191,9 +2191,39 @@ namespace C4IT_CustomerPanel
|
|||||||
MainWindowSurface.Clip = new RectangleGeometry(new Rect(0d, 0d, surfaceWidth, surfaceHeight), surfaceRadius, surfaceRadius);
|
MainWindowSurface.Clip = new RectangleGeometry(new Rect(0d, 0d, surfaceWidth, surfaceHeight), surfaceRadius, surfaceRadius);
|
||||||
MainWindowContentRoot.Clip = new RectangleGeometry(new Rect(0d, 0d, contentWidth, contentHeight), contentRadius, contentRadius);
|
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;
|
_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
|
public class cMainFunctionInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user