From 1311aaabdd0fbbd966769c9439f30b5ed9522d80 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 7 Aug 2024 15:30:28 +0800
Subject: [PATCH 01/25] fix: TextBox inner button colors.
(cherry picked from commit 4b71b18e72415fffa1fbb5efad7859e36260c4bf)
---
demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml | 5 +++--
src/Semi.Avalonia/Controls/TextBox.axaml | 8 +++++++-
src/Semi.Avalonia/Themes/Dark/Button.axaml | 6 +++---
src/Semi.Avalonia/Themes/Dark/TextBox.axaml | 3 ---
src/Semi.Avalonia/Themes/Light/Button.axaml | 6 +++---
src/Semi.Avalonia/Themes/Light/TextBox.axaml | 11 ++++-------
src/Semi.Avalonia/Themes/Shared/TextBox.axaml | 4 ++--
7 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml
index c7ddf33..821c54d 100644
--- a/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml
@@ -24,8 +24,9 @@
+ Classes="ClearButton RevealPasswordButton"
+ PasswordChar="*"
+ Text="123456" />
-
+
@@ -45,6 +45,12 @@
+
+
diff --git a/src/Semi.Avalonia/Themes/Dark/Button.axaml b/src/Semi.Avalonia/Themes/Dark/Button.axaml
index 2f9ff5a..73279bf 100644
--- a/src/Semi.Avalonia/Themes/Dark/Button.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Button.axaml
@@ -82,7 +82,7 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/TextBox.axaml b/src/Semi.Avalonia/Themes/Dark/TextBox.axaml
index 31a0922..f9b5024 100644
--- a/src/Semi.Avalonia/Themes/Dark/TextBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/TextBox.axaml
@@ -9,9 +9,6 @@
-
-
-
diff --git a/src/Semi.Avalonia/Themes/Light/Button.axaml b/src/Semi.Avalonia/Themes/Light/Button.axaml
index ba9513c..adbc890 100644
--- a/src/Semi.Avalonia/Themes/Light/Button.axaml
+++ b/src/Semi.Avalonia/Themes/Light/Button.axaml
@@ -82,7 +82,7 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/TextBox.axaml b/src/Semi.Avalonia/Themes/Light/TextBox.axaml
index dfcc1ed..467e67b 100644
--- a/src/Semi.Avalonia/Themes/Light/TextBox.axaml
+++ b/src/Semi.Avalonia/Themes/Light/TextBox.axaml
@@ -3,21 +3,18 @@
-
-
+
+
-
-
-
-
+
-
+
diff --git a/src/Semi.Avalonia/Themes/Shared/TextBox.axaml b/src/Semi.Avalonia/Themes/Shared/TextBox.axaml
index 9df2ab2..d0b3591 100644
--- a/src/Semi.Avalonia/Themes/Shared/TextBox.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/TextBox.axaml
@@ -14,6 +14,6 @@
12 5
90
- M12 4C5 4 1 10 1 12C1 14 5 20 12 20C19 20 23 14 23 12C23 10 19 4 12 4ZM17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z
- M2.02949 4.67856C2.7593 4.28654 3.66871 4.56038 4.06073 5.29018C6.21313 9.29726 8.83179 11.5 12.0001 11.5C15.1685 11.5 17.7871 9.29726 19.9395 5.29018C20.3315 4.56038 21.241 4.28655 21.9708 4.67856C22.7006 5.07058 22.9744 5.97999 22.5824 6.7098C21.9049 7.97104 21.1385 9.15419 20.2743 10.199L23.2001 14.1C23.6971 14.7627 23.5628 15.7029 22.9001 16.2C22.2373 16.697 21.2971 16.5627 20.8001 15.9L18.1186 12.3246C17.448 12.8501 16.7322 13.2957 15.9687 13.6441L17.4046 17.4733C17.6955 18.249 17.3025 19.1136 16.5268 19.4045C15.7511 19.6954 14.8865 19.3024 14.5956 18.5267L13.0956 14.5267C13.0852 14.4988 13.0756 14.4709 13.0669 14.4428C12.7193 14.4806 12.3638 14.5 12.0001 14.5C11.6365 14.5 11.281 14.4806 10.9333 14.4428C10.9246 14.4709 10.9151 14.4988 10.9046 14.5267L9.40463 18.5267C9.11375 19.3024 8.24913 19.6954 7.47345 19.4045C6.69777 19.1136 6.30476 18.249 6.59564 17.4733L8.03159 13.6441C7.26806 13.2957 6.55223 12.8501 5.88163 12.3246L3.20009 15.9C2.70303 16.5627 1.76283 16.697 1.10009 16.2C0.437347 15.7029 0.303032 14.7627 0.800088 14.1L3.72589 10.1989C2.86177 9.15415 2.09533 7.97101 1.41787 6.70979C1.02585 5.97999 1.29969 5.07057 2.02949 4.67856Z
+ M21.7071 3.70711C22.0976 3.31658 22.0976 2.68342 21.7071 2.29289C21.3166 1.90237 20.6834 1.90237 20.2929 2.29289L17.3135 5.27233C15.8114 4.50566 14.0321 4 12 4C5 4 1 10 1 12C1 13.1757 2.38219 15.7335 4.94345 17.6423L2.29289 20.2929C1.90237 20.6834 1.90237 21.3166 2.29289 21.7071C2.68342 22.0976 3.31658 22.0976 3.70711 21.7071L21.7071 3.70711ZM7.8284 14.7574L9.29237 13.2934C9.10495 12.9018 9 12.4631 9 12C9 10.3431 10.3431 9 12 9C12.4631 9 12.9018 9.10495 13.2934 9.29237L14.7574 7.8284C13.967 7.30488 13.0191 7 12 7C9.23858 7 7 9.23858 7 12C7 13.0191 7.30488 13.967 7.8284 14.7574Z M12 20C10.7789 20 9.64914 19.8174 8.61594 19.5054L11.1871 16.9342C11.4516 16.9775 11.7232 17 12 17C14.7614 17 17 14.7614 17 12C17 11.7232 16.9775 11.4516 16.9342 11.1871L20.5032 7.61808C22.1342 9.27317 23 11.0695 23 12C23 14 19 20 12 20Z
+ M12 4C5 4 1 10 1 12C1 14 5 20 12 20C19 20 23 14 23 12C23 10 19 4 12 4ZM17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z
\ No newline at end of file
From 871f112800a1e60b6f851ce1a2e34088f2ea831f Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 15 May 2024 21:40:27 +0800
Subject: [PATCH 02/25] fix: fix CalendarDatePicker & ComboBox color.
---
.../Pages/CalendarDatePickerDemo.axaml | 25 +++--
.../Pages/ComboBoxDemo.axaml | 97 +++++++------------
.../Pages/ComboBoxDemo.axaml.cs | 10 +-
.../Themes/Dark/CalendarDatePicker.axaml | 6 +-
src/Semi.Avalonia/Themes/Dark/ComboBox.axaml | 18 ++--
.../Themes/Light/CalendarDatePicker.axaml | 8 +-
src/Semi.Avalonia/Themes/Light/ComboBox.axaml | 11 ++-
7 files changed, 84 insertions(+), 91 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml
index 44a1413..4730e62 100644
--- a/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml
@@ -8,11 +8,22 @@
d:DesignWidth="800"
mc:Ignorable="d">
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
-
-
-
-
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml
index 488a8ff..1595b4a 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml
@@ -4,71 +4,40 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- d:DesignHeight="450"
+ xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
+ d:DesignHeight="800"
d:DesignWidth="800"
mc:Ignorable="d">
+
+
+
-
- Ding
- Otter
- Husky
- Mr. 17
- Cass
-
-
- Ding
- Otter
- Husky
- Mr. 17
- Cass
-
-
- Ding
- Otter
- Husky
- Mr. 17
- Cass
-
-
- Ding
- Otter
- Husky
- Mr. 17
- Cass
-
-
- Ding
- Otter
- Husky
- Mr. 17
- Cass
-
-
- Ding
- Otter
- Husky
- Mr. 17
- Cass
-
-
- Ding
- Otter
- Husky
- Mr. 17
- Cass
-
-
- Ding
- Otter
- Husky
- Mr. 17
- Cass
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs
index 80b05bc..3c8cba2 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs
+++ b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs
@@ -1,6 +1,6 @@
-using Avalonia;
+using System.Collections.ObjectModel;
using Avalonia.Controls;
-using Avalonia.Markup.Xaml;
+using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.Pages;
@@ -9,5 +9,11 @@ public partial class ComboBoxDemo : UserControl
public ComboBoxDemo()
{
InitializeComponent();
+ this.DataContext = new ComboBoxDemoViewModel();
}
+}
+
+public class ComboBoxDemoViewModel : ObservableObject
+{
+ public ObservableCollection Items { get; set; } = ["Ding", "Otter", "Husky", "Mr.17", "Cass"];
}
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml b/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml
index 962d533..817c7e1 100644
--- a/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml
@@ -10,7 +10,7 @@
0 0 8 0 #1AFFFFFF
-
+
-
-
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml
index 29fc605..5d8a707 100644
--- a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml
@@ -1,27 +1,31 @@
+
-
+
+
+
0 0 8 0 #1AFFFFFF
-
-
+
+
+
@@ -30,9 +34,11 @@
-
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml b/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml
index fccdc95..19a5b83 100644
--- a/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml
+++ b/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml
@@ -2,15 +2,15 @@
-
-
-
+
+
+
0 0 8 0 #1A000000
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/ComboBox.axaml b/src/Semi.Avalonia/Themes/Light/ComboBox.axaml
index 46fe865..8fc128f 100644
--- a/src/Semi.Avalonia/Themes/Light/ComboBox.axaml
+++ b/src/Semi.Avalonia/Themes/Light/ComboBox.axaml
@@ -1,11 +1,13 @@
+
-
+
+
@@ -22,6 +24,7 @@
+
@@ -30,9 +33,11 @@
-
+
+
+
-
+
\ No newline at end of file
From 2fadfdd5de556b97bbb7836d3142209864f8c58b Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Sat, 10 Aug 2024 13:50:33 +0800
Subject: [PATCH 03/25] fix: ClearButton will take the icon place when TextBox
has value.
(cherry picked from commit 7a6c42e1066606daecc6448bfcc01ef8baf9072f)
---
.../Controls/CalendarDatePicker.axaml | 185 +++++++++---------
src/Semi.Avalonia/Controls/ComboBox.axaml | 49 +++--
2 files changed, 126 insertions(+), 108 deletions(-)
diff --git a/src/Semi.Avalonia/Controls/CalendarDatePicker.axaml b/src/Semi.Avalonia/Controls/CalendarDatePicker.axaml
index 16bb361..9d36342 100644
--- a/src/Semi.Avalonia/Controls/CalendarDatePicker.axaml
+++ b/src/Semi.Avalonia/Controls/CalendarDatePicker.axaml
@@ -27,115 +27,112 @@
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="{TemplateBinding CornerRadius}">
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ BoxShadow="{DynamicResource CalendarDatePickerPopupBoxShadows}"
+ CornerRadius="{DynamicResource CalendarCornerRadius}">
+
+
+
+
+
-
+
+
-
+
-
+
+
-
-
@@ -159,9 +162,18 @@
-
@@ -222,6 +234,10 @@
+
+
+
@@ -303,5 +323,6 @@
+
From c20b9319593fd88bc85f432e0b8f20bd89ae6f8a Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 22 Apr 2024 01:00:22 +0800
Subject: [PATCH 04/25] fix: various issues.
* CalendarDatePicker Bordered class.
* ComboBox Pressed BorderBrush.
* ToggleSwitch default Background & BorderBrush.
* CheckBox & ListBox Background.
(cherry picked from commit cf54ad51f99b05dee695d377218a96c3324e1d44)
---
src/Semi.Avalonia/Themes/Dark/CheckBox.axaml | 4 ++--
src/Semi.Avalonia/Themes/Dark/ListBox.axaml | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
index 964a754..0a8bad1 100644
--- a/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
@@ -27,8 +27,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
index 5d0bd41..df91878 100644
--- a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
@@ -87,8 +87,8 @@
-
-
+
+
\ No newline at end of file
From c18cf9ec73ae9fd5be18f06c25b60fc0c10c9fcf Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 22 Apr 2024 01:13:35 +0800
Subject: [PATCH 05/25] fix: Dark BorderBrush.
(cherry picked from commit 20b2cf3aaaec1cb12dc518abee54b365b614fdf1)
---
src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/Calendar.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/CheckBox.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/Expander.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/Flyout.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/ListBox.axaml | 4 ++--
src/Semi.Avalonia/Themes/Dark/Menu.axaml | 4 ++--
src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/RadioButton.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/SplitView.axaml | 3 ++-
13 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml b/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml
index 76fd6b9..5b151d2 100644
--- a/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml
@@ -1,5 +1,5 @@
0 0 8 0 #1AFFFFFF
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml b/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml
index 2aeac3b..6ede30c 100644
--- a/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml
@@ -4,5 +4,5 @@
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/Calendar.axaml b/src/Semi.Avalonia/Themes/Dark/Calendar.axaml
index e9f48c2..a7a8bae 100644
--- a/src/Semi.Avalonia/Themes/Dark/Calendar.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Calendar.axaml
@@ -1,7 +1,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
index 0a8bad1..67de2a8 100644
--- a/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
@@ -20,7 +20,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
index 6f0ecc8..ed62aa2 100644
--- a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
@@ -9,7 +9,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/Expander.axaml b/src/Semi.Avalonia/Themes/Dark/Expander.axaml
index 691b55b..9e41ae3 100644
--- a/src/Semi.Avalonia/Themes/Dark/Expander.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Expander.axaml
@@ -1,5 +1,5 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/Flyout.axaml b/src/Semi.Avalonia/Themes/Dark/Flyout.axaml
index 87a6de1..12b6f5e 100644
--- a/src/Semi.Avalonia/Themes/Dark/Flyout.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Flyout.axaml
@@ -1,6 +1,6 @@
-
+
0 0 8 0 #1AFFFFFF
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml b/src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml
index 79315cc..c5804df 100644
--- a/src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
index df91878..39f448f 100644
--- a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
@@ -21,7 +21,7 @@
-
+
@@ -79,7 +79,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/Menu.axaml b/src/Semi.Avalonia/Themes/Dark/Menu.axaml
index cd613ce..e87602a 100644
--- a/src/Semi.Avalonia/Themes/Dark/Menu.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Menu.axaml
@@ -3,14 +3,14 @@
-
+
0 0 8 0 #1AFFFFFF
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
index 8c8e318..03c9d2a 100644
--- a/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
@@ -1,6 +1,6 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml b/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml
index d4f2811..9370769 100644
--- a/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml
@@ -10,7 +10,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/SplitView.axaml b/src/Semi.Avalonia/Themes/Dark/SplitView.axaml
index aea9a99..0deac77 100644
--- a/src/Semi.Avalonia/Themes/Dark/SplitView.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/SplitView.axaml
@@ -1,4 +1,5 @@
-
+
+
\ No newline at end of file
From cb6d676ae95f27624709ae257648cec62c713de0 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 22 Apr 2024 01:23:03 +0800
Subject: [PATCH 06/25] misc: format resources.
(cherry picked from commit e20f0a41619322de5686db1490df4f78f18ab561)
---
src/Semi.Avalonia/Themes/Dark/Border.axaml | 2 +-
.../Themes/Dark/ButtonSpinner.axaml | 4 ++--
src/Semi.Avalonia/Themes/Dark/CheckBox.axaml | 14 +++++------
.../Themes/Dark/DataValidationErrors.axaml | 18 +++++++-------
src/Semi.Avalonia/Themes/Dark/ListBox.axaml | 24 +++++++++----------
.../Themes/Dark/RadioButton.axaml | 6 ++---
src/Semi.Avalonia/Themes/Dark/Slider.axaml | 2 +-
src/Semi.Avalonia/Themes/Light/Border.axaml | 2 +-
.../Themes/Light/ButtonSpinner.axaml | 2 +-
src/Semi.Avalonia/Themes/Light/CheckBox.axaml | 14 +++++------
.../Themes/Light/DataValidationErrors.axaml | 18 +++++++-------
.../Themes/Light/DateTimePickerShared.axaml | 4 ++--
src/Semi.Avalonia/Themes/Light/Label.axaml | 6 ++---
src/Semi.Avalonia/Themes/Light/ListBox.axaml | 16 ++++++-------
.../Themes/Light/RadioButton.axaml | 2 +-
src/Semi.Avalonia/Themes/Light/Slider.axaml | 2 +-
16 files changed, 68 insertions(+), 68 deletions(-)
diff --git a/src/Semi.Avalonia/Themes/Dark/Border.axaml b/src/Semi.Avalonia/Themes/Dark/Border.axaml
index 25d26fc..4d61729 100644
--- a/src/Semi.Avalonia/Themes/Dark/Border.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Border.axaml
@@ -1,5 +1,5 @@
+ 0 0 14 0 #1AFFFFFF
- 0 0 14 0 #1AFFFFFF
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml b/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml
index 6ede30c..86a3abd 100644
--- a/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml
@@ -1,8 +1,8 @@
-
+
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
index 67de2a8..c620699 100644
--- a/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
@@ -21,14 +21,14 @@
-
-
+
+
-
-
-
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/DataValidationErrors.axaml b/src/Semi.Avalonia/Themes/Dark/DataValidationErrors.axaml
index 45a1849..40df42c 100644
--- a/src/Semi.Avalonia/Themes/Dark/DataValidationErrors.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/DataValidationErrors.axaml
@@ -1,11 +1,11 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
index 39f448f..01b9e96 100644
--- a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
@@ -5,8 +5,8 @@
-
-
+
+
@@ -27,11 +27,11 @@
-
+
-
+
@@ -50,7 +50,7 @@
-
+
@@ -80,15 +80,15 @@
-
-
+
+
-
-
-
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml b/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml
index 9370769..fe1e7b0 100644
--- a/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml
@@ -16,11 +16,11 @@
-
+
-
+
@@ -40,7 +40,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/Slider.axaml b/src/Semi.Avalonia/Themes/Dark/Slider.axaml
index a020cce..4f446cf 100644
--- a/src/Semi.Avalonia/Themes/Dark/Slider.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Slider.axaml
@@ -8,7 +8,7 @@
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/Border.axaml b/src/Semi.Avalonia/Themes/Light/Border.axaml
index affef76..eb19ed2 100644
--- a/src/Semi.Avalonia/Themes/Light/Border.axaml
+++ b/src/Semi.Avalonia/Themes/Light/Border.axaml
@@ -1,5 +1,5 @@
+ 0 0 14 0 #1A000000
- 0 0 14 0 #1A000000
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/ButtonSpinner.axaml b/src/Semi.Avalonia/Themes/Light/ButtonSpinner.axaml
index 5183887..c8a51fd 100644
--- a/src/Semi.Avalonia/Themes/Light/ButtonSpinner.axaml
+++ b/src/Semi.Avalonia/Themes/Light/ButtonSpinner.axaml
@@ -5,4 +5,4 @@
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/CheckBox.axaml b/src/Semi.Avalonia/Themes/Light/CheckBox.axaml
index 321e720..7b8f707 100644
--- a/src/Semi.Avalonia/Themes/Light/CheckBox.axaml
+++ b/src/Semi.Avalonia/Themes/Light/CheckBox.axaml
@@ -26,11 +26,11 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/DataValidationErrors.axaml b/src/Semi.Avalonia/Themes/Light/DataValidationErrors.axaml
index 1116060..f84359d 100644
--- a/src/Semi.Avalonia/Themes/Light/DataValidationErrors.axaml
+++ b/src/Semi.Avalonia/Themes/Light/DataValidationErrors.axaml
@@ -1,11 +1,11 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/DateTimePickerShared.axaml b/src/Semi.Avalonia/Themes/Light/DateTimePickerShared.axaml
index cd685fb..5c70384 100644
--- a/src/Semi.Avalonia/Themes/Light/DateTimePickerShared.axaml
+++ b/src/Semi.Avalonia/Themes/Light/DateTimePickerShared.axaml
@@ -15,13 +15,13 @@
-
+
-
+
diff --git a/src/Semi.Avalonia/Themes/Light/Label.axaml b/src/Semi.Avalonia/Themes/Light/Label.axaml
index 082d195..5826e49 100644
--- a/src/Semi.Avalonia/Themes/Light/Label.axaml
+++ b/src/Semi.Avalonia/Themes/Light/Label.axaml
@@ -33,7 +33,7 @@
-
+
@@ -71,7 +71,7 @@
-
+
@@ -89,7 +89,7 @@
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/ListBox.axaml b/src/Semi.Avalonia/Themes/Light/ListBox.axaml
index bec09ca..4305590 100644
--- a/src/Semi.Avalonia/Themes/Light/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Light/ListBox.axaml
@@ -50,7 +50,7 @@
-
+
@@ -84,11 +84,11 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/RadioButton.axaml b/src/Semi.Avalonia/Themes/Light/RadioButton.axaml
index 935597a..87ef1d9 100644
--- a/src/Semi.Avalonia/Themes/Light/RadioButton.axaml
+++ b/src/Semi.Avalonia/Themes/Light/RadioButton.axaml
@@ -40,7 +40,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Light/Slider.axaml b/src/Semi.Avalonia/Themes/Light/Slider.axaml
index f949737..bb1d311 100644
--- a/src/Semi.Avalonia/Themes/Light/Slider.axaml
+++ b/src/Semi.Avalonia/Themes/Light/Slider.axaml
@@ -8,7 +8,7 @@
-
+
\ No newline at end of file
From 423d5f36098b96ba126d5d1903bbfdacd0c76a32 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 7 Aug 2024 17:17:54 +0800
Subject: [PATCH 07/25] fix: fix Popup related control Background color.
(cherry picked from commit 95744b7a6468aec64d844d665e00eb04937f6d18)
---
src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/Calendar.axaml | 8 ++++----
src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/Flyout.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/Menu.axaml | 4 ++--
src/Semi.Avalonia/Themes/Light/Calendar.axaml | 4 +---
6 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml b/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml
index 5b151d2..7e13458 100644
--- a/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml
@@ -1,5 +1,5 @@
0 0 8 0 #1AFFFFFF
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/Calendar.axaml b/src/Semi.Avalonia/Themes/Dark/Calendar.axaml
index a7a8bae..9b994ad 100644
--- a/src/Semi.Avalonia/Themes/Dark/Calendar.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Calendar.axaml
@@ -1,17 +1,17 @@
-
+
-
+
-
+
@@ -24,7 +24,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
index ed62aa2..8a9b1a9 100644
--- a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
@@ -1,6 +1,6 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/Flyout.axaml b/src/Semi.Avalonia/Themes/Dark/Flyout.axaml
index 12b6f5e..6e2a1fb 100644
--- a/src/Semi.Avalonia/Themes/Dark/Flyout.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Flyout.axaml
@@ -1,5 +1,5 @@
-
+
0 0 8 0 #1AFFFFFF
diff --git a/src/Semi.Avalonia/Themes/Dark/Menu.axaml b/src/Semi.Avalonia/Themes/Dark/Menu.axaml
index e87602a..91175d7 100644
--- a/src/Semi.Avalonia/Themes/Dark/Menu.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Menu.axaml
@@ -2,12 +2,12 @@
-
+
0 0 8 0 #1AFFFFFF
-
+
diff --git a/src/Semi.Avalonia/Themes/Light/Calendar.axaml b/src/Semi.Avalonia/Themes/Light/Calendar.axaml
index 004048d..92a51ef 100644
--- a/src/Semi.Avalonia/Themes/Light/Calendar.axaml
+++ b/src/Semi.Avalonia/Themes/Light/Calendar.axaml
@@ -1,6 +1,4 @@
-
+
From c1c2920bb278188dd52e6fe565e0661075c161d7 Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Thu, 15 Aug 2024 17:41:31 +0800
Subject: [PATCH 08/25] feat: respect AllowAutoHide in DataGrid.
(cherry picked from commit a3ed11fa10ce10f6b8a4e8a18c1e328e5e378f91)
---
demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml | 6 +++++-
src/Semi.Avalonia.DataGrid/DataGrid.axaml | 11 +++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml
index ba7f847..d2c8add 100644
--- a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml
@@ -14,7 +14,10 @@
-
+
+
+
+
diff --git a/src/Semi.Avalonia.DataGrid/DataGrid.axaml b/src/Semi.Avalonia.DataGrid/DataGrid.axaml
index e9a5a88..7793490 100644
--- a/src/Semi.Avalonia.DataGrid/DataGrid.axaml
+++ b/src/Semi.Avalonia.DataGrid/DataGrid.axaml
@@ -471,6 +471,7 @@
+
@@ -570,5 +571,15 @@
+
+
+
+
From d1089b977911aa8d703362b60df7e38329514531 Mon Sep 17 00:00:00 2001
From: LUJIAN2020 <504439788@qq.com>
Date: Mon, 9 Sep 2024 16:22:16 +0800
Subject: [PATCH 09/25] Fixed DataGridRow with selected color not obvious in
the Light theme
(cherry picked from commit 5e51de6db93c8f6e131a56e110c3c2af53a60483)
---
src/Semi.Avalonia.DataGrid/Light.axaml | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/Semi.Avalonia.DataGrid/Light.axaml b/src/Semi.Avalonia.DataGrid/Light.axaml
index 0f6219d..60c32a6 100644
--- a/src/Semi.Avalonia.DataGrid/Light.axaml
+++ b/src/Semi.Avalonia.DataGrid/Light.axaml
@@ -20,7 +20,6 @@
-
From 9220c46d4384f87392ffd7a3c4e63a90cbb5897f Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 11 Sep 2024 12:22:20 +0800
Subject: [PATCH 10/25] feat: enhance NotificationCard.
---
.../Pages/NotificationDemo.axaml | 26 +++++---
.../Pages/NotificationDemo.axaml.cs | 13 +++-
.../Controls/NotificationCard.axaml | 62 ++++++++++---------
.../Themes/Dark/NotificationCard.axaml | 7 ++-
.../Themes/Light/NotificationCard.axaml | 5 +-
.../Themes/Shared/NotificationCard.axaml | 23 +++++--
6 files changed, 88 insertions(+), 48 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml
index f4dcf01..684441c 100644
--- a/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml
@@ -7,11 +7,23 @@
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..335774a 100644
--- a/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml.cs
+++ b/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml.cs
@@ -22,13 +22,22 @@ 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 RadioButton b && b.Content is string s)
+ {
+ Enum.TryParse(s, out var t);
+ _manager.Position = t;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Controls/NotificationCard.axaml b/src/Semi.Avalonia/Controls/NotificationCard.axaml
index 221af99..edef1bd 100644
--- a/src/Semi.Avalonia/Controls/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Controls/NotificationCard.axaml
@@ -3,65 +3,69 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
-
-
-
+
+
+
+
+ Hello, Semi.Avalonia!
+
+
+
-
-
-
-
-
-
+
+ Data="{DynamicResource NotificationCardInformationIconPathData}" />
-
-
+
-
-
diff --git a/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
index 03c9d2a..8012771 100644
--- a/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
@@ -1,10 +1,11 @@
-
- 0 0 8 0 #1AFFFFFF
-
+ inset 0 0 0 1 #1AFFFFFF, 0 4 14 0 #40000000
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml
index 2f0f914..6ed6ff2 100644
--- a/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml
@@ -1,10 +1,11 @@
-
- 0 0 8 0 #1A000000
+ 0 0 1 0 #4A000000, 0 4 14 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..9310982 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
+ 20 16 12 16
+
+ 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 8f5c496cc50cabd9a81f6bc391ee45a2b37aae49 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Thu, 28 Mar 2024 15:39:09 +0800
Subject: [PATCH 11/25] feat: add DatePicker & TimePicker support.
(cherry picked from commit 04ffd38e143eadbaa8657a5e241991f4c437c895)
---
src/Semi.Avalonia/Controls/DatePicker.axaml | 6 +++---
src/Semi.Avalonia/Controls/TimePicker.axaml | 6 ++++--
src/Semi.Avalonia/Locale/en-us.axaml | 7 +++++++
src/Semi.Avalonia/Locale/zh-cn.axaml | 7 +++++++
4 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/src/Semi.Avalonia/Controls/DatePicker.axaml b/src/Semi.Avalonia/Controls/DatePicker.axaml
index 7a3210a..a89bf1c 100644
--- a/src/Semi.Avalonia/Controls/DatePicker.axaml
+++ b/src/Semi.Avalonia/Controls/DatePicker.axaml
@@ -171,7 +171,7 @@
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
- Text="day" />
+ Text="{DynamicResource STRING_DATEPICKER_DAY_TEXT}" />
+ Text="{DynamicResource STRING_DATEPICKER_YEAR_TEXT}" />
+ FontWeight="{TemplateBinding FontWeight}"
+ Text="{DynamicResource STRING_TIMEPICKER_HOUR_TEXT}" />
+ FontWeight="{TemplateBinding FontWeight}"
+ Text="{DynamicResource STRING_TIMEPICKER_MINUTE_TEXT}" />
+
+ day
+ month
+ year
+
+ hour
+ minute
Cut
Copy
diff --git a/src/Semi.Avalonia/Locale/zh-cn.axaml b/src/Semi.Avalonia/Locale/zh-cn.axaml
index 6101cb5..e46fe54 100644
--- a/src/Semi.Avalonia/Locale/zh-cn.axaml
+++ b/src/Semi.Avalonia/Locale/zh-cn.axaml
@@ -1,6 +1,13 @@
+
+ 日
+ 月
+ 年
+
+ 时
+ 分
剪切
复制
From 1124e79ae8ca6bcc09216779fa4ae970b19f9497 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A0=D0=BE?=
=?UTF-8?q?=D0=B4=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?=
Date: Mon, 5 Aug 2024 22:13:50 +0300
Subject: [PATCH 12/25] RU locale
(cherry picked from commit a28cbf5ac203ff415dca8a8d29da72515c7f809f)
---
src/Semi.Avalonia/Locale/ru-ru.axaml | 24 +++++++++++++++++++++
src/Semi.Avalonia/Locale/ru-ru.axaml.cs | 8 +++++++
src/Semi.Avalonia/Themes/SemiTheme.axaml.cs | 11 +++++-----
3 files changed, 38 insertions(+), 5 deletions(-)
create mode 100644 src/Semi.Avalonia/Locale/ru-ru.axaml
create mode 100644 src/Semi.Avalonia/Locale/ru-ru.axaml.cs
diff --git a/src/Semi.Avalonia/Locale/ru-ru.axaml b/src/Semi.Avalonia/Locale/ru-ru.axaml
new file mode 100644
index 0000000..0807d44
--- /dev/null
+++ b/src/Semi.Avalonia/Locale/ru-ru.axaml
@@ -0,0 +1,24 @@
+
+
+ день
+ месяц
+ год
+
+ часы
+ минуты
+
+ Вырезать
+ Копировать
+ Вставить
+
+ Имя файла
+ Показать скрытые файлы
+ OK
+ Cancel
+ Имя
+ Дата изменения
+ Тип
+ Размер
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Locale/ru-ru.axaml.cs b/src/Semi.Avalonia/Locale/ru-ru.axaml.cs
new file mode 100644
index 0000000..ad9bc07
--- /dev/null
+++ b/src/Semi.Avalonia/Locale/ru-ru.axaml.cs
@@ -0,0 +1,8 @@
+using Avalonia.Controls;
+
+namespace Semi.Avalonia.Locale;
+
+public class ru_ru : ResourceDictionary
+{
+
+}
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs b/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs
index 88268f3..7ce1bd1 100644
--- a/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs
+++ b/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs
@@ -8,14 +8,15 @@ using Semi.Avalonia.Locale;
namespace Semi.Avalonia;
-public class SemiTheme: Styles
+public class SemiTheme : Styles
{
private static readonly Dictionary _localeToResource = new()
{
{ new CultureInfo("zh-cn"), new zh_cn() },
{ new CultureInfo("en-us"), new en_us() },
+ { new CultureInfo("ru-ru"), new ru_ru() },
};
-
+
private readonly IServiceProvider? sp;
public SemiTheme(IServiceProvider? provider = null)
{
@@ -28,17 +29,17 @@ public class SemiTheme: Styles
{
get => _locale;
set
- {
+ {
_locale = value;
var resource = TryGetLocaleResource(value);
- if(resource is null) return;
+ if (resource is null) return;
foreach (var kv in resource)
{
this.Resources.Add(kv);
}
}
}
-
+
private static ResourceDictionary? TryGetLocaleResource(CultureInfo? locale)
{
if (locale is null)
From 20f30f3867a24236f3992592946248ed11446431 Mon Sep 17 00:00:00 2001
From: Darth-Lexx <116996438+Darth-Lexx@users.noreply.github.com>
Date: Sat, 24 Aug 2024 15:43:35 +0300
Subject: [PATCH 13/25] Rul Locale update
(cherry picked from commit c3257d97fabb963ca84a2e6efc52a1eaff0c9da1)
---
src/Semi.Avalonia/Locale/ru-ru.axaml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/Semi.Avalonia/Locale/ru-ru.axaml b/src/Semi.Avalonia/Locale/ru-ru.axaml
index 0807d44..cfa1e30 100644
--- a/src/Semi.Avalonia/Locale/ru-ru.axaml
+++ b/src/Semi.Avalonia/Locale/ru-ru.axaml
@@ -8,7 +8,8 @@
часы
минуты
-
+ секунды
+
Вырезать
Копировать
Вставить
@@ -16,7 +17,7 @@
Имя файла
Показать скрытые файлы
OK
- Cancel
+ Отмена
Имя
Дата изменения
Тип
From 5161331b98985e871879f6ea5c9f1b6d31de20c9 Mon Sep 17 00:00:00 2001
From: Gehongyan
Date: Sat, 10 Aug 2024 00:25:02 +0800
Subject: [PATCH 14/25] feat: ja-jp localization
(cherry picked from commit f564c98afdd961768c9975dd7124810c43129276)
---
src/Semi.Avalonia/Locale/ja-jp.axaml | 24 +++++++++++++++++++++
src/Semi.Avalonia/Locale/ja-jp.axaml.cs | 8 +++++++
src/Semi.Avalonia/Themes/SemiTheme.axaml.cs | 1 +
3 files changed, 33 insertions(+)
create mode 100644 src/Semi.Avalonia/Locale/ja-jp.axaml
create mode 100644 src/Semi.Avalonia/Locale/ja-jp.axaml.cs
diff --git a/src/Semi.Avalonia/Locale/ja-jp.axaml b/src/Semi.Avalonia/Locale/ja-jp.axaml
new file mode 100644
index 0000000..e9d10f8
--- /dev/null
+++ b/src/Semi.Avalonia/Locale/ja-jp.axaml
@@ -0,0 +1,24 @@
+
+
+ 日
+ 月
+ 年
+
+ 時
+ 分
+
+ 切り取り
+ コピー
+ 貼り付け
+
+ ファイル名
+ 隠しファイルを表示
+ 確認
+ キャンセル
+ 名前
+ 更新日時
+ 種類
+ サイズ
+
diff --git a/src/Semi.Avalonia/Locale/ja-jp.axaml.cs b/src/Semi.Avalonia/Locale/ja-jp.axaml.cs
new file mode 100644
index 0000000..d054d32
--- /dev/null
+++ b/src/Semi.Avalonia/Locale/ja-jp.axaml.cs
@@ -0,0 +1,8 @@
+using Avalonia.Controls;
+
+namespace Semi.Avalonia.Locale;
+
+public class ja_jp: ResourceDictionary
+{
+
+}
diff --git a/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs b/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs
index 7ce1bd1..23144a0 100644
--- a/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs
+++ b/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs
@@ -14,6 +14,7 @@ public class SemiTheme : Styles
{
{ new CultureInfo("zh-cn"), new zh_cn() },
{ new CultureInfo("en-us"), new en_us() },
+ { new CultureInfo("ja-jp"), new ja_jp() },
{ new CultureInfo("ru-ru"), new ru_ru() },
};
From 1d975fa734307a6679f05128aae27bb761512ce2 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 26 Aug 2024 20:16:46 +0800
Subject: [PATCH 15/25] feat: enhance FileChooser demo.
(cherry picked from commit e4c21aefc69984af7fcd807abd3f2f3310e5bbb1)
---
.../Pages/ManagedFileChooserDemo.axaml | 11 ++++--
.../Pages/ManagedFileChooserDemo.axaml.cs | 34 +++++++++----------
2 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/ManagedFileChooserDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ManagedFileChooserDemo.axaml
index dcb845f..418e8c4 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ManagedFileChooserDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ManagedFileChooserDemo.axaml
@@ -8,8 +8,13 @@
d:DesignWidth="800"
mc:Ignorable="d">
-
-
-
+
+
+
+
+
+
diff --git a/demo/Semi.Avalonia.Demo/Pages/ManagedFileChooserDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/ManagedFileChooserDemo.axaml.cs
index 18d5ab2..80fdf60 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ManagedFileChooserDemo.axaml.cs
+++ b/demo/Semi.Avalonia.Demo/Pages/ManagedFileChooserDemo.axaml.cs
@@ -1,10 +1,6 @@
-using System;
using System.Collections.Generic;
-using Avalonia;
using Avalonia.Controls;
-using Avalonia.Dialogs;
using Avalonia.Interactivity;
-using Avalonia.Markup.Xaml;
using Avalonia.Platform.Storage;
namespace Semi.Avalonia.Demo.Pages;
@@ -14,14 +10,14 @@ public partial class ManagedFileChooserDemo : UserControl
public ManagedFileChooserDemo()
{
InitializeComponent();
- openFileDialog.Click += OpenFileDialog;
- selectFolderDialog.Click += SelectFolderDialog;
- saveFileDialog.Click += SaveFileDialog;
+ OpenFileButton.Click += OpenFileDialog;
+ SelectFolderButton.Click += SelectFolderDialog;
+ SaveFileButton.Click += SaveFileDialog;
}
- private async void OpenFileDialog(object sender, RoutedEventArgs args)
+ private async void OpenFileDialog(object? sender, RoutedEventArgs args)
{
- IStorageProvider? sp = GetStorageProvider();
+ var sp = GetStorageProvider();
if (sp is null) return;
var result = await sp.OpenFilePickerAsync(new FilePickerOpenOptions()
{
@@ -30,9 +26,10 @@ public partial class ManagedFileChooserDemo : UserControl
AllowMultiple = true,
});
}
- private async void SelectFolderDialog(object sender, RoutedEventArgs args)
+
+ private async void SelectFolderDialog(object? sender, RoutedEventArgs args)
{
- IStorageProvider? sp = GetStorageProvider();
+ var sp = GetStorageProvider();
if (sp is null) return;
var result = await sp.OpenFolderPickerAsync(new FolderPickerOpenOptions()
{
@@ -40,16 +37,17 @@ public partial class ManagedFileChooserDemo : UserControl
AllowMultiple = true,
});
}
- private async void SaveFileDialog(object sender, RoutedEventArgs args)
+
+ private async void SaveFileDialog(object? sender, RoutedEventArgs args)
{
- IStorageProvider? sp = GetStorageProvider();
+ var sp = GetStorageProvider();
if (sp is null) return;
var result = await sp.SaveFilePickerAsync(new FilePickerSaveOptions()
{
- Title = "Open File",
+ Title = "Save File",
});
}
-
+
private IStorageProvider? GetStorageProvider()
{
var topLevel = TopLevel.GetTopLevel(this);
@@ -58,10 +56,10 @@ public partial class ManagedFileChooserDemo : UserControl
List? GetFileTypes()
{
- return new List
- {
+ return
+ [
FilePickerFileTypes.All,
FilePickerFileTypes.TextPlain
- };
+ ];
}
}
\ No newline at end of file
From 6e94913d5c9610680ca27df5a4a475dbf586a05c Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Tue, 6 Aug 2024 15:22:49 +0800
Subject: [PATCH 16/25] feat: add Loading Classes.
(cherry picked from commit d355410ff20053c1a718b63b2f23b84a16348aed)
---
.../Pages/ToggleSwitchDemo.axaml | 6 ++
src/Semi.Avalonia/Controls/ToggleSwitch.axaml | 84 +++++++++++++++++++
.../Themes/Shared/ToggleSwitch.axaml | 2 +
3 files changed, 92 insertions(+)
diff --git a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
index d747949..94299c2 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
@@ -27,14 +27,20 @@
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml
index 5f7a8ae..8bb8bc6 100644
--- a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml
+++ b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml
@@ -72,6 +72,37 @@
Background="White"
BoxShadow="0 0 1 1 #222E3238"
CornerRadius="100" />
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -149,6 +180,22 @@
+
+
+
+
+
+
+
+
+
@@ -261,6 +314,37 @@
Background="White"
BoxShadow="0 0 1 1 #222E3238"
CornerRadius="100" />
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml b/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml
index 16a1e78..56a0b72 100644
--- a/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml
@@ -11,6 +11,8 @@
2 0 0 0
1 0 0 0
3 0 0 0
+ 1
+ 3
12
14
From 56c4073f4affaca82e75a37f9f9df5478cb3b5fc Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Tue, 6 Aug 2024 16:38:45 +0800
Subject: [PATCH 17/25] feat: add OnContent & OffContent to SimpleToggleSwitch.
(cherry picked from commit 3af7e2f29a3ac2d55d6266849c07de8bfdd0ba7f)
---
.../Pages/ToggleSwitchDemo.axaml | 25 +++++--
src/Semi.Avalonia/Controls/ToggleSwitch.axaml | 68 ++++++++++++++-----
.../Themes/Dark/ToggleSwitch.axaml | 3 +
.../Themes/Light/ToggleSwitch.axaml | 3 +
.../Themes/Shared/ToggleSwitch.axaml | 2 +
5 files changed, 79 insertions(+), 22 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
index 94299c2..1a23866 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
@@ -26,9 +26,9 @@
OnContent="OnContent" />
-
+
-
+
@@ -38,9 +38,26 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml
index 8bb8bc6..0ea882c 100644
--- a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml
+++ b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml
@@ -278,29 +278,29 @@
x:Key="SimpleToggleSwitch"
BasedOn="{StaticResource {x:Type ToggleSwitch}}"
TargetType="ToggleSwitch">
+
+
+
-
+ Width="{DynamicResource ToggleSwitchDefaultWidth}"
+ Height="{DynamicResource ToggleSwitchDefaultHeight}"
+ CornerRadius="100">
+
+
+
+
+
-
-
-
-
-
-
+ ColumnDefinitions="*,*">
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml b/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml
index e087b2f..f5d6888 100644
--- a/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml
@@ -10,4 +10,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml b/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml
index f1807ce..b86d9b1 100644
--- a/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml
+++ b/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml
@@ -10,4 +10,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml b/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml
index 56a0b72..eaa89b4 100644
--- a/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml
@@ -19,4 +19,6 @@
8 4
8 4
+
+ 14
\ No newline at end of file
From 4c122cc3e9a4b2a5245c58a8bcf534eaeb193ae0 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 7 Aug 2024 12:06:13 +0800
Subject: [PATCH 18/25] feat: update Default AdornerLayer style.
(cherry picked from commit 5644cf59dc72257648c02c933b91a368204f9d1d)
---
src/Semi.Avalonia/Controls/AdornerLayer.axaml | 7 ++-----
src/Semi.Avalonia/Controls/CheckBox.axaml | 1 +
src/Semi.Avalonia/Controls/RadioButton.axaml | 6 +++++-
src/Semi.Avalonia/Themes/Dark/AdornerLayer.axaml | 2 +-
src/Semi.Avalonia/Themes/Light/AdornerLayer.axaml | 2 +-
src/Semi.Avalonia/Themes/Shared/AdornerLayer.axaml | 3 +--
6 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/Semi.Avalonia/Controls/AdornerLayer.axaml b/src/Semi.Avalonia/Controls/AdornerLayer.axaml
index 1093deb..03a7694 100644
--- a/src/Semi.Avalonia/Controls/AdornerLayer.axaml
+++ b/src/Semi.Avalonia/Controls/AdornerLayer.axaml
@@ -5,11 +5,8 @@
-
+
diff --git a/src/Semi.Avalonia/Controls/CheckBox.axaml b/src/Semi.Avalonia/Controls/CheckBox.axaml
index 8a26fc9..450b88c 100644
--- a/src/Semi.Avalonia/Controls/CheckBox.axaml
+++ b/src/Semi.Avalonia/Controls/CheckBox.axaml
@@ -26,6 +26,7 @@
-
+
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/AdornerLayer.axaml b/src/Semi.Avalonia/Themes/Light/AdornerLayer.axaml
index 9cd5cb5..5060345 100644
--- a/src/Semi.Avalonia/Themes/Light/AdornerLayer.axaml
+++ b/src/Semi.Avalonia/Themes/Light/AdornerLayer.axaml
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/AdornerLayer.axaml b/src/Semi.Avalonia/Themes/Shared/AdornerLayer.axaml
index b570b21..a5119bf 100644
--- a/src/Semi.Avalonia/Themes/Shared/AdornerLayer.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/AdornerLayer.axaml
@@ -1,4 +1,3 @@
- 1
- 1
+ 2
\ No newline at end of file
From 33e45100977bb51490093dd4f4b1347dc064d0ef Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 7 Aug 2024 12:07:56 +0800
Subject: [PATCH 19/25] feat: update ToggleSwitch AdornerLayer.
(cherry picked from commit 3849d7efebe1089b6978710c3d4f28e5cdc55e5c)
---
src/Semi.Avalonia/Controls/ToggleSwitch.axaml | 193 +++++++++---------
1 file changed, 99 insertions(+), 94 deletions(-)
diff --git a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml
index 0ea882c..f495b36 100644
--- a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml
+++ b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml
@@ -15,6 +15,13 @@
+
+
+
+
+
+ RowDefinitions="Auto,*"
+ ColumnDefinitions="Auto, *">
-
-
-
-
-
-
-
-
-
+ Margin="{DynamicResource ToggleSwitchIndicatorDefaultMargin}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
@@ -241,6 +240,12 @@
+
+
+
+
+
-
-
-
+
+
+
-
+
From c725362d163c766689070081971e522ca86f5c91 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Fri, 30 Aug 2024 16:00:58 +0800
Subject: [PATCH 20/25] fix: remove MenuFlyoutPadding.
(cherry picked from commit 4bd73119acf46137eda3b088686f32cafb2ac97b)
---
src/Semi.Avalonia/Controls/Menu.axaml | 144 ++++++++++--------
.../Controls/MenuFlyoutPresenter.axaml | 21 ++-
src/Semi.Avalonia/Themes/Shared/Menu.axaml | 2 +-
3 files changed, 96 insertions(+), 71 deletions(-)
diff --git a/src/Semi.Avalonia/Controls/Menu.axaml b/src/Semi.Avalonia/Controls/Menu.axaml
index dddc916..ab16440 100644
--- a/src/Semi.Avalonia/Controls/Menu.axaml
+++ b/src/Semi.Avalonia/Controls/Menu.axaml
@@ -10,73 +10,83 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Controls/MenuFlyoutPresenter.axaml b/src/Semi.Avalonia/Controls/MenuFlyoutPresenter.axaml
index 71bbba5..c727b68 100644
--- a/src/Semi.Avalonia/Controls/MenuFlyoutPresenter.axaml
+++ b/src/Semi.Avalonia/Controls/MenuFlyoutPresenter.axaml
@@ -2,7 +2,21 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -23,12 +37,13 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
- ClipToBounds="False"
+ ClipToBounds="True"
CornerRadius="{TemplateBinding CornerRadius}"
UseLayoutRounding="False">
M7.43934 19.7957C6.85355 19.2099 6.85355 18.2601 7.43934 17.6744L13.0962 12.0175L7.43934 6.36065C6.85355 5.77486 6.85355 4.82511 7.43934 4.23933C8.02513 3.65354 8.97487 3.65354 9.56066 4.23933L16.2782 10.9568C16.864 11.5426 16.864 12.4924 16.2782 13.0782L9.56066 19.7957C8.97487 20.3815 8.02513 20.3815 7.43934 19.7957Z
1
- 8
+ 0
6
16
100
From f6a7cdbda298eb402131eca8b6ea74e851de10ff Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Fri, 30 Aug 2024 16:06:26 +0800
Subject: [PATCH 21/25] feat: set corners for scrollviewer.
(cherry picked from commit 52a25d8441dec2472a2aaa1ad958ba0f19ac2188)
---
src/Semi.Avalonia/Controls/ContextMenu.axaml | 2 +-
src/Semi.Avalonia/Controls/Menu.axaml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/Semi.Avalonia/Controls/ContextMenu.axaml b/src/Semi.Avalonia/Controls/ContextMenu.axaml
index 433707a..e3b2bbb 100644
--- a/src/Semi.Avalonia/Controls/ContextMenu.axaml
+++ b/src/Semi.Avalonia/Controls/ContextMenu.axaml
@@ -26,7 +26,7 @@
BorderThickness="{TemplateBinding BorderThickness}"
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
CornerRadius="{TemplateBinding CornerRadius}">
-
+
-
+
-
+
Date: Thu, 29 Aug 2024 16:12:19 +0800
Subject: [PATCH 22/25] feat: update NonErrorTextBox.
---
src/Semi.Avalonia/Controls/TextBox.axaml | 181 +++++++++++++++++------
1 file changed, 134 insertions(+), 47 deletions(-)
diff --git a/src/Semi.Avalonia/Controls/TextBox.axaml b/src/Semi.Avalonia/Controls/TextBox.axaml
index 7779d5b..b4bfebb 100644
--- a/src/Semi.Avalonia/Controls/TextBox.axaml
+++ b/src/Semi.Avalonia/Controls/TextBox.axaml
@@ -24,35 +24,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -103,8 +74,8 @@
TextWrapping="{TemplateBinding TextWrapping}">
-
-
+
+
@@ -121,8 +92,7 @@
SelectionEnd="{TemplateBinding SelectionEnd}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
SelectionStart="{TemplateBinding SelectionStart}"
- Text="{TemplateBinding Text,
- Mode=TwoWay}"
+ Text="{TemplateBinding Text, Mode=TwoWay}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" />
@@ -138,8 +108,7 @@
Name="PART_RevealButton"
Grid.Column="3"
Margin="4,0,0,0"
- IsChecked="{TemplateBinding RevealPassword,
- Mode=TwoWay}"
+ IsChecked="{TemplateBinding RevealPassword, Mode=TwoWay}"
IsVisible="False"
Theme="{StaticResource InputToggleButton}" />
-
+
@@ -282,7 +251,7 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
-
+
+ TextWrapping="{TemplateBinding TextWrapping}">
+
+
+
+
+
+
+
+
+
+
@@ -367,5 +361,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 6a520293052c364933474ab1eab6e68c06d810ac Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Sun, 18 Aug 2024 17:51:59 +0800
Subject: [PATCH 23/25] feat: upgrade DRM project to net8.
(cherry picked from commit e9f74ef3ed9e5153c9339a6c3e7141244909f007)
---
demo/Semi.Avalonia.Demo.Drm/Program.cs | 5 +-
demo/Semi.Avalonia.Demo.Drm/Roots.xml | 3 ++
.../Semi.Avalonia.Demo.Drm.csproj | 47 ++++++++++++-------
3 files changed, 38 insertions(+), 17 deletions(-)
create mode 100644 demo/Semi.Avalonia.Demo.Drm/Roots.xml
diff --git a/demo/Semi.Avalonia.Demo.Drm/Program.cs b/demo/Semi.Avalonia.Demo.Drm/Program.cs
index c690e85..5a7662f 100644
--- a/demo/Semi.Avalonia.Demo.Drm/Program.cs
+++ b/demo/Semi.Avalonia.Demo.Drm/Program.cs
@@ -3,6 +3,7 @@ using System.Globalization;
using System.Linq;
using System.Threading;
using Avalonia;
+using Avalonia.Dialogs;
namespace Semi.Avalonia.Demo.Drm;
@@ -28,7 +29,7 @@ class Program
if (args.Contains("--drm"))
{
SilenceConsole();
- return builder.StartLinuxDrm(args: args, card: "/dev/dri/card1", scaling: GetScaling());
+ return builder.StartLinuxDrm(args, scaling: GetScaling());
}
return builder.StartWithClassicDesktopLifetime(args);
@@ -37,7 +38,9 @@ class Program
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure()
+ .UseManagedSystemDialogs()
.UsePlatformDetect()
+ .With(new Win32PlatformOptions())
.LogToTrace();
private static void SilenceConsole()
diff --git a/demo/Semi.Avalonia.Demo.Drm/Roots.xml b/demo/Semi.Avalonia.Demo.Drm/Roots.xml
new file mode 100644
index 0000000..7e2f055
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo.Drm/Roots.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
index 7accf7a..a6db875 100644
--- a/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
+++ b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
@@ -1,22 +1,37 @@
-
- WinExe
- net7.0
- enable
- true
- app.manifest
-
+
+ WinExe
+ net8.0
+ enable
+ true
+
+
+
+
+ true
+ true
+
-
-
-
-
-
-
+
+ app.manifest
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
From 181395274780a3ebfd2dd765f75c37d4bbbade84 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Sun, 18 Aug 2024 19:42:07 +0800
Subject: [PATCH 24/25] feat: update DRM README docs.
(cherry picked from commit 67ddbc1598c13ee6ea43582093382d6e1a245206)
---
demo/Semi.Avalonia.Demo.Drm/README.md | 162 +++++++++++++++++++++++
demo/Semi.Avalonia.Demo.Drm/README_CN.md | 162 +++++++++++++++++++++++
demo/Semi.Avalonia.Demo.Drm/使用方法.md | 77 -----------
3 files changed, 324 insertions(+), 77 deletions(-)
create mode 100644 demo/Semi.Avalonia.Demo.Drm/README.md
create mode 100644 demo/Semi.Avalonia.Demo.Drm/README_CN.md
delete mode 100644 demo/Semi.Avalonia.Demo.Drm/使用方法.md
diff --git a/demo/Semi.Avalonia.Demo.Drm/README.md b/demo/Semi.Avalonia.Demo.Drm/README.md
new file mode 100644
index 0000000..0990a36
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo.Drm/README.md
@@ -0,0 +1,162 @@
+# DRM Start Steps
+
+[中文](README_CN.md)
+
+(Ubuntu 20.04 live server linux-x64 Virtual Machine Test Success)
+(Orange Pi Zero2 Ubuntu20.04-arm64 Test Success)
+
+[Avalonia Official Reference Document](https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm)
+
+## Setup Running Environment
+
+1. Run the following commands on the Linux side
+```bash
+sudo apt update
+sudo apt upgrade
+sudo reboot
+sudo apt-get install libgbm1 libgl1-mesa-dri libegl1-mesa libinput10
+```
+
+2. Install the test tool (if a colored cube appears, the environment is installed)
+```bash
+sudo apt-get install kmscube
+sudo kmscube
+```
+
+3. [Install .NET Runtime](https://learn.microsoft.com/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
+
+4. Add the Avalonia.LinuxFramebuffer package in NuGet
+
+```bash
+dotnet add package Avalonia.LinuxFramebuffer
+```
+
+5. Add StartLinuxDrm code
+
+```csharp
+public static int Main(string[] args)
+{
+ var builder = BuildAvaloniaApp();
+ if (args.Contains("--drm"))
+ {
+ SilenceConsole();
+ // By default, Avalonia will try to detect output card automatically.
+ // But you can specify one, for example "/dev/dri/card1".
+ return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
+ }
+
+ return builder.StartWithClassicDesktopLifetime(args);
+}
+
+private static void SilenceConsole()
+{
+ new Thread(() =>
+ {
+ Console.CursorVisible = false;
+ while (true)
+ Console.ReadKey(true);
+ })
+ { IsBackground = true }.Start();
+}
+```
+
+6. Publish the app to Linux
+
+```bash
+dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linux-x64 --sc -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
+```
+
+Add the following code to the csproj file for AOT publishing
+
+```xml
+
+ true
+ true
+
+```
+
+```bash
+dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linu-x64
+```
+
+7. Run the program
+
+```bash
+sudo ./Semi.Avalonia.Demo.Drm --drm
+```
+
+## Troubleshooting
+
+1. Error message
+
+> Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
+
+Solution:
+
+If you use the Semi release file, do not trim it, otherwise an error will occur.
+
+24.8.18 update: This issue has been fixed.
+
+2. Error message
+
+> Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.**
+ **--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
+ at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
+ at SkiaSharp.SKImageInfo..cctor()
+
+Solution:
+
+Linux CLI installation
+
+```bash
+sudo apt-get install -y libfontconfig1
+```
+[Reference](https://github.com/mono/SkiaSharp/issues/509)
+
+3. Error message
+
+> Permission denied
+
+Solution:
+
+add permission
+
+```bash
+sudo chmod +x ./Semi.Avalonia.Demo.Drm
+```
+
+4. Error message
+
+> Unhandled exception. System.ComponentModel.Win32Exception (95): drmModeGetResources failed
+at Avalonia.LinuxFramebuffer.Output.DrmResources..ctor(Int32 fd, Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 91
+at Avalonia.LinuxFramebuffer.Output.DrmCard.GetResources(Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 171
+at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String path, Boolean connectorsForceProbe, DrmOutputOptions options) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 60
+at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder builder, String[] args, String card, Double scaling, IInputBackend inputBackend) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
+at Semi.Avalonia.Demo.Drm.Program.Main(String[] args)
+
+Solution:
+
+The `program.cs` graphics card path is incorrect, it may not be `dev/dri/card1`, see if there are other graphics cards in the `dev/dri` directory such as `card0`.
+
+24.8.18 update: Avalonia will now automatically detect the graphics card path, so you don't need to specify the graphics card path.
+
+```csharp
+return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
+```
+
+5. Error message
+>Unhandled exception. System.ComponentModel.Win32Exception (2): Couldn't open /dev/dri/card1
+at Avalonia.LinuxFramebuffer.Output.DrmCard..ctor(String ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 167
+at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String , Boolean , DrmOutputOptions ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 58
+at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder, String[], String , Double , IInputBackend ) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
+at Semi.Avalonia.Demo.Drm.Program.Main(String[])
+
+Solution:
+
+Unable to open `/dev/dri/card1`, may be the graphics card is mounted to another folder.
+
+24.8.18 update: Avalonia will now automatically detect the graphics card path, so you don't need to specify the graphics card path.
+
+```csharp
+return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
+```
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Drm/README_CN.md b/demo/Semi.Avalonia.Demo.Drm/README_CN.md
new file mode 100644
index 0000000..740d8a1
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo.Drm/README_CN.md
@@ -0,0 +1,162 @@
+# DRM启动步骤
+
+[English](README.md)
+
+(Ubuntu 20.04 live server linux-x64 虚拟机测试成功)
+(Orange Pi Zero2 Ubuntu20.04-arm64 测试成功)
+
+[Avalonia 官方参考文档](https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm)
+
+## 搭建运行环境
+
+1. Linux端运行命令
+```bash
+sudo apt update
+sudo apt upgrade
+sudo reboot
+sudo apt-get install libgbm1 libgl1-mesa-dri libegl1-mesa libinput10
+```
+
+2. 安装测试工具(出现一个彩色立方体说明环境安装完成)
+```bash
+sudo apt-get install kmscube
+sudo kmscube
+```
+
+3. [安装.net运行时](https://learn.microsoft.com/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
+
+4. NuGet里面添加Avalonia.LinuxFramebuffer包
+
+```bash
+dotnet add package Avalonia.LinuxFramebuffer
+```
+
+5. 添加StartLinuxDrm代码
+
+```csharp
+public static int Main(string[] args)
+{
+ var builder = BuildAvaloniaApp();
+ if (args.Contains("--drm"))
+ {
+ SilenceConsole();
+ // By default, Avalonia will try to detect output card automatically.
+ // But you can specify one, for example "/dev/dri/card1".
+ return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
+ }
+
+ return builder.StartWithClassicDesktopLifetime(args);
+}
+
+private static void SilenceConsole()
+{
+ new Thread(() =>
+ {
+ Console.CursorVisible = false;
+ while (true)
+ Console.ReadKey(true);
+ })
+ { IsBackground = true }.Start();
+}
+```
+
+6. 发布程序到Linux
+
+```bash
+dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linux-x64 --sc -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
+```
+
+AOT发布需要在csproj文件中添加以下代码
+
+```xml
+
+ true
+ true
+
+```
+
+```bash
+dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linu-x64
+```
+
+7. 运行程序
+
+```bash
+sudo ./Semi.Avalonia.Demo.Drm --drm
+```
+
+## 报错处理
+
+1. 报错内容
+
+> Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
+
+解决方法:
+
+如果使用Semi发布文件不要裁剪,如果裁剪会报错。
+
+24.8.18更新:现在已经修复了这个问题。
+
+2. 报错内容
+
+> Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.**
+ **--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
+ at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
+ at SkiaSharp.SKImageInfo..cctor()
+
+解决方法:
+
+Linux 命令行安装
+
+```bash
+sudo apt-get install -y libfontconfig1
+```
+
+[参考网址](https://github.com/mono/SkiaSharp/issues/509)
+
+3. 报错内容
+
+> Permission denied
+
+解决方法:
+
+添加执行权限
+```bash
+sudo chmod +x ./Semi.Avalonia.Demo.Drm
+```
+
+4. 报错内容
+
+> Unhandled exception. System.ComponentModel.Win32Exception (95): drmModeGetResources failed
+at Avalonia.LinuxFramebuffer.Output.DrmResources..ctor(Int32 fd, Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 91
+at Avalonia.LinuxFramebuffer.Output.DrmCard.GetResources(Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 171
+at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String path, Boolean connectorsForceProbe, DrmOutputOptions options) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 60
+at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder builder, String[] args, String card, Double scaling, IInputBackend inputBackend) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
+at Semi.Avalonia.Demo.Drm.Program.Main(String[] args)
+
+解决方法:
+
+`program.cs`的显卡路径错误,可能不是`dev/dri/card1`,看在`dev/dri`目录下有无其他的显卡如`card0`。
+
+24.8.18更新:现在Avalonia会自动检测显卡路径,所以不需要指定显卡路径。
+
+```csharp
+return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
+```
+
+5. 报错内容
+>Unhandled exception. System.ComponentModel.Win32Exception (2): Couldn't open /dev/dri/card1
+at Avalonia.LinuxFramebuffer.Output.DrmCard..ctor(String ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 167
+at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String , Boolean , DrmOutputOptions ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 58
+at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder, String[], String , Double , IInputBackend ) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
+at Semi.Avalonia.Demo.Drm.Program.Main(String[])
+
+解决办法:
+
+找不到显卡路径`dev/dri/card1`,可能是显卡挂载到别的文件夹下了。
+
+24.8.18更新:现在Avalonia会自动检测显卡路径,所以不需要指定显卡路径。
+
+```csharp
+return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
+```
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Drm/使用方法.md b/demo/Semi.Avalonia.Demo.Drm/使用方法.md
deleted file mode 100644
index 870b6a2..0000000
--- a/demo/Semi.Avalonia.Demo.Drm/使用方法.md
+++ /dev/null
@@ -1,77 +0,0 @@
-# DRM启动步骤
-
-(Ubuntu18.04Server版本 虚拟机测试OK)
-(Orange Pi Zero2 Ubuntu20.04-arm64 测试OK)
-
-Avalonia官方参考文档:https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm
-
-1.Linux端运行命令
-```
-sudo apt update
-sudo apt upgrade
-sudo reboot
-sudo apt - get install libgbm1 libgl1 - mesa - dri libegl1 - mesa libinput10
-```
-
-2.安装测试工具测试(出现一个彩色立方体说明环境安装完成)
-```
-sudo apt-get install kmscube
-sudo kmscube
-```
-
-3.安装.net运行时(参考网址:https://learn.microsoft.com/zh-cn/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
-
-4.新建一个Avalonia项目,nuget里面添加Avalonia.LinuxFramebuffer包
-
-5.添加StartLinuxDrm代码(不知道怎么添加看Semi.Avalonia.Demo.Drm项目代码)
-
-6.发布程序到Linux(安装.net,怎么运行这些省略)
-
-7.运行 ./Semi.Avalonia.Demo.Drm --drm
-
-## 报错处理:
-
-1. 报错内容
-
->Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
-
- 解决方法:
->如果使用Semi发布文件不要裁剪,如果裁剪会报错
-
-
-2. 报错内容
->Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.**
- **--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
- at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
- at SkiaSharp.SKImageInfo..cctor()
-
-解决方法:
->Linux命令行安装一下 apt-get install -y libfontconfig1
-参考网址:https://github.com/mono/SkiaSharp/issues/509
-
-3. 报错内容
->Permission denied
-
-解决方法:
->sudo chmod +x ./Semi.Avalonia.Demo.Drm
-
-4. 报错内容
->Unhandled exception. System.ComponentModel.Win32Exception (95): drmModeGetResources failed
-at Avalonia.LinuxFramebuffer.Output.DrmResources..ctor(Int32 fd, Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 91
-at Avalonia.LinuxFramebuffer.Output.DrmCard.GetResources(Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 171
-at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String path, Boolean connectorsForceProbe, DrmOutputOptions options) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 60
-at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder builder, String[] args, String card, Double scaling, IInputBackend inputBackend) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
-at Semi.Avalonia.Demo.Drm.Program.Main(String[] args)
-
-解决方法:
->`program.cs`的显卡路径错误,可能不是`dev/dri/card1`,看在`dev/dri`目录下有无其他的显卡如`card0`。
-
-5. 报错内容
->Unhandled exception. System.ComponentModel.Win32Exception (2): Couldn't open /dev/dri/card1
-at Avalonia.LinuxFramebuffer.Output.DrmCard..ctor(String ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 167
-at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String , Boolean , DrmOutputOptions ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 58
-at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder, String[], String , Double , IInputBackend ) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
-at Semi.Avalonia.Demo.Drm.Program.Main(String[])
-
-解决办法:
->找不到显卡路径`dev/dri/card1`,可能是显卡挂载到别的文件夹下了,待解决。
\ No newline at end of file
From 71e84bfb303d2d1849b9faabda3c9048e95427d5 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 2 Sep 2024 18:02:25 +0800
Subject: [PATCH 25/25] feat: separate pack & publish action.
(cherry picked from commit 0f88c9d28d0b35ecb30b632ef63c41a453f46b23)
---
.github/workflows/pack.yml | 36 +-------
.github/workflows/publish.yml | 92 +++++++++++++++++++
.../Semi.Avalonia.Demo.Desktop.csproj | 6 +-
.../Semi.Avalonia.Demo.Drm.csproj | 6 +-
4 files changed, 101 insertions(+), 39 deletions(-)
create mode 100644 .github/workflows/publish.yml
diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml
index 5f0a4b5..7882e33 100644
--- a/.github/workflows/pack.yml
+++ b/.github/workflows/pack.yml
@@ -1,4 +1,4 @@
-name: Pack
+name: Pack Nuget
on:
push:
@@ -7,8 +7,8 @@ on:
branches: [ "action/pack" ]
jobs:
- nuget_desktop:
- runs-on: windows-latest
+ nuget:
+ runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
@@ -25,34 +25,8 @@ jobs:
- name: Nuget Semi.Avalonia.TreeDataGrid
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
- - name: Desktop
- run: dotnet publish ./demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained true
-
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
with:
- name: nuget_desktop
- path: |
- ./nugets
- ./**/publish/*.exe
-
- android:
- runs-on: windows-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v4.1.1
-
- - name: CD Android
- run: cd ./demo/Semi.Avalonia.Demo.Android
-
- - name: Restore Dependencies
- run: dotnet restore
-
- - name: Build
- run: dotnet publish ./demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore
-
- - name: Upload a Build Artifact
- uses: actions/upload-artifact@v4.3.1
- with:
- name: android
- path: ./**/publish/*Signed.apk
+ name: nugets
+ path: ./nugets
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..81e01be
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,92 @@
+name: Publish Demo
+
+on:
+ push:
+ branches: [ "action/publish" ]
+ pull_request:
+ branches: [ "action/publish" ]
+
+jobs:
+ windows:
+ runs-on: windows-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4.1.1
+
+ - name: Make upload directory
+ run: mkdir upload
+
+ - name: Publish win-x64
+ run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/win64
+
+ - name: Zip win-x64
+ run: |
+ $files = Get-ChildItem -Path ./publish/win64/* -Recurse -Exclude *.pdb
+ Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
+
+ - name: Enable Native AOT in .csproj
+ run: |
+ sed -i 's##true#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
+ sed -i 's##true#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
+
+ - name: Publish win-x64 AOT
+ run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
+
+ - name: Zip win-x64 AOT
+ run: |
+ $files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
+ Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
+
+ - name: Upload a Build Artifact
+ uses: actions/upload-artifact@v4.3.1
+ with:
+ name: windows
+ path: ./upload
+
+ linux:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4.1.1
+
+ - name: Make upload directory
+ run: mkdir upload
+
+ - name: Publish linux-x64
+ run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/linux64
+
+ - name: Zip linux-x64
+ run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
+
+ - name: Publish linux-x64 DRM
+ run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/drm
+
+ - name: Zip linux-x64 DRM
+ run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
+
+ - name: Upload a Build Artifact
+ uses: actions/upload-artifact@v4.3.1
+ with:
+ name: linux
+ path: ./upload
+
+ android:
+ runs-on: windows-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4.1.1
+
+ - name: CD Android
+ run: cd ./demo/Semi.Avalonia.Demo.Android
+
+ - name: Restore Dependencies
+ run: dotnet restore
+
+ - name: Publish Android
+ run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore -o ./publish
+
+ - name: Upload a Build Artifact
+ uses: actions/upload-artifact@v4.3.1
+ with:
+ name: android
+ path: ./publish/*Signed.apk
diff --git a/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj b/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
index d5a8648..d697ebd 100644
--- a/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
+++ b/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
@@ -5,10 +5,8 @@
enable
true
-
+
+
diff --git a/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
index a6db875..2671f20 100644
--- a/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
+++ b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
@@ -5,10 +5,8 @@
enable
true
-
+
+