From d6d03133b492d4f593b80cfc77d8320c2aca8296 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Sun, 15 Mar 2026 03:39:24 +0800
Subject: [PATCH] feat: refactor WindowDrawnDecorations with new styling and
structure. (#768)
---
.../Controls/WindowDrawnDecorations.axaml | 171 +++++++++---------
...ons.axaml => WindowDrawnDecorations.axaml} | 3 +
src/Semi.Avalonia/Themes/Dark/_index.axaml | 2 +-
...ons.axaml => WindowDrawnDecorations.axaml} | 2 +
.../Themes/HighContrast/_index.axaml | 2 +-
...ons.axaml => WindowDrawnDecorations.axaml} | 3 +
src/Semi.Avalonia/Themes/Light/_index.axaml | 2 +-
...ons.axaml => WindowDrawnDecorations.axaml} | 0
src/Semi.Avalonia/Themes/Shared/_index.axaml | 2 +-
9 files changed, 96 insertions(+), 91 deletions(-)
rename src/Semi.Avalonia/Themes/Dark/{CaptionButtons.axaml => WindowDrawnDecorations.axaml} (80%)
rename src/Semi.Avalonia/Themes/HighContrast/{CaptionButtons.axaml => WindowDrawnDecorations.axaml} (89%)
rename src/Semi.Avalonia/Themes/Light/{CaptionButtons.axaml => WindowDrawnDecorations.axaml} (80%)
rename src/Semi.Avalonia/Themes/Shared/{CaptionButtons.axaml => WindowDrawnDecorations.axaml} (100%)
diff --git a/src/Semi.Avalonia/Controls/WindowDrawnDecorations.axaml b/src/Semi.Avalonia/Controls/WindowDrawnDecorations.axaml
index 8b0ed6f..820fec8 100644
--- a/src/Semi.Avalonia/Controls/WindowDrawnDecorations.axaml
+++ b/src/Semi.Avalonia/Controls/WindowDrawnDecorations.axaml
@@ -8,7 +8,7 @@
-
+
+ Foreground="{TemplateBinding Foreground}">
+
+
+
+
+
+
@@ -36,7 +44,7 @@
-
+
@@ -44,16 +52,17 @@
+ BoxShadow="{DynamicResource WindowBorderShadow}" />
-
@@ -61,10 +70,10 @@
-
+
-
-
+ Content="{StaticResource WindowExpandGlyph}"
+ WindowDecorationProperties.ElementRole="FullScreenButton" />
+ Content="{StaticResource WindowMinimizeGlyph}"
+ WindowDecorationProperties.ElementRole="MinimizeButton" />
+ Content="{StaticResource WindowMaximizeGlyph}"
+ WindowDecorationProperties.ElementRole="MaximizeButton" />
+ Content="{StaticResource WindowCloseIconGlyph}"
+ WindowDecorationProperties.ElementRole="CloseButton" />
-
+
+ Content="{StaticResource WindowCollapseGlyph}"
+ WindowDecorationProperties.ElementRole="FullScreenButton" />
+
-
-
+
-
-
+
-
+
+
-
-
-
+
-
-
+
+
-
-
-
+
-
-
-
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml b/src/Semi.Avalonia/Themes/Dark/WindowDrawnDecorations.axaml
similarity index 80%
rename from src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml
rename to src/Semi.Avalonia/Themes/Dark/WindowDrawnDecorations.axaml
index 766d849..2173028 100644
--- a/src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/WindowDrawnDecorations.axaml
@@ -1,4 +1,7 @@
+
+
+
diff --git a/src/Semi.Avalonia/Themes/Dark/_index.axaml b/src/Semi.Avalonia/Themes/Dark/_index.axaml
index 46fdce6..c74719b 100644
--- a/src/Semi.Avalonia/Themes/Dark/_index.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/_index.axaml
@@ -8,7 +8,6 @@
-
@@ -48,5 +47,6 @@
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/HighContrast/CaptionButtons.axaml b/src/Semi.Avalonia/Themes/HighContrast/WindowDrawnDecorations.axaml
similarity index 89%
rename from src/Semi.Avalonia/Themes/HighContrast/CaptionButtons.axaml
rename to src/Semi.Avalonia/Themes/HighContrast/WindowDrawnDecorations.axaml
index f99e0df..2dcce3e 100644
--- a/src/Semi.Avalonia/Themes/HighContrast/CaptionButtons.axaml
+++ b/src/Semi.Avalonia/Themes/HighContrast/WindowDrawnDecorations.axaml
@@ -1,4 +1,6 @@
+
+
diff --git a/src/Semi.Avalonia/Themes/HighContrast/_index.axaml b/src/Semi.Avalonia/Themes/HighContrast/_index.axaml
index ea9e375..04ed1ec 100644
--- a/src/Semi.Avalonia/Themes/HighContrast/_index.axaml
+++ b/src/Semi.Avalonia/Themes/HighContrast/_index.axaml
@@ -7,7 +7,6 @@
-
@@ -48,5 +47,6 @@
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/CaptionButtons.axaml b/src/Semi.Avalonia/Themes/Light/WindowDrawnDecorations.axaml
similarity index 80%
rename from src/Semi.Avalonia/Themes/Light/CaptionButtons.axaml
rename to src/Semi.Avalonia/Themes/Light/WindowDrawnDecorations.axaml
index 766d849..2173028 100644
--- a/src/Semi.Avalonia/Themes/Light/CaptionButtons.axaml
+++ b/src/Semi.Avalonia/Themes/Light/WindowDrawnDecorations.axaml
@@ -1,4 +1,7 @@
+
+
+
diff --git a/src/Semi.Avalonia/Themes/Light/_index.axaml b/src/Semi.Avalonia/Themes/Light/_index.axaml
index 46fdce6..c74719b 100644
--- a/src/Semi.Avalonia/Themes/Light/_index.axaml
+++ b/src/Semi.Avalonia/Themes/Light/_index.axaml
@@ -8,7 +8,6 @@
-
@@ -48,5 +47,6 @@
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/CaptionButtons.axaml b/src/Semi.Avalonia/Themes/Shared/WindowDrawnDecorations.axaml
similarity index 100%
rename from src/Semi.Avalonia/Themes/Shared/CaptionButtons.axaml
rename to src/Semi.Avalonia/Themes/Shared/WindowDrawnDecorations.axaml
diff --git a/src/Semi.Avalonia/Themes/Shared/_index.axaml b/src/Semi.Avalonia/Themes/Shared/_index.axaml
index 46fdce6..c74719b 100644
--- a/src/Semi.Avalonia/Themes/Shared/_index.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/_index.axaml
@@ -8,7 +8,6 @@
-
@@ -48,5 +47,6 @@
+
\ No newline at end of file