From f7bcfb872d4a70d90ff09302b088c72cb3ada333 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Sun, 4 Jun 2023 00:21:10 +0800 Subject: [PATCH 01/36] fix: fix combobox selected background. --- src/Semi.Avalonia/Themes/Dark/ComboBox.axaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml index fd8b363..fdcb458 100644 --- a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml +++ b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml @@ -29,8 +29,8 @@ - - + + From 7a040120b5044361a636e2519c5ee708fd08e016 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Mon, 5 Jun 2023 22:47:00 +0800 Subject: [PATCH 02/36] feat: adjust CheckBox Border style. --- src/Semi.Avalonia/Controls/CheckBox.axaml | 89 +++++++++---------- src/Semi.Avalonia/Controls/RadioButton.axaml | 4 + .../Themes/Dark/RadioButton.axaml | 3 + .../Themes/Light/RadioButton.axaml | 3 + 4 files changed, 52 insertions(+), 47 deletions(-) diff --git a/src/Semi.Avalonia/Controls/CheckBox.axaml b/src/Semi.Avalonia/Controls/CheckBox.axaml index 5bcbe3c..9e0fcaf 100644 --- a/src/Semi.Avalonia/Controls/CheckBox.axaml +++ b/src/Semi.Avalonia/Controls/CheckBox.axaml @@ -4,11 +4,11 @@ x:CompileBindings="True"> - - + + + - @@ -17,50 +17,45 @@ - - - - - - - + + + + + + + - - + @@ -461,4 +456,4 @@ - + \ No newline at end of file diff --git a/src/Semi.Avalonia/Controls/RadioButton.axaml b/src/Semi.Avalonia/Controls/RadioButton.axaml index 289bfd6..e351271 100644 --- a/src/Semi.Avalonia/Controls/RadioButton.axaml +++ b/src/Semi.Avalonia/Controls/RadioButton.axaml @@ -24,6 +24,10 @@ + + + + + + + 3 diff --git a/src/Semi.Avalonia/Themes/Light/RadioButton.axaml b/src/Semi.Avalonia/Themes/Light/RadioButton.axaml index 394d58b..e766323 100644 --- a/src/Semi.Avalonia/Themes/Light/RadioButton.axaml +++ b/src/Semi.Avalonia/Themes/Light/RadioButton.axaml @@ -32,6 +32,9 @@ + + + 3 From 5021ac683bbee3f3470708a2c5ac9f5a8d8726bb Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Tue, 6 Jun 2023 16:33:27 +0800 Subject: [PATCH 03/36] feat: add demo. --- demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml | 6 +++++- demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml index b7ef18f..739bc24 100644 --- a/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml @@ -8,7 +8,11 @@ d:DesignWidth="800" mc:Ignorable="d"> - + + + Border + + Unchecked diff --git a/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml index 59814fc..8859d09 100644 --- a/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml @@ -7,6 +7,10 @@ mc:Ignorable="d"> + + Border + + Unchecked @@ -118,7 +122,7 @@ Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 - Date: Tue, 6 Jun 2023 16:43:45 +0800 Subject: [PATCH 04/36] feat: add SimpleCheckBox theme. --- .../Pages/CheckBoxDemo.axaml | 16 +- src/Semi.Avalonia/Controls/CheckBox.axaml | 149 ++++++++++++++++++ 2 files changed, 164 insertions(+), 1 deletion(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml index 739bc24..179e3dc 100644 --- a/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml @@ -8,10 +8,12 @@ d:DesignWidth="800" mc:Ignorable="d"> - + Border + @@ -30,6 +32,18 @@ Checkbox should wrap its text + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Controls/CheckBox.axaml b/src/Semi.Avalonia/Controls/CheckBox.axaml index 9e0fcaf..5818ddf 100644 --- a/src/Semi.Avalonia/Controls/CheckBox.axaml +++ b/src/Semi.Avalonia/Controls/CheckBox.axaml @@ -173,6 +173,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From f949793e100a0e5c717c8eda7be3d57903961174 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Wed, 7 Jun 2023 21:50:21 +0800 Subject: [PATCH 05/36] feat: remove redundant proj file reference. --- .../Semi.Avalonia.Demo.csproj | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj b/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj index 551fe03..8b1e2c3 100644 --- a/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj +++ b/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj @@ -18,29 +18,6 @@ - - - - - - - - - - - - - - - - - - - - - - - From 7a6ce6f07ecb5ee1064d9be4b071cfcc29681486 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Wed, 7 Jun 2023 22:07:55 +0800 Subject: [PATCH 06/36] misc: remove unnecessary demo. --- .../Pages/CheckBoxDemo.axaml | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml index 179e3dc..204599d 100644 --- a/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml @@ -9,12 +9,6 @@ mc:Ignorable="d"> - - Border - - - Unchecked @@ -35,14 +29,23 @@ - - + + - - - + + + From 5df262bc6dc4e00c5cb754dfcf8d3391f9098ea3 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Wed, 7 Jun 2023 22:10:04 +0800 Subject: [PATCH 07/36] misc: remove radio button demo. --- .../Pages/RadioButtonDemo.axaml | 75 ++++++++++++------- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml index 8859d09..f884c40 100644 --- a/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml @@ -7,10 +7,6 @@ mc:Ignorable="d"> - - Border - - Unchecked @@ -27,25 +23,28 @@ 小1 + IsChecked="True" + Theme="{DynamicResource ButtonRadioButton}"> 小2 - + + IsEnabled="False" + Theme="{DynamicResource ButtonRadioButton}"> 小1 + IsEnabled="False" + Theme="{DynamicResource ButtonRadioButton}"> 小2 @@ -55,16 +54,19 @@ 默认1 - 默认2 + 默认2 - + - 默认1 + 默认1 + Theme="{DynamicResource ButtonRadioButton}"> 默认2 @@ -76,25 +78,28 @@ 大1 + IsChecked="True" + Theme="{DynamicResource ButtonRadioButton}"> 大2 - + + IsEnabled="False" + Theme="{DynamicResource ButtonRadioButton}"> 大1 + IsEnabled="False" + Theme="{DynamicResource ButtonRadioButton}"> 大2 @@ -108,7 +113,10 @@ Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 - + 单选框标题 Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 @@ -116,16 +124,19 @@ - + 单选框标题 Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 单选框标题 @@ -141,7 +152,10 @@ Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 - + 单选框标题 Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 @@ -149,16 +163,19 @@ - + 单选框标题 Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 单选框标题 From 793c2b273faaa5bb6d129337a1d0720d18971c6e Mon Sep 17 00:00:00 2001 From: rabbitism Date: Sat, 1 Jul 2023 19:51:33 +0800 Subject: [PATCH 08/36] feat: upgrade to rc2.1 --- demo/Directory.Build.props | 2 +- .../SplashActivity.cs | 2 +- src/Package.props | 2 +- src/Semi.Avalonia/Controls/ToggleSwitch.axaml | 20 ++++++++----------- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/demo/Directory.Build.props b/demo/Directory.Build.props index 5a014d1..3571677 100644 --- a/demo/Directory.Build.props +++ b/demo/Directory.Build.props @@ -1,6 +1,6 @@ enable - 11.0.0-rc1.1 + 11.0.0-rc2.1 diff --git a/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs b/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs index d5b8f09..3186324 100644 --- a/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs +++ b/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs @@ -7,7 +7,7 @@ using Application = Android.App.Application; namespace Semi.Avalonia.Demo.Android; [Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)] -public class SplashActivity: AvaloniaSplashActivity +public class SplashActivity: AvaloniaMainActivity { protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) { diff --git a/src/Package.props b/src/Package.props index 0143a6e..b2191b8 100644 --- a/src/Package.props +++ b/src/Package.props @@ -7,7 +7,7 @@ IRIHI Technology Avalonia Theme inspired by Semi Design. https://github.com/irihitech/Semi.Avalonia - 11.0.0-rc1.1 + 11.0.0-rc2.1 MIT \ No newline at end of file diff --git a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml index d74a28b..47e8744 100644 --- a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml +++ b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml @@ -15,6 +15,14 @@ + + + + + - - - From 8bdfe2b7de7aab5139e2ab41a38d86e959c25d5d Mon Sep 17 00:00:00 2001 From: rabbitism Date: Sat, 1 Jul 2023 21:21:54 +0800 Subject: [PATCH 10/36] fix: remove invalid fontsize resource. --- src/Semi.Avalonia/Controls/ComboBox.axaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Semi.Avalonia/Controls/ComboBox.axaml b/src/Semi.Avalonia/Controls/ComboBox.axaml index 4692226..57cbb1a 100644 --- a/src/Semi.Avalonia/Controls/ComboBox.axaml +++ b/src/Semi.Avalonia/Controls/ComboBox.axaml @@ -40,8 +40,6 @@ - - @@ -50,8 +48,8 @@ x:Name="Background" Grid.Column="0" Grid.ColumnSpan="2" - MinHeight="{DynamicResource ComboBoxDefaultHeight}" MinWidth="{DynamicResource ComboBoxThemeMinWidth}" + MinHeight="{DynamicResource ComboBoxDefaultHeight}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" @@ -63,7 +61,8 @@ HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Foreground="{TemplateBinding Foreground}" - IsVisible="{TemplateBinding SelectionBoxItem,Converter={x:Static ObjectConverters.IsNull}}" + IsVisible="{TemplateBinding SelectionBoxItem, + Converter={x:Static ObjectConverters.IsNull}}" Opacity="0.3" Text="{TemplateBinding PlaceholderText}" /> - + Date: Mon, 3 Jul 2023 11:49:11 +0800 Subject: [PATCH 11/36] feat: add progress ring. --- .../Pages/ProgressBarDemo.axaml | 17 +++- src/Semi.Avalonia/Controls/ProgressBar.axaml | 83 +++++++++++++++++++ .../Converters/PositionToAngleConverter.cs | 27 ++++++ 3 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 src/Semi.Avalonia/Converters/PositionToAngleConverter.cs diff --git a/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml index 8148e2e..71d6b2d 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml @@ -8,12 +8,27 @@ d:DesignWidth="800" mc:Ignorable="d"> + + + Value="{Binding #slider.Value}" /> @@ -326,4 +327,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Converters/PositionToAngleConverter.cs b/src/Semi.Avalonia/Converters/PositionToAngleConverter.cs new file mode 100644 index 0000000..1fd9f7a --- /dev/null +++ b/src/Semi.Avalonia/Converters/PositionToAngleConverter.cs @@ -0,0 +1,27 @@ +using System; +using System.Globalization; +using Avalonia.Data.Converters; + +namespace Semi.Avalonia.Converters; + +public class PositionToAngleConverter: IValueConverter +{ + public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + { + if (value is double d) + { + return d * 3.6; + } + + return 0; + } + + public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) + { + if (value is double d) + { + return d / 3.6; + } + return 0; + } +} \ No newline at end of file From 93071d37153f4b59b987f3e3f6203427c3a03ed9 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Mon, 3 Jul 2023 11:50:40 +0800 Subject: [PATCH 12/36] feat: add color styles. --- src/Semi.Avalonia/Controls/ProgressBar.axaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Semi.Avalonia/Controls/ProgressBar.axaml b/src/Semi.Avalonia/Controls/ProgressBar.axaml index ba7e4cd..c3ad589 100644 --- a/src/Semi.Avalonia/Controls/ProgressBar.axaml +++ b/src/Semi.Avalonia/Controls/ProgressBar.axaml @@ -386,6 +386,15 @@ + + + From ae237f38fb12bda96ee96c86838614319db24cc2 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Mon, 3 Jul 2023 11:59:42 +0800 Subject: [PATCH 13/36] fix: fix text visibility. --- src/Semi.Avalonia/Controls/ProgressBar.axaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Semi.Avalonia/Controls/ProgressBar.axaml b/src/Semi.Avalonia/Controls/ProgressBar.axaml index c3ad589..0cefad4 100644 --- a/src/Semi.Avalonia/Controls/ProgressBar.axaml +++ b/src/Semi.Avalonia/Controls/ProgressBar.axaml @@ -372,7 +372,8 @@ HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="{DynamicResource ProgressBarTextFontWeight}" - Foreground="{DynamicResource ProgressBarTextForeground}"> + Foreground="{DynamicResource ProgressBarTextForeground}" + IsVisible="{TemplateBinding ShowProgressText}"> From 7e1376f57ea66551020b0cbc753df94f1f761da8 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Mon, 3 Jul 2023 16:28:00 +0800 Subject: [PATCH 14/36] fix: fix default ProgressBar background color. --- src/Semi.Avalonia/Themes/Light/ProgressBar.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml b/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml index 7af4b8d..fc25fa7 100644 --- a/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml +++ b/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml @@ -2,7 +2,7 @@ 3 - + From 7a701a9c04b642bd69f3af0f247f9d48d816d6fc Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Mon, 3 Jul 2023 16:28:29 +0800 Subject: [PATCH 15/36] feat: add Primary, Secondary, Tertiary color. --- .../Pages/ProgressBarDemo.axaml | 238 ++++++++++-------- src/Semi.Avalonia/Controls/ProgressBar.axaml | 30 ++- .../Themes/Dark/ProgressBar.axaml | 3 + .../Themes/Light/ProgressBar.axaml | 3 + 4 files changed, 164 insertions(+), 110 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml index 71d6b2d..77d164b 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml @@ -7,129 +7,159 @@ d:DesignHeight="800" d:DesignWidth="800" mc:Ignorable="d"> - - - - - - - - - - + + + + + + + + + + + + + + + + + + + Value="60" /> - + Value="60" /> + ShowProgressText="True" + Value="60" /> + + + - - - - - - + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Controls/ProgressBar.axaml b/src/Semi.Avalonia/Controls/ProgressBar.axaml index 0cefad4..c976c42 100644 --- a/src/Semi.Avalonia/Controls/ProgressBar.axaml +++ b/src/Semi.Avalonia/Controls/ProgressBar.axaml @@ -170,15 +170,24 @@ + + + + - + + + - diff --git a/src/Semi.Avalonia/Themes/Dark/ProgressBar.axaml b/src/Semi.Avalonia/Themes/Dark/ProgressBar.axaml index 10e2057..9500752 100644 --- a/src/Semi.Avalonia/Themes/Dark/ProgressBar.axaml +++ b/src/Semi.Avalonia/Themes/Dark/ProgressBar.axaml @@ -7,6 +7,9 @@ 600 + + + diff --git a/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml b/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml index fc25fa7..fb388c7 100644 --- a/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml +++ b/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml @@ -7,6 +7,9 @@ 600 + + + From 14c2ff6c027ebdebf68c65a9f13909bcaaecd0ca Mon Sep 17 00:00:00 2001 From: rabbitism Date: Mon, 3 Jul 2023 17:13:01 +0800 Subject: [PATCH 16/36] feat: update ScrollBar visual styles. --- src/Semi.Avalonia/Controls/ScrollViewer.axaml | 111 ++++++++++-------- .../Themes/Dark/ScrollViewer.axaml | 13 +- .../Themes/Light/ScrollViewer.axaml | 12 +- 3 files changed, 79 insertions(+), 57 deletions(-) diff --git a/src/Semi.Avalonia/Controls/ScrollViewer.axaml b/src/Semi.Avalonia/Controls/ScrollViewer.axaml index 9bda75f..dd5d3a8 100644 --- a/src/Semi.Avalonia/Controls/ScrollViewer.axaml +++ b/src/Semi.Avalonia/Controls/ScrollViewer.axaml @@ -21,6 +21,22 @@ + + + + + + + + + + + + - - - - - - - diff --git a/src/Semi.Avalonia/Themes/Dark/ScrollViewer.axaml b/src/Semi.Avalonia/Themes/Dark/ScrollViewer.axaml index 6031cb6..55342d4 100644 --- a/src/Semi.Avalonia/Themes/Dark/ScrollViewer.axaml +++ b/src/Semi.Avalonia/Themes/Dark/ScrollViewer.axaml @@ -2,11 +2,16 @@ xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=System.Runtime"> - 12 - 8 + 14 + 10 - - + + + M16.3176 6.95628V17.0878C16.3176 17.4871 15.8725 17.7253 15.5402 17.5038L7.94161 12.438C7.64474 12.2401 7.64474 11.8039 7.94161 11.606L15.5402 6.54025C15.8725 6.31873 16.3176 6.55693 16.3176 6.95628Z + M9 17.0657V6.93425C9 6.5349 9.44507 6.29671 9.77735 6.51823L17.376 11.584C17.6728 11.7819 17.6728 12.2181 17.376 12.416L9.77735 17.4818C9.44507 17.7033 9 17.4651 9 17.0657Z + M17.0839 16.3212H6.9524C6.55305 16.3212 6.31486 15.8761 6.53638 15.5438L11.6021 7.94521C11.8 7.64834 12.2363 7.64834 12.4342 7.94521L17.4999 15.5438C17.7214 15.8761 17.4832 16.3212 17.0839 16.3212Z + M6.95249 7.72265L17.084 7.72265C17.4833 7.72265 17.7215 8.16772 17.5 8.5L12.4343 16.0986C12.2363 16.3955 11.8001 16.3955 11.6022 16.0986L6.53647 8.5C6.31495 8.16772 6.55315 7.72265 6.95249 7.72265Z + diff --git a/src/Semi.Avalonia/Themes/Light/ScrollViewer.axaml b/src/Semi.Avalonia/Themes/Light/ScrollViewer.axaml index 001ccc5..1da1c90 100644 --- a/src/Semi.Avalonia/Themes/Light/ScrollViewer.axaml +++ b/src/Semi.Avalonia/Themes/Light/ScrollViewer.axaml @@ -2,11 +2,15 @@ xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=System.Runtime"> - 12 - 8 + 14 + 10 - - + + + M16.3176 6.95628V17.0878C16.3176 17.4871 15.8725 17.7253 15.5402 17.5038L7.94161 12.438C7.64474 12.2401 7.64474 11.8039 7.94161 11.606L15.5402 6.54025C15.8725 6.31873 16.3176 6.55693 16.3176 6.95628Z + M9 17.0657V6.93425C9 6.5349 9.44507 6.29671 9.77735 6.51823L17.376 11.584C17.6728 11.7819 17.6728 12.2181 17.376 12.416L9.77735 17.4818C9.44507 17.7033 9 17.4651 9 17.0657Z + M17.0839 16.3212H6.9524C6.55305 16.3212 6.31486 15.8761 6.53638 15.5438L11.6021 7.94521C11.8 7.64834 12.2363 7.64834 12.4342 7.94521L17.4999 15.5438C17.7214 15.8761 17.4832 16.3212 17.0839 16.3212Z + M6.95249 7.72265L17.084 7.72265C17.4833 7.72265 17.7215 8.16772 17.5 8.5L12.4343 16.0986C12.2363 16.3955 11.8001 16.3955 11.6022 16.0986L6.53647 8.5C6.31495 8.16772 6.55315 7.72265 6.95249 7.72265Z From 11452fd21fad3e2621843e3781c675a09bf51179 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Mon, 3 Jul 2023 17:29:41 +0800 Subject: [PATCH 17/36] fix: fixes #208 --- src/Semi.Avalonia/Controls/TransitioningContentControl.axaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Semi.Avalonia/Controls/TransitioningContentControl.axaml b/src/Semi.Avalonia/Controls/TransitioningContentControl.axaml index 45ac8e2..fac502c 100644 --- a/src/Semi.Avalonia/Controls/TransitioningContentControl.axaml +++ b/src/Semi.Avalonia/Controls/TransitioningContentControl.axaml @@ -14,11 +14,10 @@ Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" - Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CornerRadius="{TemplateBinding CornerRadius}" /> Date: Mon, 3 Jul 2023 22:50:01 +0800 Subject: [PATCH 18/36] feat: add thumb :pointerover color. --- src/Semi.Avalonia/Controls/ScrollViewer.axaml | 5 +---- src/Semi.Avalonia/Themes/Dark/ScrollViewer.axaml | 9 +++++---- src/Semi.Avalonia/Themes/Light/ScrollViewer.axaml | 7 ++++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Semi.Avalonia/Controls/ScrollViewer.axaml b/src/Semi.Avalonia/Controls/ScrollViewer.axaml index dd5d3a8..c8b1521 100644 --- a/src/Semi.Avalonia/Controls/ScrollViewer.axaml +++ b/src/Semi.Avalonia/Controls/ScrollViewer.axaml @@ -193,10 +193,7 @@ - + From 0c21bb264fb6c25c23dd2f19d31de161cb23c07d Mon Sep 17 00:00:00 2001 From: rabbitism Date: Wed, 5 Jul 2023 18:14:18 +0800 Subject: [PATCH 20/36] feat: upgrade to v11. --- demo/Directory.Build.props | 2 +- src/Package.props | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/Directory.Build.props b/demo/Directory.Build.props index 3571677..ae8bdf5 100644 --- a/demo/Directory.Build.props +++ b/demo/Directory.Build.props @@ -1,6 +1,6 @@ enable - 11.0.0-rc2.1 + 11.0.0 diff --git a/src/Package.props b/src/Package.props index b2191b8..0dfb90c 100644 --- a/src/Package.props +++ b/src/Package.props @@ -3,11 +3,11 @@ net6.0;netstandard2.0 enable 10 - 11.0.0-rc1 + 11.0.0 IRIHI Technology Avalonia Theme inspired by Semi Design. https://github.com/irihitech/Semi.Avalonia - 11.0.0-rc2.1 + 11.0.0 MIT \ No newline at end of file From ab8dacec4bec5bb4e8d980a21b73411a92efb6a9 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Wed, 5 Jul 2023 19:01:12 +0800 Subject: [PATCH 21/36] feat: update documentation. --- README.md | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 9050702..1df0117 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Avalonia Theme inspired by Semi Design ## Installation ```bash -dotnet add package Semi.Avalonia --version 11.0.0-rc1 +dotnet add package Semi.Avalonia --version 11.0.0 ``` Include Semi Design Styles in application: @@ -23,8 +23,8 @@ That's all. DataGrid and ColorPicker are distributed in separated packages. Please install if you need. ```bash -dotnet add package Semi.Avalonia.ColorPicker --version 11.0.0-rc1 -dotnet add package Semi.Avalonia.DataGrid --version 11.0.0-rc1 +dotnet add package Semi.Avalonia.ColorPicker --version 11.0.0 +dotnet add package Semi.Avalonia.DataGrid --version 11.0.0 ``` ```xaml @@ -42,20 +42,9 @@ https://github.com/irihitech/Semi.Avalonia/releases | Semi Design Version | Avalonia Version | |:--------------------|:-----------------| -| 11.0.0-rc1 | 11.0.0-rc1.1 | -| 0.1.0-preview3 | 11.0-preview4 | -| 0.1.0-preview5.x | 11.0-preview5 | -| 0.1.0-preview6.x | 11.0-preview6 | -| 0.1.0-preview7.x | 11.0-preview7 | -| 0.1.0-preview8.x | 11.0-preview8 | - -**NOTE** - -Semi Avalonia theme is moving forward together with Avalonia preview versions now. So new feature/fixes are not backported to previous preview versions. If you need a feature/fix for outdated avalonia preview version, please raise an issue so we can do that for you. - +| 11.0.0 | 11.0.0 | ## TODO -* DataValidationErrors * FocusAdorner ## Credits From 8f5b9f6c47490caec9f5c8697f6f93517a157e8f Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Fri, 7 Jul 2023 17:21:56 +0800 Subject: [PATCH 22/36] fix: fix the wrong opacity values. --- src/Semi.Avalonia.DataGrid/Dark.axaml | 4 ++-- src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml | 2 +- src/Semi.Avalonia/Themes/Dark/Calendar.axaml | 6 +++--- src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml | 2 +- src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml | 2 +- src/Semi.Avalonia/Themes/Dark/ComboBox.axaml | 2 +- src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml | 4 ++-- src/Semi.Avalonia/Themes/Dark/Expander.axaml | 2 +- src/Semi.Avalonia/Themes/Dark/ListBox.axaml | 2 +- src/Semi.Avalonia/Themes/Dark/Menu.axaml | 4 ++-- src/Semi.Avalonia/Themes/Dark/TabItem.axaml | 2 +- src/Semi.Avalonia/Themes/Dark/TextBlock.axaml | 2 +- src/Semi.Avalonia/Themes/Dark/TreeView.axaml | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Semi.Avalonia.DataGrid/Dark.axaml b/src/Semi.Avalonia.DataGrid/Dark.axaml index ad74cb4..e8689c5 100644 --- a/src/Semi.Avalonia.DataGrid/Dark.axaml +++ b/src/Semi.Avalonia.DataGrid/Dark.axaml @@ -12,7 +12,7 @@ 1 - + 12 0 0 0 32 @@ -33,7 +33,7 @@ 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 - + diff --git a/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml b/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml index 5b19bad..96149dd 100644 --- a/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml +++ b/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml @@ -6,7 +6,7 @@ - + 3 diff --git a/src/Semi.Avalonia/Themes/Dark/Calendar.axaml b/src/Semi.Avalonia/Themes/Dark/Calendar.axaml index 934e516..a87a6b3 100644 --- a/src/Semi.Avalonia/Themes/Dark/Calendar.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Calendar.axaml @@ -9,8 +9,8 @@ 1 6 40 - - + + M16.2782 4.23933C16.864 4.82511 16.864 5.77486 16.2782 6.36065L10.6213 12.0175L16.2782 17.6744C16.864 18.2601 16.864 19.2099 16.2782 19.7957C15.6924 20.3815 14.7426 20.3815 14.1569 19.7957L7.43934 13.0782C6.85355 12.4924 6.85355 11.5426 7.43934 10.9568L14.1569 4.23933C14.7426 3.65354 15.6924 3.65354 16.2782 4.23933Z 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 @@ -44,7 +44,7 @@ - + 240 250 diff --git a/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml b/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml index a0d8a58..3c2ff1e 100644 --- a/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml +++ b/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml @@ -1,6 +1,6 @@ - + M4 20V8H20V20H4ZM2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22 2.89543 22 4V20C22 21.1046 21.1046 22 20 22H4C2.89543 22 2 21.1046 2 20V4ZM6 10.5C6 10.2239 6.22386 10 6.5 10H8.5C8.77614 10 9 10.2239 9 10.5V12.5C9 12.7761 8.77614 13 8.5 13H6.5C6.22386 13 6 12.7761 6 12.5V10.5ZM6.5 15C6.22386 15 6 15.2239 6 15.5V17.5C6 17.7761 6.22386 18 6.5 18H8.5C8.77614 18 9 17.7761 9 17.5V15.5C9 15.2239 8.77614 15 8.5 15H6.5ZM10.5 10.5C10.5 10.2239 10.7239 10 11 10H13C13.2761 10 13.5 10.2239 13.5 10.5V12.5C13.5 12.7761 13.2761 13 13 13H11C10.7239 13 10.5 12.7761 10.5 12.5V10.5ZM11 15C10.7239 15 10.5 15.2239 10.5 15.5V17.5C10.5 17.7761 10.7239 18 11 18H13C13.2761 18 13.5 17.7761 13.5 17.5V15.5C13.5 15.2239 13.2761 15 13 15H11ZM15 10.5C15 10.2239 15.2239 10 15.5 10H17.5C17.7761 10 18 10.2239 18 10.5V12.5C18 12.7761 17.7761 13 17.5 13H15.5C15.2239 13 15 12.7761 15 12.5V10.5ZM15.5 15C15.2239 15 15 15.2239 15 15.5V17.5C15 17.7761 15.2239 18 15.5 18H17.5C17.7761 18 18 17.7761 18 17.5V15.5C18 15.2239 17.7761 15 17.5 15H15.5Z diff --git a/src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml b/src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml index 6f17819..2b51f15 100644 --- a/src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml +++ b/src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml @@ -10,5 +10,5 @@ - + diff --git a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml index fdcb458..4a5cb36 100644 --- a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml +++ b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml @@ -9,7 +9,7 @@ 3 - + diff --git a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml index 83c668d..f8a3916 100644 --- a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml +++ b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml @@ -6,7 +6,7 @@ 0 3 0 6 - + @@ -27,7 +27,7 @@ - + diff --git a/src/Semi.Avalonia/Themes/Dark/Expander.axaml b/src/Semi.Avalonia/Themes/Dark/Expander.axaml index bcda685..3fa9be2 100644 --- a/src/Semi.Avalonia/Themes/Dark/Expander.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Expander.axaml @@ -5,7 +5,7 @@ - + diff --git a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml index aa73596..2bcface 100644 --- a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml +++ b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml @@ -3,7 +3,7 @@ 8 4 - + diff --git a/src/Semi.Avalonia/Themes/Dark/Menu.axaml b/src/Semi.Avalonia/Themes/Dark/Menu.axaml index 7fbf015..60e54c9 100644 --- a/src/Semi.Avalonia/Themes/Dark/Menu.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Menu.axaml @@ -7,7 +7,7 @@ M19.637 16.4369C19.0513 17.0227 18.1015 17.0227 17.5157 16.4369L11.8589 10.7801L6.20202 16.4369C5.61623 17.0227 4.66648 17.0227 4.0807 16.4369C3.49491 15.8511 3.49491 14.9014 4.0807 14.3156L10.7982 7.59809C11.384 7.01231 12.3337 7.01231 12.9195 7.59809L19.637 14.3156C20.2228 14.9014 20.2228 15.8511 19.637 16.4369Z M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z 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 - + @@ -36,7 +36,7 @@ 4 0 - + 4 0 diff --git a/src/Semi.Avalonia/Themes/Dark/TabItem.axaml b/src/Semi.Avalonia/Themes/Dark/TabItem.axaml index 05f09c4..1bd9440 100644 --- a/src/Semi.Avalonia/Themes/Dark/TabItem.axaml +++ b/src/Semi.Avalonia/Themes/Dark/TabItem.axaml @@ -5,7 +5,7 @@ - + diff --git a/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml b/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml index 9719a89..6d306af 100644 --- a/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml +++ b/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml @@ -3,7 +3,7 @@ xmlns:sys="clr-namespace:System;assembly=System.Runtime"> - + diff --git a/src/Semi.Avalonia/Themes/Dark/TreeView.axaml b/src/Semi.Avalonia/Themes/Dark/TreeView.axaml index d5d2507..8cd363b 100644 --- a/src/Semi.Avalonia/Themes/Dark/TreeView.axaml +++ b/src/Semi.Avalonia/Themes/Dark/TreeView.axaml @@ -9,7 +9,7 @@ M9.65618 3.44015L18.6322 11.2454C19.0906 11.644 19.0906 12.356 18.6322 12.7546L9.65618 20.5598C9.00895 21.1226 8 20.6629 8 19.8052V4.19475C8 3.33705 9.00895 2.87734 9.65618 3.44015Z - + From 37daceca612285f24b7d5f161d1308ab838351e0 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Sat, 8 Jul 2023 00:06:11 +0800 Subject: [PATCH 23/36] feat: fix android start activity issue. --- .../MainActivity.cs | 6 ++--- .../SplashActivity.cs | 22 ------------------- 2 files changed, 3 insertions(+), 25 deletions(-) delete mode 100644 demo/Semi.Avalonia.Demo.Android/SplashActivity.cs diff --git a/demo/Semi.Avalonia.Demo.Android/MainActivity.cs b/demo/Semi.Avalonia.Demo.Android/MainActivity.cs index 7906c4f..d037305 100644 --- a/demo/Semi.Avalonia.Demo.Android/MainActivity.cs +++ b/demo/Semi.Avalonia.Demo.Android/MainActivity.cs @@ -4,9 +4,9 @@ using Avalonia.Android; namespace Semi.Avalonia.Demo.Android; -[Activity(Label = "Semi.Avalonia.Demo.Android", Icon = "@drawable/Icon", Theme = "@style/MyTheme.NoActionBar", - LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)] -public class MainActivity : AvaloniaMainActivity +[Activity(Label = "Semi.Avalonia.Demo.Android", Icon = "@drawable/Icon", MainLauncher = true, Theme = "@style/MyTheme.NoActionBar", + LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] +public class MainActivity : AvaloniaMainActivity { } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs b/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs deleted file mode 100644 index 3186324..0000000 --- a/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Android.App; -using Android.Content; -using Avalonia; -using Avalonia.Android; -using Application = Android.App.Application; - -namespace Semi.Avalonia.Demo.Android; - -[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)] -public class SplashActivity: AvaloniaMainActivity -{ - protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) - { - return base.CustomizeAppBuilder(builder); - } - - protected override void OnResume() - { - base.OnResume(); - StartActivity(new Intent(Application.Context, typeof(MainActivity))); - } -} \ No newline at end of file From 40d179d4b4c5ff64364c67fddfc6e23869fa3cd9 Mon Sep 17 00:00:00 2001 From: ImLuJian <504439788@qq.com> Date: Sat, 8 Jul 2023 17:57:44 +0800 Subject: [PATCH 24/36] =?UTF-8?q?=E6=B7=BB=E5=8A=A0DRM=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=9C=A8VM=E8=99=9A=E6=8B=9F?= =?UTF-8?q?=E6=9C=BA=E4=B8=8A=E6=B5=8B=E8=AF=95=E4=BA=86=E4=B8=80=E4=B8=8B?= =?UTF-8?q?Ubuntu18.04=20Server=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=90=AF?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs | 5 +- demo/Semi.Avalonia.Demo.Desktop/Program.cs | 73 +++++++++++++++++-- .../Semi.Avalonia.Demo.Desktop.csproj | 1 + 3 files changed, 70 insertions(+), 9 deletions(-) diff --git a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs b/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs index e70ba74..b534e3f 100644 --- a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs +++ b/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs @@ -1,7 +1,6 @@ using Avalonia; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Markup.Xaml; -using Avalonia.Styling; using Semi.Avalonia.Demo.Views; namespace Semi.Avalonia.Demo.Desktop; @@ -16,9 +15,9 @@ public partial class App : Application public override void OnFrameworkInitializationCompleted() { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - { desktop.MainWindow = new MainWindow(); - } + else if (ApplicationLifetime is ISingleViewApplicationLifetime singleView) + singleView.MainView = new MainView(); base.OnFrameworkInitializationCompleted(); } } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Desktop/Program.cs b/demo/Semi.Avalonia.Demo.Desktop/Program.cs index d42b109..59b34db 100644 --- a/demo/Semi.Avalonia.Demo.Desktop/Program.cs +++ b/demo/Semi.Avalonia.Demo.Desktop/Program.cs @@ -1,7 +1,9 @@ -using System; -using Avalonia; +using Avalonia; using Avalonia.Dialogs; using Avalonia.Media; +using System; +using System.Linq; +using System.Threading; namespace Semi.Avalonia.Demo.Desktop; @@ -11,8 +13,10 @@ class Program // SynchronizationContext-reliant code before AppMain is called: things aren't initialized // yet and stuff might break. [STAThread] - public static void Main(string[] args) => BuildAvaloniaApp() - .With(new FontManagerOptions + public static void Main(string[] args) + { + var builder = BuildAvaloniaApp(); + builder.With(new FontManagerOptions { FontFallbacks = new[] { @@ -21,8 +25,54 @@ class Program FontFamily = new FontFamily("Microsoft YaHei") } } - }) - .StartWithClassicDesktopLifetime(args); + }); + + //DRM启动步骤(Ubuntu18.04Server版本 虚拟机测试OK) + //官方文档: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.添加StartLinuxDrm代码 + + //4.发布程序,复制到Linux系统(安装.net,怎么运行这些省略) + //发布文件不要裁剪,如果裁剪会报错 + //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), m + //ake sure to specify x:Class and include your XAML file as AvaloniaResource + + //5.运行 + + //运行报错点: + //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 + + if (args.Contains("--drm")) + { + SilenceConsole(); + builder.StartLinuxDrm(args: args, card: "/dev/dri/card0", scaling: 1); + } + else + { + builder.StartWithClassicDesktopLifetime(args); + } + } + + + // Avalonia configuration, don't remove; also used by visual designer. public static AppBuilder BuildAvaloniaApp() @@ -31,4 +81,15 @@ class Program .UsePlatformDetect() .With(new Win32PlatformOptions()) .LogToTrace(); + + private static void SilenceConsole() + { + new Thread(() => + { + Console.CursorVisible = false; + while (true) + Console.ReadKey(true); + }) + { IsBackground = true }.Start(); + } } 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 4e0ff0e..68489a2 100644 --- a/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj +++ b/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj @@ -23,6 +23,7 @@ + From 1b7c30c55756cdd044d73f373578d405913d9ab2 Mon Sep 17 00:00:00 2001 From: ImLuJian <504439788@qq.com> Date: Sun, 9 Jul 2023 09:24:41 +0800 Subject: [PATCH 25/36] =?UTF-8?q?=E6=B7=BB=E5=8A=A0DRM=E5=90=AF=E5=8A=A8de?= =?UTF-8?q?mo=E5=92=8C=E4=BD=BF=E7=94=A8=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Semi.Avalonia.sln | 7 +++ demo/Semi.Avalonia.Demo.Drm/App.axaml | 14 +++++ demo/Semi.Avalonia.Demo.Drm/App.axaml.cs | 24 ++++++++ demo/Semi.Avalonia.Demo.Drm/Program.cs | 59 +++++++++++++++++++ .../Semi.Avalonia.Demo.Drm.csproj | 22 +++++++ demo/Semi.Avalonia.Demo.Drm/app.manifest | 18 ++++++ demo/Semi.Avalonia.Demo.Drm/使用方法.txt | 46 +++++++++++++++ 7 files changed, 190 insertions(+) create mode 100644 demo/Semi.Avalonia.Demo.Drm/App.axaml create mode 100644 demo/Semi.Avalonia.Demo.Drm/App.axaml.cs create mode 100644 demo/Semi.Avalonia.Demo.Drm/Program.cs create mode 100644 demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj create mode 100644 demo/Semi.Avalonia.Demo.Drm/app.manifest create mode 100644 demo/Semi.Avalonia.Demo.Drm/使用方法.txt diff --git a/Semi.Avalonia.sln b/Semi.Avalonia.sln index a9245de..85b5a31 100644 --- a/Semi.Avalonia.sln +++ b/Semi.Avalonia.sln @@ -26,6 +26,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.ColorPicker", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Android", "demo\Semi.Avalonia.Demo.Android\Semi.Avalonia.Demo.Android.csproj", "{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Semi.Avalonia.Demo.Drm", "demo\Semi.Avalonia.Demo.Drm\Semi.Avalonia.Demo.Drm.csproj", "{86D93406-412A-4429-93B2-92AAD0407784}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -61,6 +63,10 @@ Global {0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU {0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Release|Any CPU.ActiveCfg = Release|Any CPU {0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Release|Any CPU.Build.0 = Release|Any CPU + {86D93406-412A-4429-93B2-92AAD0407784}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {86D93406-412A-4429-93B2-92AAD0407784}.Debug|Any CPU.Build.0 = Debug|Any CPU + {86D93406-412A-4429-93B2-92AAD0407784}.Release|Any CPU.ActiveCfg = Release|Any CPU + {86D93406-412A-4429-93B2-92AAD0407784}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -70,6 +76,7 @@ Global {69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0} = {43091528-9509-43CB-A003-9C5C11E96DD6} {D789AEDB-EBDF-4450-8E8E-B4A03FB257B0} = {43091528-9509-43CB-A003-9C5C11E96DD6} {0C81FC1C-5D2D-478A-9876-923A0C85EC2F} = {43091528-9509-43CB-A003-9C5C11E96DD6} + {86D93406-412A-4429-93B2-92AAD0407784} = {43091528-9509-43CB-A003-9C5C11E96DD6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7CA41ED3-2CED-40CC-AA21-28C3B42B1E86} diff --git a/demo/Semi.Avalonia.Demo.Drm/App.axaml b/demo/Semi.Avalonia.Demo.Drm/App.axaml new file mode 100644 index 0000000..40032b1 --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/App.axaml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs b/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs new file mode 100644 index 0000000..f436ee6 --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs @@ -0,0 +1,24 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; +using Semi.Avalonia.Demo.Views; + +namespace Semi.Avalonia.Demo.Drm +{ + public partial class App : Application + { + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + desktop.MainWindow = new MainWindow(); + else if (ApplicationLifetime is ISingleViewApplicationLifetime singleView) + singleView.MainView = new MainView(); + base.OnFrameworkInitializationCompleted(); + } + } +} \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Drm/Program.cs b/demo/Semi.Avalonia.Demo.Drm/Program.cs new file mode 100644 index 0000000..45d2f66 --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/Program.cs @@ -0,0 +1,59 @@ +using Avalonia; +using Avalonia.Dialogs; +using Avalonia.Media; +using System; +using System.Linq; +using System.Threading; + +namespace Semi.Avalonia.Demo.Drm +{ + internal class Program + { + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) + { + var builder = BuildAvaloniaApp(); + builder.With(new FontManagerOptions + { + FontFallbacks = new[] + { + new FontFallback + { + FontFamily = new FontFamily("Microsoft YaHei") + } + } + }); + if (args.Contains("--drm")) + { + SilenceConsole(); + builder.StartLinuxDrm(args: args, card: "/dev/dri/card0", scaling: 1); + } + else + { + builder.StartWithClassicDesktopLifetime(args); + } + } + + // 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() + { + new Thread(() => + { + Console.CursorVisible = false; + while (true) + Console.ReadKey(true); + }) + { IsBackground = true }.Start(); + } + } +} \ 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 new file mode 100644 index 0000000..e61daa9 --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj @@ -0,0 +1,22 @@ + + + WinExe + net7.0 + enable + true + app.manifest + + + + + + + + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo.Drm/app.manifest b/demo/Semi.Avalonia.Demo.Drm/app.manifest new file mode 100644 index 0000000..938919a --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo.Drm/使用方法.txt b/demo/Semi.Avalonia.Demo.Drm/使用方法.txt new file mode 100644 index 0000000..0e9445e --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/使用方法.txt @@ -0,0 +1,46 @@ +DRM启动步骤(Ubuntu18.04Server版本 虚拟机测试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), m + ake 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 \ No newline at end of file From 112d1e3dd4292c9eb6df7a33f720bcec594e4d92 Mon Sep 17 00:00:00 2001 From: ImLuJian <504439788@qq.com> Date: Sun, 9 Jul 2023 09:52:28 +0800 Subject: [PATCH 26/36] =?UTF-8?q?=E8=BF=98=E5=8E=9Fdesktop=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs | 4 +- demo/Semi.Avalonia.Demo.Desktop/Program.cs | 67 ++------------------ 2 files changed, 6 insertions(+), 65 deletions(-) diff --git a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs b/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs index b534e3f..d5fe94a 100644 --- a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs +++ b/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs @@ -15,9 +15,9 @@ public partial class App : Application public override void OnFrameworkInitializationCompleted() { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { desktop.MainWindow = new MainWindow(); - else if (ApplicationLifetime is ISingleViewApplicationLifetime singleView) - singleView.MainView = new MainView(); + } base.OnFrameworkInitializationCompleted(); } } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Desktop/Program.cs b/demo/Semi.Avalonia.Demo.Desktop/Program.cs index 59b34db..e011c45 100644 --- a/demo/Semi.Avalonia.Demo.Desktop/Program.cs +++ b/demo/Semi.Avalonia.Demo.Desktop/Program.cs @@ -13,10 +13,8 @@ class Program // SynchronizationContext-reliant code before AppMain is called: things aren't initialized // yet and stuff might break. [STAThread] - public static void Main(string[] args) - { - var builder = BuildAvaloniaApp(); - builder.With(new FontManagerOptions + public static void Main(string[] args) => BuildAvaloniaApp() + .With(new FontManagerOptions { FontFallbacks = new[] { @@ -25,54 +23,8 @@ class Program FontFamily = new FontFamily("Microsoft YaHei") } } - }); - - //DRM启动步骤(Ubuntu18.04Server版本 虚拟机测试OK) - //官方文档: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.添加StartLinuxDrm代码 - - //4.发布程序,复制到Linux系统(安装.net,怎么运行这些省略) - //发布文件不要裁剪,如果裁剪会报错 - //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), m - //ake sure to specify x:Class and include your XAML file as AvaloniaResource - - //5.运行 - - //运行报错点: - //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 - - if (args.Contains("--drm")) - { - SilenceConsole(); - builder.StartLinuxDrm(args: args, card: "/dev/dri/card0", scaling: 1); - } - else - { - builder.StartWithClassicDesktopLifetime(args); - } - } - - - + }) + .StartWithClassicDesktopLifetime(args); // Avalonia configuration, don't remove; also used by visual designer. public static AppBuilder BuildAvaloniaApp() @@ -81,15 +33,4 @@ class Program .UsePlatformDetect() .With(new Win32PlatformOptions()) .LogToTrace(); - - private static void SilenceConsole() - { - new Thread(() => - { - Console.CursorVisible = false; - while (true) - Console.ReadKey(true); - }) - { IsBackground = true }.Start(); - } } From 201610b9ab5c90e4dabae16ac66f4279dd8f51e1 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Sun, 9 Jul 2023 23:03:11 +0800 Subject: [PATCH 27/36] feat: update references. --- .../Semi.Avalonia.Demo.Desktop.csproj | 1 - demo/Semi.Avalonia.Demo.Drm/App.axaml | 13 +++++---- .../{使用方法.txt => 使用方法.md} | 27 +++++++++++-------- 3 files changed, 22 insertions(+), 19 deletions(-) rename demo/Semi.Avalonia.Demo.Drm/{使用方法.txt => 使用方法.md} (59%) 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 68489a2..4e0ff0e 100644 --- a/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj +++ b/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj @@ -23,7 +23,6 @@ - diff --git a/demo/Semi.Avalonia.Demo.Drm/App.axaml b/demo/Semi.Avalonia.Demo.Drm/App.axaml index 40032b1..d4ceb6d 100644 --- a/demo/Semi.Avalonia.Demo.Drm/App.axaml +++ b/demo/Semi.Avalonia.Demo.Drm/App.axaml @@ -2,13 +2,12 @@ x:Class="Semi.Avalonia.Demo.Drm.App" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Semi.Avalonia.Demo.Desktop" RequestedThemeVariant="Light"> - - - - - - + + + + + + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Drm/使用方法.txt b/demo/Semi.Avalonia.Demo.Drm/使用方法.md similarity index 59% rename from demo/Semi.Avalonia.Demo.Drm/使用方法.txt rename to demo/Semi.Avalonia.Demo.Drm/使用方法.md index 0e9445e..efe659a 100644 --- a/demo/Semi.Avalonia.Demo.Drm/使用方法.txt +++ b/demo/Semi.Avalonia.Demo.Drm/使用方法.md @@ -1,4 +1,7 @@ -DRM启动步骤(Ubuntu18.04Server版本 虚拟机测试OK) +# DRM启动步骤 + +(Ubuntu18.04Server版本 虚拟机测试OK) + Avalonia官方参考文档:https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm 1.Linux端运行命令 @@ -21,26 +24,28 @@ Avalonia官方参考文档:https://docs.avaloniaui.net/docs/next/guides/platfo 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 -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), m - ake 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 +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 +3. 报错内容 +>Permission denied + 解决方法: sudo chmod +x ./Semi.Avalonia.Demo.Drm \ No newline at end of file From db7f199003d74565fdb05733541750a0336f139c Mon Sep 17 00:00:00 2001 From: rabbitism Date: Sun, 9 Jul 2023 23:06:08 +0800 Subject: [PATCH 28/36] fix: fix version reference. --- demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 e61daa9..7accf7a 100644 --- a/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj +++ b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj @@ -9,10 +9,10 @@ - + - - + + From b9a16e89d6490e978aff7878be764a31fdf01aef Mon Sep 17 00:00:00 2001 From: rabbitism Date: Mon, 10 Jul 2023 00:22:02 +0800 Subject: [PATCH 29/36] feat: improve TextBlock demo. --- demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 288 +++++++++++++----- .../Pages/SelectableTextBlock.axaml | 161 ++++++++++ .../Pages/SelectableTextBlock.axaml.cs | 18 ++ .../Pages/TextBlockDemo.axaml | 224 +++++++++----- demo/Semi.Avalonia.Demo/Views/MainView.axaml | 3 + 5 files changed, 546 insertions(+), 148 deletions(-) create mode 100644 demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml create mode 100644 demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml.cs diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml index d5adc3d..86dd7d1 100644 --- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml @@ -7,77 +7,219 @@ d:DesignHeight="450" d:DesignWidth="800" mc:Ignorable="d"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + Classes + - + Secondary + Tertiary + Quaternary + Warning + Danger + Success + Mark + Code + + + + + + + + + + + + + + Classes + H1 + H2 + H3 + H4 + H5 + H6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml new file mode 100644 index 0000000..0de5617 --- /dev/null +++ b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml @@ -0,0 +1,161 @@ + + + + + + + + + Classes + - + Secondary + Tertiary + Quaternary + Warning + Danger + Success + Mark + Underline + Delete + + Text + + Secondary + + + Tertiary + + + Quaternary + + + Warning + + + Danger + + + Success + + + Default Mark + + + Underline + + + Delete + + + + + + Classes + H1 + H2 + H3 + H4 + H5 + H6 + + Header 1 + + + Header 2 + + + Header 3 + + + Header 4 + + + Header 5 + + + Header 6 + + + + + + diff --git a/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml.cs new file mode 100644 index 0000000..b4cc6d7 --- /dev/null +++ b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml.cs @@ -0,0 +1,18 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Semi.Avalonia.Demo.Pages; + +public partial class SelectableTextBlockDemo : UserControl +{ + public SelectableTextBlockDemo() + { + InitializeComponent(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } +} \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml index 7aca219..019faf5 100644 --- a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml @@ -7,82 +7,156 @@ d:DesignHeight="600" d:DesignWidth="800" mc:Ignorable="d"> - - - Styles for TextBlock - Header 1 - Header 1 - Header 1 - Header 1 - Header 1 - Header 1 + + + + + + + + Classes + - + Secondary + Tertiary + Quaternary + Warning + Danger + Success + Mark + Underline + Delete - Text - Secondary - Tertiary - Quaternary - Warning - Warning disabled - Danger - Success - Disabled - Default Mark - Underline - Delete - Underline and Delete - - - Styles for SelectableTextBlock - Header 1 - Header 1 - Header 1 - Header 1 - Header 1 - Header 1 + Text + + Secondary + + + Tertiary + + + Quaternary + + + Warning + + + Danger + + + Success + + + Default Mark + + + Underline + + + Delete + + + + + + Classes + H1 + H2 + H3 + H4 + H5 + H6 + + Header 1 + + + Header 2 + + + Header 3 + + + Header 4 + + + Header 5 + + + Header 6 + + - Text - Secondary - Tertiary - Quaternary - Warning - Warning disabled - Danger - Success - Disabled - Default Mark - Underline - Delete - Underline and Delete + - - Styles for Label - - - - - - - - - - - - - - - - - - - - + diff --git a/demo/Semi.Avalonia.Demo/Views/MainView.axaml b/demo/Semi.Avalonia.Demo/Views/MainView.axaml index 13b37f7..a87d488 100644 --- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml +++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml @@ -159,6 +159,9 @@ + + + From c713888062a93c339b60506feb3deed769b8f478 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Mon, 10 Jul 2023 17:03:29 +0800 Subject: [PATCH 30/36] fix: fix textblock alignment. --- demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml index 86dd7d1..54dbba1 100644 --- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml @@ -17,7 +17,7 @@ - From 7a483d6de38aa2af5973cdbe52a5c3f80793db80 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Mon, 10 Jul 2023 17:33:17 +0800 Subject: [PATCH 31/36] fix: delete binding. --- demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 1 - demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml | 1 - 2 files changed, 2 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml index 54dbba1..7fddd0b 100644 --- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml @@ -101,7 +101,6 @@ Theme="{DynamicResource GroupBox}"> Classes diff --git a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml index 019faf5..1125ce4 100644 --- a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml @@ -102,7 +102,6 @@ Theme="{DynamicResource GroupBox}"> Classes From 86b437b3b09914fc1062f21440d308a1b5bb94dc Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Mon, 10 Jul 2023 17:37:19 +0800 Subject: [PATCH 32/36] fix: delete default height and width, fix RowDefinitions. --- .../Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml | 2 +- demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 2 ++ demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml | 2 ++ src/Semi.Avalonia/Controls/HeaderedContentControl.axaml | 4 +--- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml index d5c312b..07f7cfe 100644 --- a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml @@ -6,7 +6,7 @@ x:Class="Semi.Avalonia.Demo.Pages.HeaderedContentControlDemo"> - + Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。 diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml index 7fddd0b..e993eba 100644 --- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml @@ -23,6 +23,7 @@ - - @@ -23,7 +21,7 @@ BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}"> - + Date: Tue, 11 Jul 2023 17:38:31 +0800 Subject: [PATCH 33/36] fix: label color order. --- demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 72 ++-- src/Semi.Avalonia/Controls/Label.axaml | 320 +++++++++--------- src/Semi.Avalonia/Themes/Dark/Label.axaml | 122 +++---- 3 files changed, 257 insertions(+), 257 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml index e993eba..90f2676 100644 --- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml @@ -165,60 +165,60 @@ - - - - - - - - - - + - - + + + + + + + + + + + - - - - - - - - - - + - - + + + + + + + + + + + - - - - - - - - - - + - - + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Controls/Label.axaml b/src/Semi.Avalonia/Controls/Label.axaml index 1f5945d..5848b77 100644 --- a/src/Semi.Avalonia/Controls/Label.axaml +++ b/src/Semi.Avalonia/Controls/Label.axaml @@ -20,60 +20,60 @@ - - - - - - - - - - + - - + + + + + + + + + + + - - - - - - - - - - + - - + + + + + + + + + + + - - - - - - - - - - + - - + + + + + + + + + + + @@ -162,7 +162,7 @@ - + @@ -203,45 +203,9 @@ - - - - - - - - - - - + + + + - + + + + + - - - - - - - - - - + + + + - + + + + + - - - - - - - - - - + + + + - + + + + +