From 0950f4bbaeaddb55ea99ce378c7913095f105f80 Mon Sep 17 00:00:00 2001 From: Meik Date: Thu, 5 Mar 2026 15:55:26 +0100 Subject: [PATCH] fix(ui): unify rounded frame rendering and inner content clip --- Changelog.md | 7 +++---- MainWindow.xaml | 16 ++++------------ MainWindow.xaml.cs | 23 ++++++++--------------- 3 files changed, 15 insertions(+), 31 deletions(-) diff --git a/Changelog.md b/Changelog.md index aac87ac..79f1800 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,10 +5,9 @@ - Komplettes visuelles Redesign der Hauptoberfläche mit modernerem Layout und konsistenter Typografie. - 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 durchgehender Outline-Rahmen umgesetzt, damit die Kontur auch über die Rundungen konsistent sichtbar bleibt. -- Eckradius von WindowChrome und Außenrahmen auf das Inhalts-Panel abgestimmt, damit die Rundungen einheitlich wirken. -- Hauptfläche mit explizitem Rounded-Clip (inset-korrigiert) versehen, damit Inhalte an allen vier Ecken innerhalb des Außenrahmens bleiben. -- Initialisierung des Rounded-Clips auf den finalen Layout-Zeitpunkt erweitert (Loaded/Render), damit die Rundungsbegrenzung stabil auf allen Ecken greift. +- 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. +- Initialisierung des Rounded-Clips auf den finalen Layout-Zeitpunkt erweitert (Loaded/Render), damit die Rundungsbegrenzung stabil greift. ### 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 59cd6f3..272dd86 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -355,13 +355,13 @@ - + @@ -998,14 +998,6 @@ Margin="80,0,0,140" /> - diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 72244c4..f64c87a 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -2172,26 +2172,19 @@ namespace C4IT_CustomerPanel private void UpdateMainSurfaceClip() { - if (MainWindowSurface == null || MainGrid == null) + if (MainWindowSurface == null || MainWindowContentRoot == null || MainGrid == null) return; - double gridWidth = MainGrid.ActualWidth; - double gridHeight = MainGrid.ActualHeight; - if (gridWidth <= 0 || gridHeight <= 0) + double contentWidth = MainWindowContentRoot.ActualWidth; + double contentHeight = MainWindowContentRoot.ActualHeight; + if (contentWidth <= 0 || contentHeight <= 0) return; - const double outerRadius = 20d; - const double surfaceInset = 1d; - double surfaceRadius = Math.Max(0d, outerRadius - surfaceInset); + const double contentRadius = 19d; - MainGrid.Clip = new RectangleGeometry(new Rect(0d, 0d, gridWidth, gridHeight), outerRadius, outerRadius); - - double surfaceWidth = MainWindowSurface.ActualWidth; - double surfaceHeight = MainWindowSurface.ActualHeight; - if (surfaceWidth > 0 && surfaceHeight > 0) - { - MainWindowSurface.Clip = new RectangleGeometry(new Rect(0d, 0d, surfaceWidth, surfaceHeight), surfaceRadius, surfaceRadius); - } + MainGrid.Clip = null; + MainWindowSurface.Clip = null; + MainWindowContentRoot.Clip = new RectangleGeometry(new Rect(0d, 0d, contentWidth, contentHeight), contentRadius, contentRadius); _mainSurfaceClipInitialized = true; }