From b304d585bd599c537c38ab8a359dfec45e3e6a27 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Thu, 10 Jul 2025 19:07:59 +0800
Subject: [PATCH] feat: enhance Anchor styles.
---
demo/Ursa.Demo/Pages/AnchorDemo.axaml | 22 ++++++++++++
.../ViewModels/AnchorDemoViewModel.cs | 15 ++++++--
src/Ursa.Themes.Semi/Controls/Anchor.axaml | 35 +++++++++++--------
src/Ursa.Themes.Semi/Themes/Dark/Anchor.axaml | 8 +++++
src/Ursa.Themes.Semi/Themes/Dark/_index.axaml | 1 +
.../Themes/HighContrast/Anchor.axaml | 7 ++++
.../Themes/HighContrast/_index.axaml | 1 +
.../Themes/Light/Anchor.axaml | 8 +++++
.../Themes/Light/_index.axaml | 1 +
.../Themes/Shared/Anchor.axaml | 4 +--
10 files changed, 82 insertions(+), 20 deletions(-)
create mode 100644 src/Ursa.Themes.Semi/Themes/Dark/Anchor.axaml
create mode 100644 src/Ursa.Themes.Semi/Themes/HighContrast/Anchor.axaml
create mode 100644 src/Ursa.Themes.Semi/Themes/Light/Anchor.axaml
diff --git a/demo/Ursa.Demo/Pages/AnchorDemo.axaml b/demo/Ursa.Demo/Pages/AnchorDemo.axaml
index d74ec28..4c6250d 100644
--- a/demo/Ursa.Demo/Pages/AnchorDemo.axaml
+++ b/demo/Ursa.Demo/Pages/AnchorDemo.axaml
@@ -141,6 +141,27 @@
Background="{DynamicResource SemiPurple1}">
+
+
+
+
+
+
+
+
+
AnchorItems { get; } = new()
{
@@ -16,7 +16,16 @@ public partial class AnchorDemoViewModel: ObservableObject
Children =
[
new AnchorItemViewModel() { AnchorId = "anchor3-1", Header = "Anchor 3.1" },
- new AnchorItemViewModel() { AnchorId = "anchor3-2", Header = "Anchor 3.2" },
+ new AnchorItemViewModel()
+ {
+ AnchorId = "anchor3-2", Header = "Anchor 3.2",
+ Children =
+ [
+ new AnchorItemViewModel() { AnchorId = "anchor3-2-1", Header = "Anchor 3.2.1" },
+ new AnchorItemViewModel() { AnchorId = "anchor3-2-2", Header = "Anchor 3.2.2" },
+ new AnchorItemViewModel() { AnchorId = "anchor3-2-3", Header = "Anchor 3.2.3" }
+ ]
+ },
new AnchorItemViewModel() { AnchorId = "anchor3-3", Header = "Anchor 3.3" }
]
},
@@ -27,7 +36,7 @@ public partial class AnchorDemoViewModel: ObservableObject
};
}
-public partial class AnchorItemViewModel: ObservableObject
+public partial class AnchorItemViewModel : ObservableObject
{
[ObservableProperty] private string? _anchorId;
[ObservableProperty] private string? _header;
diff --git a/src/Ursa.Themes.Semi/Controls/Anchor.axaml b/src/Ursa.Themes.Semi/Controls/Anchor.axaml
index 108f37b..63a897e 100644
--- a/src/Ursa.Themes.Semi/Controls/Anchor.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Anchor.axaml
@@ -16,7 +16,7 @@
Name="PART_Pipe"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
- Fill="{DynamicResource SemiColorBorder}" />
+ Fill="{DynamicResource AnchorPipeBackground}" />
-
+
@@ -68,19 +68,24 @@
-
-
-
-
+
+
+
+
diff --git a/src/Ursa.Themes.Semi/Themes/Dark/Anchor.axaml b/src/Ursa.Themes.Semi/Themes/Dark/Anchor.axaml
new file mode 100644
index 0000000..a3e1e55
--- /dev/null
+++ b/src/Ursa.Themes.Semi/Themes/Dark/Anchor.axaml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml b/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml
index 0d5148a..8a8a444 100644
--- a/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml
+++ b/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml
@@ -1,6 +1,7 @@
+
diff --git a/src/Ursa.Themes.Semi/Themes/HighContrast/Anchor.axaml b/src/Ursa.Themes.Semi/Themes/HighContrast/Anchor.axaml
new file mode 100644
index 0000000..f79130a
--- /dev/null
+++ b/src/Ursa.Themes.Semi/Themes/HighContrast/Anchor.axaml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Themes/HighContrast/_index.axaml b/src/Ursa.Themes.Semi/Themes/HighContrast/_index.axaml
index 2014115..bdde3cf 100644
--- a/src/Ursa.Themes.Semi/Themes/HighContrast/_index.axaml
+++ b/src/Ursa.Themes.Semi/Themes/HighContrast/_index.axaml
@@ -1,5 +1,6 @@
+
diff --git a/src/Ursa.Themes.Semi/Themes/Light/Anchor.axaml b/src/Ursa.Themes.Semi/Themes/Light/Anchor.axaml
new file mode 100644
index 0000000..a3e1e55
--- /dev/null
+++ b/src/Ursa.Themes.Semi/Themes/Light/Anchor.axaml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Themes/Light/_index.axaml b/src/Ursa.Themes.Semi/Themes/Light/_index.axaml
index 0d5148a..8a8a444 100644
--- a/src/Ursa.Themes.Semi/Themes/Light/_index.axaml
+++ b/src/Ursa.Themes.Semi/Themes/Light/_index.axaml
@@ -1,6 +1,7 @@
+
diff --git a/src/Ursa.Themes.Semi/Themes/Shared/Anchor.axaml b/src/Ursa.Themes.Semi/Themes/Shared/Anchor.axaml
index cffb17e..770573b 100644
--- a/src/Ursa.Themes.Semi/Themes/Shared/Anchor.axaml
+++ b/src/Ursa.Themes.Semi/Themes/Shared/Anchor.axaml
@@ -1,6 +1,6 @@
-
+
12
20
16
+