From f2604372c7e5e4b118fb6940bf60a704dc8238c0 Mon Sep 17 00:00:00 2001 From: Meik Date: Thu, 5 Mar 2026 15:59:38 +0100 Subject: [PATCH] fix(ui): enforce rounded corners via unified root and window clip --- Changelog.md | 2 +- MainWindow.xaml | 2 +- MainWindow.xaml.cs | 19 ++++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 79f1800..2822e16 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,7 +6,7 @@ - Navigation, Content und Header farblich auf dynamische Konfigurationsfarben umgestellt. - Einheitliche Button-Optik für Primary-Actions, Top-Bar-Actions und dialogbezogene Aktionen. - Außenrahmen der Haupt-GUI als durchgehende Border auf der Hauptfläche umgesetzt, damit die Kontur über alle Rundungen konsistent bleibt. -- Eckradius von WindowChrome, Hauptfläche und Inhalts-Clip aufeinander abgestimmt, damit Inhalte in allen vier Ecken innerhalb des Rahmens bleiben. +- Eckradius über einen einheitlichen Root-/Window-Clip und einen inneren Inhalts-Clip abgestimmt, damit Inhalte in allen vier Ecken innerhalb des Rahmens bleiben. - Initialisierung des Rounded-Clips auf den finalen Layout-Zeitpunkt erweitert (Loaded/Render), damit die Rundungsbegrenzung stabil greift. ### Navigation und Interaktion diff --git a/MainWindow.xaml b/MainWindow.xaml index 272dd86..e995e24 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -346,7 +346,7 @@ diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index f64c87a..4bc3205 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -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);