From ea3724c714ea0fd7231ef606a75de81a01b1fc3b Mon Sep 17 00:00:00 2001 From: Meik Date: Thu, 5 Mar 2026 16:20:03 +0100 Subject: [PATCH] fix(layout): clamp mainwindow content to rounded corners --- Changelog.md | 1 + MainWindow.xaml | 3 +-- MainWindow.xaml.cs | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index 3ce5125..36b3232 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,6 +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. ### Navigation und Interaktion - Navigation-Buttons neu ausgerichtet (horizontal/vertikal), Icons vergrößert und Zustände vereinheitlicht. diff --git a/MainWindow.xaml b/MainWindow.xaml index 288d4e9..448f976 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -495,7 +495,6 @@ @@ -510,7 +509,7 @@ Canvas.Top="8" Width="75" Height="568" - CornerRadius="20,0,0,0" + CornerRadius="20,0,0,20" BorderThickness="1" BorderBrush="{DynamicResource navigationRailBorderColor}" Background="{DynamicResource navigationRailColor}" /> diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 017fd6d..2c973cd 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -2175,17 +2175,20 @@ namespace C4IT_CustomerPanel if (MainWindowSurface == null || MainWindowContentRoot == null || MainGrid == null) return; + double surfaceWidth = MainWindowSurface.ActualWidth; + double surfaceHeight = MainWindowSurface.ActualHeight; double contentWidth = MainWindowContentRoot.ActualWidth; double contentHeight = MainWindowContentRoot.ActualHeight; - if (contentWidth <= 0 || contentHeight <= 0) + if (surfaceWidth <= 0 || surfaceHeight <= 0 || contentWidth <= 0 || contentHeight <= 0) return; + const double surfaceRadius = 20d; const double contentRadius = 19d; MainGrid.Clip = null; this.Clip = null; - MainWindowSurface.Clip = null; + MainWindowSurface.Clip = new RectangleGeometry(new Rect(0d, 0d, surfaceWidth, surfaceHeight), surfaceRadius, surfaceRadius); MainWindowContentRoot.Clip = new RectangleGeometry(new Rect(0d, 0d, contentWidth, contentHeight), contentRadius, contentRadius); _mainSurfaceClipInitialized = true;