From 38b9494aaf7a9dec268840e6524a62c0ad64af9f Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 14 Aug 2024 18:18:32 +0800
Subject: [PATCH 1/4] feat: enhance NotificationCard.
---
.../Controls/NotificationCard.axaml | 114 ++++++++++--------
.../Themes/Dark/NotificationCard.axaml | 3 +-
.../Themes/Light/NotificationCard.axaml | 3 +-
.../Themes/Shared/NotificationCard.axaml | 23 +++-
4 files changed, 84 insertions(+), 59 deletions(-)
diff --git a/src/Semi.Avalonia/Controls/NotificationCard.axaml b/src/Semi.Avalonia/Controls/NotificationCard.axaml
index 221af99..1d3cfa4 100644
--- a/src/Semi.Avalonia/Controls/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Controls/NotificationCard.axaml
@@ -3,15 +3,26 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
-
-
-
+
+
+
+ Hello, Semi.Avalonia!
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
@@ -21,54 +32,53 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -154,4 +164,4 @@
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
index 03c9d2a..dc17611 100644
--- a/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
@@ -1,5 +1,4 @@
-
@@ -7,4 +6,6 @@
0 0 8 0 #1AFFFFFF
+
+
diff --git a/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml
index 2f0f914..4541075 100644
--- a/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml
@@ -1,5 +1,4 @@
-
@@ -7,4 +6,6 @@
0 0 8 0 #1A000000
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml
index 41c7039..4e5476c 100644
--- a/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml
@@ -1,9 +1,22 @@
- 320
+ 320
1
6
- M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM14 7C14 8.10457 13.1046 9 12 9C10.8954 9 10 8.10457 10 7C10 5.89543 10.8954 5 12 5C13.1046 5 14 5.89543 14 7ZM9 10.75C9 10.3358 9.33579 10 9.75 10H12.5C13.0523 10 13.5 10.4477 13.5 11V16.5H14.25C14.6642 16.5 15 16.8358 15 17.25C15 17.6642 14.6642 18 14.25 18H9.75C9.33579 18 9 17.6642 9 17.25C9 16.8358 9.33579 16.5 9.75 16.5H10.5V11.5H9.75C9.33579 11.5 9 11.1642 9 10.75Z
- M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM17.8831 9.82235L11.6854 17.4112C11.4029 17.7806 10.965 17.9981 10.5 18C10.035 18.0019 9.59533 17.788 9.30982 17.421L5.81604 13.4209C5.30744 12.767 5.42524 11.8246 6.07916 11.316C6.73308 10.8074 7.67549 10.9252 8.1841 11.5791L10.4838 14.0439L15.5 8C16.0032 7.34193 16.9446 7.21641 17.6027 7.71964C18.2608 8.22287 18.3863 9.16428 17.8831 9.82235Z
- M10.2268 2.3986L1.52616 19.0749C0.831449 20.4064 1.79747 22 3.29933 22H20.7007C22.2025 22 23.1686 20.4064 22.4739 19.0749L13.7732 2.3986C13.0254 0.965441 10.9746 0.965442 10.2268 2.3986ZM13.1415 14.0101C13.0603 14.5781 12.5739 15 12.0001 15C11.4263 15 10.9398 14.5781 10.8586 14.0101L10.2829 9.97992C10.1336 8.93495 10.9445 8.00002 12.0001 8.00002C13.0556 8.00002 13.8665 8.93495 13.7172 9.97992L13.1415 14.0101ZM13.5001 18.5C13.5001 19.3284 12.8285 20 12.0001 20C11.1716 20 10.5001 19.3284 10.5001 18.5C10.5001 17.6716 11.1716 17 12.0001 17C12.8285 17 13.5001 17.6716 13.5001 18.5Z
- M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM13.5 17.5C13.5 16.6716 12.8284 16 12 16C11.1716 16 10.5 16.6716 10.5 17.5C10.5 18.3284 11.1716 19 12 19C12.8284 19 13.5 18.3284 13.5 17.5ZM12 5C10.9138 5 10.0507 5.91244 10.1109 6.99692L10.4168 12.5023C10.4635 13.3426 11.1584 14 12 14C12.8416 14 13.5365 13.3426 13.5832 12.5023L13.8891 6.99692C13.9493 5.91244 13.0862 5 12 5Z
+ 8
+ 16 12
+
+ 18
+ 18
+ 0 0 12 0
+ M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM14 7C14 8.10457 13.1046 9 12 9C10.8954 9 10 8.10457 10 7C10 5.89543 10.8954 5 12 5C13.1046 5 14 5.89543 14 7ZM9 10.75C9 10.3358 9.33579 10 9.75 10H12.5C13.0523 10 13.5 10.4477 13.5 11V16.5H14.25C14.6642 16.5 15 16.8358 15 17.25C15 17.6642 14.6642 18 14.25 18H9.75C9.33579 18 9 17.6642 9 17.25C9 16.8358 9.33579 16.5 9.75 16.5H10.5V11.5H9.75C9.33579 11.5 9 11.1642 9 10.75Z
+ M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM17.8831 9.82235L11.6854 17.4112C11.4029 17.7806 10.965 17.9981 10.5 18C10.035 18.0019 9.59533 17.788 9.30982 17.421L5.81604 13.4209C5.30744 12.767 5.42524 11.8246 6.07916 11.316C6.73308 10.8074 7.67549 10.9252 8.1841 11.5791L10.4838 14.0439L15.5 8C16.0032 7.34193 16.9446 7.21641 17.6027 7.71964C18.2608 8.22287 18.3863 9.16428 17.8831 9.82235Z
+ M10.2268 2.3986L1.52616 19.0749C0.831449 20.4064 1.79747 22 3.29933 22H20.7007C22.2025 22 23.1686 20.4064 22.4739 19.0749L13.7732 2.3986C13.0254 0.965441 10.9746 0.965442 10.2268 2.3986ZM13.1415 14.0101C13.0603 14.5781 12.5739 15 12.0001 15C11.4263 15 10.9398 14.5781 10.8586 14.0101L10.2829 9.97992C10.1336 8.93495 10.9445 8.00002 12.0001 8.00002C13.0556 8.00002 13.8665 8.93495 13.7172 9.97992L13.1415 14.0101ZM13.5001 18.5C13.5001 19.3284 12.8285 20 12.0001 20C11.1716 20 10.5001 19.3284 10.5001 18.5C10.5001 17.6716 11.1716 17 12.0001 17C12.8285 17 13.5001 17.6716 13.5001 18.5Z
+ M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM13.5 17.5C13.5 16.6716 12.8284 16 12 16C11.1716 16 10.5 16.6716 10.5 17.5C10.5 18.3284 11.1716 19 12 19C12.8284 19 13.5 18.3284 13.5 17.5ZM12 5C10.9138 5 10.0507 5.91244 10.1109 6.99692L10.4168 12.5023C10.4635 13.3426 11.1584 14 12 14C12.8416 14 13.5365 13.3426 13.5832 12.5023L13.8891 6.99692C13.9493 5.91244 13.0862 5 12 5Z
+
+ 4
+
+ 16
+ 600
+ 14
+ 400
\ No newline at end of file
From a328e2bb99b072365e4b43106ea05e41f8c6f293 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 14 Aug 2024 20:00:43 +0800
Subject: [PATCH 2/4] feat: add Light class to NotificationCard.
---
.../Pages/ExpanderDemo.axaml | 3 +-
.../Pages/NotificationDemo.axaml | 41 ++++---
.../Pages/NotificationDemo.axaml.cs | 26 ++++-
.../Controls/NotificationCard.axaml | 102 +++++++++++-------
4 files changed, 117 insertions(+), 55 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/ExpanderDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ExpanderDemo.axaml
index 2de225a..bd2cc1e 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ExpanderDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ExpanderDemo.axaml
@@ -9,6 +9,7 @@
mc:Ignorable="d">
+
@@ -36,4 +37,4 @@
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml
index dd3b7da..ab62545 100644
--- a/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml
@@ -7,18 +7,33 @@
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml.cs
index 65a0955..63a252f 100644
--- a/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml.cs
+++ b/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml.cs
@@ -22,13 +22,35 @@ public partial class NotificationDemo : UserControl
_manager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
}
- private void InfoButton_OnClick(object? sender, RoutedEventArgs e)
+ private void NormalButton_OnClick(object? sender, RoutedEventArgs e)
{
if (sender is Button b && b.Content is string s)
{
- _manager?.Show(Enum.TryParse(s, out NotificationType t)
+ _manager?.Show(Enum.TryParse(s, out var t)
? new Notification(t.ToString(), "This is message", t)
: new Notification(s, "This is message"));
}
}
+
+ private void PositionButton_OnClick(object? sender, RoutedEventArgs e)
+ {
+ if (sender is Button b && b.Content is string s)
+ {
+ Enum.TryParse(s, out var t);
+ _manager.Position = t;
+ _manager?.Show(new Notification(t.ToString(), "This is message"));
+ }
+ }
+
+ private void LightButton_OnClick(object? sender, RoutedEventArgs e)
+ {
+ if (sender is Button b && b.Content is string s)
+ {
+ Enum.TryParse(s, out var notificationType);
+ _manager?.Show(
+ new Notification(notificationType.ToString(), "This is message"),
+ type: notificationType,
+ classes: ["Light"]);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Controls/NotificationCard.axaml b/src/Semi.Avalonia/Controls/NotificationCard.axaml
index 1d3cfa4..5348ac6 100644
--- a/src/Semi.Avalonia/Controls/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Controls/NotificationCard.axaml
@@ -33,52 +33,56 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
@@ -163,5 +167,25 @@
+
+
+
+
+
+
\ No newline at end of file
From 6630d04565246187eb7c25f20c2512eefbdf43aa Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 14 Aug 2024 20:50:54 +0800
Subject: [PATCH 3/4] feat: enhance NotificationDemo.
---
.../Pages/NotificationDemo.axaml | 23 +++++++++++--------
.../Pages/NotificationDemo.axaml.cs | 19 ++++++++-------
2 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml
index ab62545..66a8958 100644
--- a/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml
@@ -8,22 +8,25 @@
d:DesignWidth="800"
mc:Ignorable="d">
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-