From e57036163db9edde42d665dba0f7333ba56009a3 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Tue, 14 Jan 2025 21:28:41 +0800
Subject: [PATCH 1/7] feat: add Gap property to Avatar.
---
demo/Ursa.Demo/Pages/AvatarDemo.axaml | 6 ++++
src/Ursa.Themes.Semi/Controls/Avatar.axaml | 32 +++++++++++++------
src/Ursa/Controls/Avatar/Avatar.cs | 9 ++++++
...erter.cs => DoubleToThicknessConverter.cs} | 7 ++--
4 files changed, 42 insertions(+), 12 deletions(-)
rename src/Ursa/Converters/{DivideByTwoConverter.cs => DoubleToThicknessConverter.cs} (72%)
diff --git a/demo/Ursa.Demo/Pages/AvatarDemo.axaml b/demo/Ursa.Demo/Pages/AvatarDemo.axaml
index c3046c3..e401bfc 100644
--- a/demo/Ursa.Demo/Pages/AvatarDemo.axaml
+++ b/demo/Ursa.Demo/Pages/AvatarDemo.axaml
@@ -93,5 +93,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Controls/Avatar.axaml b/src/Ursa.Themes.Semi/Controls/Avatar.axaml
index 4fe9705..b8cfc97 100644
--- a/src/Ursa.Themes.Semi/Controls/Avatar.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Avatar.axaml
@@ -3,12 +3,20 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa"
xmlns:converters="clr-namespace:Ursa.Converters;assembly=Ursa">
-
+
+
+
+
+
+
+
+
+
@@ -24,14 +32,20 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
- Background="{TemplateBinding Background}" />
-
+ Background="{TemplateBinding Background}">
+
+
+
+
GapProperty = AvaloniaProperty.Register(
+ nameof(Gap));
+
public static readonly StyledProperty SourceProperty = AvaloniaProperty.Register(
nameof(Source));
public static readonly StyledProperty
-
+
diff --git a/src/Ursa.Themes.Semi/Themes/Dark/Badge.axaml b/src/Ursa.Themes.Semi/Themes/Dark/Badge.axaml
index 37c6584..5c2b5e9 100644
--- a/src/Ursa.Themes.Semi/Themes/Dark/Badge.axaml
+++ b/src/Ursa.Themes.Semi/Themes/Dark/Badge.axaml
@@ -3,32 +3,32 @@
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Themes/Light/Badge.axaml b/src/Ursa.Themes.Semi/Themes/Light/Badge.axaml
index 403f137..ff148f7 100644
--- a/src/Ursa.Themes.Semi/Themes/Light/Badge.axaml
+++ b/src/Ursa.Themes.Semi/Themes/Light/Badge.axaml
@@ -3,32 +3,32 @@
-
+
+
-
-
+
-
+
-
-
-
-
-
+
-
+
+
+
+
+
-
+
+
-
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Themes/Shared/Badge.axaml b/src/Ursa.Themes.Semi/Themes/Shared/Badge.axaml
index 9f1dd5d..b69c74a 100644
--- a/src/Ursa.Themes.Semi/Themes/Shared/Badge.axaml
+++ b/src/Ursa.Themes.Semi/Themes/Shared/Badge.axaml
@@ -8,7 +8,7 @@
8
4,0
1
- 10
+ 12
100
TopRight
\ No newline at end of file
From 33bfd67833e6227d151f8f73582c7e5bee2c98d5 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Thu, 16 Jan 2025 18:31:03 +0800
Subject: [PATCH 6/7] feat: remove Template when Dot=True, add Badge Tests,
format Badge class.
---
src/Ursa.Themes.Semi/Controls/Badge.axaml | 41 +++-------
src/Ursa/Controls/Badge.cs | 39 +++++----
.../Controls/BadgeTests/BadgeTests.cs | 79 +++++++++++++++++++
3 files changed, 115 insertions(+), 44 deletions(-)
create mode 100644 tests/HeadlessTest.Ursa/Controls/BadgeTests/BadgeTests.cs
diff --git a/src/Ursa.Themes.Semi/Controls/Badge.axaml b/src/Ursa.Themes.Semi/Controls/Badge.axaml
index 11cd4c5..d11ee3f 100644
--- a/src/Ursa.Themes.Semi/Controls/Badge.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Badge.axaml
@@ -66,10 +66,15 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
- IsVisible="{Binding Header, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
RenderTransformOrigin=".5,.5"
Theme="{TemplateBinding BadgeTheme}"
UseLayoutRounding="False">
+
+
+
+
+
+
-
+