From 232e6e4b418023f90286ff502d7172f7e094b05b Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Sun, 4 Jun 2023 23:10:03 +0800 Subject: [PATCH 01/46] feat: upgrade to support wasm. --- demo/Semi.Avalonia.Demo.Web/App.axaml | 8 ++++---- demo/Semi.Avalonia.Demo.Web/AppBundle/app.css | 9 ++++++++- demo/Semi.Avalonia.Demo.Web/AppBundle/index.html | 1 - demo/Semi.Avalonia.Demo.Web/AppBundle/main.js | 3 --- demo/Semi.Avalonia.Demo.Web/Program.cs | 11 +++++------ .../Semi.Avalonia.Demo.Web.csproj | 11 +---------- 6 files changed, 18 insertions(+), 25 deletions(-) diff --git a/demo/Semi.Avalonia.Demo.Web/App.axaml b/demo/Semi.Avalonia.Demo.Web/App.axaml index fe5d151..6b850fc 100644 --- a/demo/Semi.Avalonia.Demo.Web/App.axaml +++ b/demo/Semi.Avalonia.Demo.Web/App.axaml @@ -1,10 +1,10 @@ + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - - + + + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css b/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css index 027ea8f..a424538 100644 --- a/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css +++ b/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css @@ -1,4 +1,11 @@ -/* HTML styles for the splash screen */ +:root { + --sat: env(safe-area-inset-top); + --sar: env(safe-area-inset-right); + --sab: env(safe-area-inset-bottom); + --sal: env(safe-area-inset-left); +} + +/* HTML styles for the splash screen */ .highlight { color: white; diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html b/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html index c90e26c..703ee35 100644 --- a/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html +++ b/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html @@ -10,7 +10,6 @@ - diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js b/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js index 2426ede..0dbe2e4 100644 --- a/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js +++ b/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js @@ -1,5 +1,4 @@ import { dotnet } from './dotnet.js' -import { registerAvaloniaModule } from './avalonia.js'; const is_browser = typeof window != "undefined"; if (!is_browser) throw new Error(`Expected to be running in a browser`); @@ -9,8 +8,6 @@ const dotnetRuntime = await dotnet .withApplicationArgumentsFromQuery() .create(); -await registerAvaloniaModule(dotnetRuntime); - const config = dotnetRuntime.getConfig(); await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]); \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Web/Program.cs b/demo/Semi.Avalonia.Demo.Web/Program.cs index 37143f0..17e83a9 100644 --- a/demo/Semi.Avalonia.Demo.Web/Program.cs +++ b/demo/Semi.Avalonia.Demo.Web/Program.cs @@ -1,17 +1,16 @@ using System.Runtime.Versioning; +using System.Threading.Tasks; using Avalonia; -using Avalonia.Media; -using Semi.Avalonia.Demo.Web; using Avalonia.Browser; [assembly: SupportedOSPlatform("browser")] +namespace Semi.Avalonia.Demo.Web; + internal partial class Program { - private static void Main(string[] args) - { - BuildAvaloniaApp(); //.SetupBrowserApp("out"); - } + private static async Task Main(string[] args) => await BuildAvaloniaApp() + .StartBrowserAppAsync("out"); public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure(); diff --git a/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj b/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj index 9db7e5b..b169194 100644 --- a/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj +++ b/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj @@ -10,20 +10,11 @@ - - - - - - - - - - + From ab8dacec4bec5bb4e8d980a21b73411a92efb6a9 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Wed, 5 Jul 2023 19:01:12 +0800 Subject: [PATCH 02/46] 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 03/46] 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 04/46] 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 05/46] =?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 06/46] =?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 07/46] =?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 08/46] 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 09/46] 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 10/46] 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 11/46] 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 12/46] 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 13/46] 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 14/46] 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 @@ - - - - - - - - - - - + + + + - + + + + + - - - - - - - - - - + + + + - + + + + + - - - - - - - - - - + + + + - + + + + + - + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Index.axaml b/src/Semi.Avalonia/Themes/Index.axaml index 3e5ed36..86c4758 100644 --- a/src/Semi.Avalonia/Themes/Index.axaml +++ b/src/Semi.Avalonia/Themes/Index.axaml @@ -2,11 +2,11 @@ - - + + - + @@ -15,5 +15,4 @@ - diff --git a/src/Semi.Avalonia/Themes/Light/Light.axaml b/src/Semi.Avalonia/Themes/Light/_index.axaml similarity index 100% rename from src/Semi.Avalonia/Themes/Light/Light.axaml rename to src/Semi.Avalonia/Themes/Light/_index.axaml diff --git a/src/Semi.Avalonia/Themes/LightTheme.axaml b/src/Semi.Avalonia/Themes/LightTheme.axaml index c6b6155..00dced9 100644 --- a/src/Semi.Avalonia/Themes/LightTheme.axaml +++ b/src/Semi.Avalonia/Themes/LightTheme.axaml @@ -1,15 +1,14 @@ - - - + + - + \ No newline at end of file From 54bdd69b2ac10c7139ab65842ee7ba32d18c9c85 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 19 Jul 2023 03:29:23 +0800 Subject: [PATCH 20/46] fix: restore BoxShadows. --- src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml | 1 + src/Semi.Avalonia/Themes/Dark/Border.axaml | 1 + src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml | 4 +--- src/Semi.Avalonia/Themes/Dark/ComboBox.axaml | 1 + src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml | 2 ++ src/Semi.Avalonia/Themes/Dark/Flyout.axaml | 1 + src/Semi.Avalonia/Themes/Dark/Menu.axaml | 1 + src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml | 1 + src/Semi.Avalonia/Themes/Dark/Slider.axaml | 1 - src/Semi.Avalonia/Themes/Dark/_index.axaml | 2 +- src/Semi.Avalonia/Themes/Light/AutoCompleteBox.axaml | 1 + src/Semi.Avalonia/Themes/Light/Border.axaml | 1 + src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml | 3 +-- src/Semi.Avalonia/Themes/Light/ComboBox.axaml | 1 + src/Semi.Avalonia/Themes/Light/Flyout.axaml | 1 + src/Semi.Avalonia/Themes/Light/Menu.axaml | 2 ++ src/Semi.Avalonia/Themes/Light/NotificationCard.axaml | 1 + src/Semi.Avalonia/Themes/Light/_index.axaml | 2 +- src/Semi.Avalonia/Themes/Shared/AutoCompleteBox.axaml | 1 - src/Semi.Avalonia/Themes/Shared/Border.axaml | 1 - src/Semi.Avalonia/Themes/Shared/CalendarDatePicker.axaml | 1 - src/Semi.Avalonia/Themes/Shared/ComboBox.axaml | 1 - src/Semi.Avalonia/Themes/Shared/DateTimePickerShared.axaml | 1 - src/Semi.Avalonia/Themes/Shared/Flyout.axaml | 1 - src/Semi.Avalonia/Themes/Shared/Menu.axaml | 1 - src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml | 1 - src/Semi.Avalonia/Themes/Shared/Slider.axaml | 1 - 27 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml b/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml index 3aba7b2..76fd6b9 100644 --- a/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml +++ b/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml @@ -1,4 +1,5 @@ + 0 0 8 0 #1AFFFFFF \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/Border.axaml b/src/Semi.Avalonia/Themes/Dark/Border.axaml index 4684198..25d26fc 100644 --- a/src/Semi.Avalonia/Themes/Dark/Border.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Border.axaml @@ -1,4 +1,5 @@ + 0 0 14 0 #1AFFFFFF \ 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 f24cd9e..962d533 100644 --- a/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml +++ b/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml @@ -4,12 +4,10 @@ - - - + 0 0 8 0 #1AFFFFFF diff --git a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml index 6c5ec25..29fc605 100644 --- a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml +++ b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml @@ -14,6 +14,7 @@ + 0 0 8 0 #1AFFFFFF diff --git a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml index 87be000..6f0ecc8 100644 --- a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml +++ b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml @@ -23,4 +23,6 @@ + + 0 0 8 0 #1AFFFFFF \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/Flyout.axaml b/src/Semi.Avalonia/Themes/Dark/Flyout.axaml index e8f8b6b..87a6de1 100644 --- a/src/Semi.Avalonia/Themes/Dark/Flyout.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Flyout.axaml @@ -2,4 +2,5 @@ + 0 0 8 0 #1AFFFFFF \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/Menu.axaml b/src/Semi.Avalonia/Themes/Dark/Menu.axaml index fe48847..cd613ce 100644 --- a/src/Semi.Avalonia/Themes/Dark/Menu.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Menu.axaml @@ -4,6 +4,7 @@ + 0 0 8 0 #1AFFFFFF diff --git a/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml index bdc2345..8c8e318 100644 --- a/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml +++ b/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml @@ -6,4 +6,5 @@ + 0 0 8 0 #1AFFFFFF diff --git a/src/Semi.Avalonia/Themes/Dark/Slider.axaml b/src/Semi.Avalonia/Themes/Dark/Slider.axaml index 4db1a0e..708dd36 100644 --- a/src/Semi.Avalonia/Themes/Dark/Slider.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Slider.axaml @@ -2,7 +2,6 @@ - diff --git a/src/Semi.Avalonia/Themes/Dark/_index.axaml b/src/Semi.Avalonia/Themes/Dark/_index.axaml index 7fbfa18..0fc69c4 100644 --- a/src/Semi.Avalonia/Themes/Dark/_index.axaml +++ b/src/Semi.Avalonia/Themes/Dark/_index.axaml @@ -15,6 +15,7 @@ + @@ -36,6 +37,5 @@ - \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/AutoCompleteBox.axaml b/src/Semi.Avalonia/Themes/Light/AutoCompleteBox.axaml index 537edd9..7fb1210 100644 --- a/src/Semi.Avalonia/Themes/Light/AutoCompleteBox.axaml +++ b/src/Semi.Avalonia/Themes/Light/AutoCompleteBox.axaml @@ -1,4 +1,5 @@ + 0 0 8 0 #1A000000 \ 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 d326fcb..affef76 100644 --- a/src/Semi.Avalonia/Themes/Light/Border.axaml +++ b/src/Semi.Avalonia/Themes/Light/Border.axaml @@ -1,4 +1,5 @@ + 0 0 14 0 #1A000000 \ 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 fc2cb0d..fccdc95 100644 --- a/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml +++ b/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml @@ -3,12 +3,11 @@ - - + 0 0 8 0 #1A000000 diff --git a/src/Semi.Avalonia/Themes/Light/ComboBox.axaml b/src/Semi.Avalonia/Themes/Light/ComboBox.axaml index 4571c3f..46fe865 100644 --- a/src/Semi.Avalonia/Themes/Light/ComboBox.axaml +++ b/src/Semi.Avalonia/Themes/Light/ComboBox.axaml @@ -14,6 +14,7 @@ + 0 0 8 0 #1A000000 diff --git a/src/Semi.Avalonia/Themes/Light/Flyout.axaml b/src/Semi.Avalonia/Themes/Light/Flyout.axaml index a738a99..7e7d9fd 100644 --- a/src/Semi.Avalonia/Themes/Light/Flyout.axaml +++ b/src/Semi.Avalonia/Themes/Light/Flyout.axaml @@ -2,4 +2,5 @@ + 0 0 8 0 #1A000000 \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/Menu.axaml b/src/Semi.Avalonia/Themes/Light/Menu.axaml index 80d1d52..b2347f8 100644 --- a/src/Semi.Avalonia/Themes/Light/Menu.axaml +++ b/src/Semi.Avalonia/Themes/Light/Menu.axaml @@ -4,6 +4,8 @@ + 0 0 8 0 #1A000000 + diff --git a/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml index a3201eb..2f0f914 100644 --- a/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml +++ b/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml @@ -6,4 +6,5 @@ + 0 0 8 0 #1A000000 \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/_index.axaml b/src/Semi.Avalonia/Themes/Light/_index.axaml index c6bf379..397d751 100644 --- a/src/Semi.Avalonia/Themes/Light/_index.axaml +++ b/src/Semi.Avalonia/Themes/Light/_index.axaml @@ -15,6 +15,7 @@ + @@ -36,6 +37,5 @@ - \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Shared/AutoCompleteBox.axaml b/src/Semi.Avalonia/Themes/Shared/AutoCompleteBox.axaml index 7b8d779..ee61e1d 100644 --- a/src/Semi.Avalonia/Themes/Shared/AutoCompleteBox.axaml +++ b/src/Semi.Avalonia/Themes/Shared/AutoCompleteBox.axaml @@ -1,5 +1,4 @@ - 0 0 8 0 #1AFFFFFF 1 4 6 diff --git a/src/Semi.Avalonia/Themes/Shared/Border.axaml b/src/Semi.Avalonia/Themes/Shared/Border.axaml index 3e35801..ba9887f 100644 --- a/src/Semi.Avalonia/Themes/Shared/Border.axaml +++ b/src/Semi.Avalonia/Themes/Shared/Border.axaml @@ -3,5 +3,4 @@ 20 4 1 - 0 0 14 0 #1AFFFFFF \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Shared/CalendarDatePicker.axaml b/src/Semi.Avalonia/Themes/Shared/CalendarDatePicker.axaml index e743c10..7c4128b 100644 --- a/src/Semi.Avalonia/Themes/Shared/CalendarDatePicker.axaml +++ b/src/Semi.Avalonia/Themes/Shared/CalendarDatePicker.axaml @@ -2,7 +2,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 1 3 - 0 0 8 0 #1AFFFFFF 30 22 38 diff --git a/src/Semi.Avalonia/Themes/Shared/ComboBox.axaml b/src/Semi.Avalonia/Themes/Shared/ComboBox.axaml index 7c83ebb..23cbd48 100644 --- a/src/Semi.Avalonia/Themes/Shared/ComboBox.axaml +++ b/src/Semi.Avalonia/Themes/Shared/ComboBox.axaml @@ -4,7 +4,6 @@ 8 4 8 0 - 0 0 8 0 #1AFFFFFF 1 diff --git a/src/Semi.Avalonia/Themes/Shared/DateTimePickerShared.axaml b/src/Semi.Avalonia/Themes/Shared/DateTimePickerShared.axaml index cb22130..7135f3e 100644 --- a/src/Semi.Avalonia/Themes/Shared/DateTimePickerShared.axaml +++ b/src/Semi.Avalonia/Themes/Shared/DateTimePickerShared.axaml @@ -8,7 +8,6 @@ 30 - 0 0 8 0 #1AFFFFFF 16 0 8 diff --git a/src/Semi.Avalonia/Themes/Shared/Flyout.axaml b/src/Semi.Avalonia/Themes/Shared/Flyout.axaml index 3495b17..62aff56 100644 --- a/src/Semi.Avalonia/Themes/Shared/Flyout.axaml +++ b/src/Semi.Avalonia/Themes/Shared/Flyout.axaml @@ -1,7 +1,6 @@ 400 1 - 0 0 8 0 #1AFFFFFF 100 100 600 diff --git a/src/Semi.Avalonia/Themes/Shared/Menu.axaml b/src/Semi.Avalonia/Themes/Shared/Menu.axaml index e6b4150..95188b1 100644 --- a/src/Semi.Avalonia/Themes/Shared/Menu.axaml +++ b/src/Semi.Avalonia/Themes/Shared/Menu.axaml @@ -5,7 +5,6 @@ 1 8 - 0 0 8 0 #1AFFFFFF 6 16 100 diff --git a/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml index 530a879..41c7039 100644 --- a/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml +++ b/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml @@ -2,7 +2,6 @@ 320 1 6 - 0 0 8 0 #1AFFFFFF 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 diff --git a/src/Semi.Avalonia/Themes/Shared/Slider.axaml b/src/Semi.Avalonia/Themes/Shared/Slider.axaml index cfefeae..42c66a9 100644 --- a/src/Semi.Avalonia/Themes/Shared/Slider.axaml +++ b/src/Semi.Avalonia/Themes/Shared/Slider.axaml @@ -5,7 +5,6 @@ 16 24 0 - 0 0 1 1 #1AFFFFFF 4 4 From 95c7b9a8072b98470cdd777dab4109e98906d243 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 19 Jul 2023 11:16:10 +0800 Subject: [PATCH 21/46] feat: extract non-theme resources of ColorPicker and DataGrid. --- src/Semi.Avalonia.ColorPicker/Dark.axaml | 32 ++-------------------- src/Semi.Avalonia.ColorPicker/Index.axaml | 4 +-- src/Semi.Avalonia.ColorPicker/Light.axaml | 31 ++------------------- src/Semi.Avalonia.ColorPicker/Shared.axaml | 30 ++++++++++++++++++++ src/Semi.Avalonia.DataGrid/Dark.axaml | 17 ++---------- src/Semi.Avalonia.DataGrid/Index.axaml | 4 +-- src/Semi.Avalonia.DataGrid/Light.axaml | 15 +--------- src/Semi.Avalonia.DataGrid/Shared.axaml | 19 +++++++++++++ 8 files changed, 60 insertions(+), 92 deletions(-) create mode 100644 src/Semi.Avalonia.ColorPicker/Shared.axaml create mode 100644 src/Semi.Avalonia.DataGrid/Shared.axaml diff --git a/src/Semi.Avalonia.ColorPicker/Dark.axaml b/src/Semi.Avalonia.ColorPicker/Dark.axaml index d60ed09..e96849e 100644 --- a/src/Semi.Avalonia.ColorPicker/Dark.axaml +++ b/src/Semi.Avalonia.ColorPicker/Dark.axaml @@ -1,8 +1,4 @@ - - + @@ -11,39 +7,15 @@ - 600 - 16 4 - 70 - - M6.92,19L5,17.08L13.06,9L15,10.94M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L13.84,6.41L11.91,4.5L10.5,5.91L11.92,7.33L3,16.25V21H7.75L16.67,12.08L18.09,13.5L19.5,12.09L17.58,10.17L20.7,7.05C21.1,6.65 21.1,6 20.71,5.63Z - - - M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z - - - M4 6.5C5.10457 6.5 6 5.60457 6 4.5C6 3.39543 5.10457 2.5 4 2.5C2.89543 2.5 2 3.39543 2 4.5C2 5.60457 2.89543 6.5 4 6.5ZM9.5 3C8.67157 3 8 3.67157 8 4.5C8 5.32843 8.67157 6 9.5 6H20.5C21.3284 6 22 5.32843 22 4.5C22 3.67157 21.3284 3 20.5 3H9.5ZM8 11.5C8 10.6716 8.67157 10 9.5 10H20.5C21.3284 10 22 10.6716 22 11.5C22 12.3284 21.3284 13 20.5 13H9.5C8.67157 13 8 12.3284 8 11.5ZM8 18.5C8 17.6716 8.67157 17 9.5 17H20.5C21.3284 17 22 17.6716 22 18.5C22 19.3284 21.3284 20 20.5 20H9.5C8.67157 20 8 19.3284 8 18.5ZM6 11.5C6 12.6046 5.10457 13.5 4 13.5C2.89543 13.5 2 12.6046 2 11.5C2 10.3954 2.89543 9.5 4 9.5C5.10457 9.5 6 10.3954 6 11.5ZM4 20.5C5.10457 20.5 6 19.6046 6 18.5C6 17.3954 5.10457 16.5 4 16.5C2.89543 16.5 2 17.3954 2 18.5C2 19.6046 2.89543 20.5 4 20.5Z - - 16 - 6 - 2 - 0 0 2 1 #FFFFFF - - 80 - 20 - 48 - 3 - 0 0 14 0 #1AFFFFFF - - - + \ No newline at end of file diff --git a/src/Semi.Avalonia.ColorPicker/Index.axaml b/src/Semi.Avalonia.ColorPicker/Index.axaml index d41f3b7..2af9525 100644 --- a/src/Semi.Avalonia.ColorPicker/Index.axaml +++ b/src/Semi.Avalonia.ColorPicker/Index.axaml @@ -1,5 +1,4 @@ - @@ -8,7 +7,8 @@ + - + \ No newline at end of file diff --git a/src/Semi.Avalonia.ColorPicker/Light.axaml b/src/Semi.Avalonia.ColorPicker/Light.axaml index 928968e..6148e2f 100644 --- a/src/Semi.Avalonia.ColorPicker/Light.axaml +++ b/src/Semi.Avalonia.ColorPicker/Light.axaml @@ -1,8 +1,4 @@ - - + @@ -11,38 +7,15 @@ - 600 - 16 4 - 70 - - M6.92,19L5,17.08L13.06,9L15,10.94M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L13.84,6.41L11.91,4.5L10.5,5.91L11.92,7.33L3,16.25V21H7.75L16.67,12.08L18.09,13.5L19.5,12.09L17.58,10.17L20.7,7.05C21.1,6.65 21.1,6 20.71,5.63Z - - - M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z - - - M4 6.5C5.10457 6.5 6 5.60457 6 4.5C6 3.39543 5.10457 2.5 4 2.5C2.89543 2.5 2 3.39543 2 4.5C2 5.60457 2.89543 6.5 4 6.5ZM9.5 3C8.67157 3 8 3.67157 8 4.5C8 5.32843 8.67157 6 9.5 6H20.5C21.3284 6 22 5.32843 22 4.5C22 3.67157 21.3284 3 20.5 3H9.5ZM8 11.5C8 10.6716 8.67157 10 9.5 10H20.5C21.3284 10 22 10.6716 22 11.5C22 12.3284 21.3284 13 20.5 13H9.5C8.67157 13 8 12.3284 8 11.5ZM8 18.5C8 17.6716 8.67157 17 9.5 17H20.5C21.3284 17 22 17.6716 22 18.5C22 19.3284 21.3284 20 20.5 20H9.5C8.67157 20 8 19.3284 8 18.5ZM6 11.5C6 12.6046 5.10457 13.5 4 13.5C2.89543 13.5 2 12.6046 2 11.5C2 10.3954 2.89543 9.5 4 9.5C5.10457 9.5 6 10.3954 6 11.5ZM4 20.5C5.10457 20.5 6 19.6046 6 18.5C6 17.3954 5.10457 16.5 4 16.5C2.89543 16.5 2 17.3954 2 18.5C2 19.6046 2.89543 20.5 4 20.5Z - - 16 - 6 - 2 - 0 0 2 1 #1A000000 - - 80 - 20 - 48 - 3 - 0 0 14 0 #1A000000 - - + \ No newline at end of file diff --git a/src/Semi.Avalonia.ColorPicker/Shared.axaml b/src/Semi.Avalonia.ColorPicker/Shared.axaml new file mode 100644 index 0000000..3338c4d --- /dev/null +++ b/src/Semi.Avalonia.ColorPicker/Shared.axaml @@ -0,0 +1,30 @@ + + 600 + 16 4 + 70 + + + M6.92,19L5,17.08L13.06,9L15,10.94M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L13.84,6.41L11.91,4.5L10.5,5.91L11.92,7.33L3,16.25V21H7.75L16.67,12.08L18.09,13.5L19.5,12.09L17.58,10.17L20.7,7.05C21.1,6.65 21.1,6 20.71,5.63Z + + + M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z + + + M4 6.5C5.10457 6.5 6 5.60457 6 4.5C6 3.39543 5.10457 2.5 4 2.5C2.89543 2.5 2 3.39543 2 4.5C2 5.60457 2.89543 6.5 4 6.5ZM9.5 3C8.67157 3 8 3.67157 8 4.5C8 5.32843 8.67157 6 9.5 6H20.5C21.3284 6 22 5.32843 22 4.5C22 3.67157 21.3284 3 20.5 3H9.5ZM8 11.5C8 10.6716 8.67157 10 9.5 10H20.5C21.3284 10 22 10.6716 22 11.5C22 12.3284 21.3284 13 20.5 13H9.5C8.67157 13 8 12.3284 8 11.5ZM8 18.5C8 17.6716 8.67157 17 9.5 17H20.5C21.3284 17 22 17.6716 22 18.5C22 19.3284 21.3284 20 20.5 20H9.5C8.67157 20 8 19.3284 8 18.5ZM6 11.5C6 12.6046 5.10457 13.5 4 13.5C2.89543 13.5 2 12.6046 2 11.5C2 10.3954 2.89543 9.5 4 9.5C5.10457 9.5 6 10.3954 6 11.5ZM4 20.5C5.10457 20.5 6 19.6046 6 18.5C6 17.3954 5.10457 16.5 4 16.5C2.89543 16.5 2 17.3954 2 18.5C2 19.6046 2.89543 20.5 4 20.5Z + + + 16 + 6 + 2 + 0 0 2 1 #FFFFFF + + 80 + 20 + 48 + 3 + + + \ No newline at end of file diff --git a/src/Semi.Avalonia.DataGrid/Dark.axaml b/src/Semi.Avalonia.DataGrid/Dark.axaml index e8689c5..4af1cb1 100644 --- a/src/Semi.Avalonia.DataGrid/Dark.axaml +++ b/src/Semi.Avalonia.DataGrid/Dark.axaml @@ -1,29 +1,19 @@ - - 12 0 - 32 - 1 - 1 - 12 0 0 0 - 32 + - M6.45096 8.34102L11.247 2.86102C11.3408 2.75361 11.4566 2.66753 11.5865 2.60854C11.7163 2.54956 11.8573 2.51904 12 2.51904C12.1426 2.51904 12.2836 2.54956 12.4135 2.60854C12.5433 2.66753 12.6591 2.75361 12.753 2.86102L17.549 8.34102C18.115 8.98802 17.655 10 16.796 10H7.20396C6.34396 10 5.88496 8.98802 6.45096 8.34102Z - M17.549 15.659L12.753 21.139C12.6591 21.2464 12.5434 21.3325 12.4135 21.3915C12.2836 21.4505 12.1427 21.481 12 21.481C11.8574 21.481 11.7164 21.4505 11.5865 21.3915C11.4566 21.3325 11.3409 21.2464 11.247 21.139L6.45101 15.659C5.88501 15.011 6.34501 14 7.20401 14H16.796C17.656 14 18.115 15.012 17.549 15.659Z - - 8 0 @@ -31,13 +21,10 @@ - - 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 - + \ No newline at end of file diff --git a/src/Semi.Avalonia.DataGrid/Index.axaml b/src/Semi.Avalonia.DataGrid/Index.axaml index 98cabac..29ddeaa 100644 --- a/src/Semi.Avalonia.DataGrid/Index.axaml +++ b/src/Semi.Avalonia.DataGrid/Index.axaml @@ -1,5 +1,4 @@ - @@ -8,7 +7,8 @@ + - + \ No newline at end of file diff --git a/src/Semi.Avalonia.DataGrid/Light.axaml b/src/Semi.Avalonia.DataGrid/Light.axaml index 7c29b49..d35acc6 100644 --- a/src/Semi.Avalonia.DataGrid/Light.axaml +++ b/src/Semi.Avalonia.DataGrid/Light.axaml @@ -1,29 +1,18 @@ - - 12 0 - 32 - 1 - 1 - 12 0 0 0 - 32 - M6.45096 8.34102L11.247 2.86102C11.3408 2.75361 11.4566 2.66753 11.5865 2.60854C11.7163 2.54956 11.8573 2.51904 12 2.51904C12.1426 2.51904 12.2836 2.54956 12.4135 2.60854C12.5433 2.66753 12.6591 2.75361 12.753 2.86102L17.549 8.34102C18.115 8.98802 17.655 10 16.796 10H7.20396C6.34396 10 5.88496 8.98802 6.45096 8.34102Z - M17.549 15.659L12.753 21.139C12.6591 21.2464 12.5434 21.3325 12.4135 21.3915C12.2836 21.4505 12.1427 21.481 12 21.481C11.8574 21.481 11.7164 21.4505 11.5865 21.3915C11.4566 21.3325 11.3409 21.2464 11.247 21.139L6.45101 15.659C5.88501 15.011 6.34501 14 7.20401 14H16.796C17.656 14 18.115 15.012 17.549 15.659Z - - 8 0 @@ -32,12 +21,10 @@ - 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 - + \ No newline at end of file diff --git a/src/Semi.Avalonia.DataGrid/Shared.axaml b/src/Semi.Avalonia.DataGrid/Shared.axaml new file mode 100644 index 0000000..7ae82b3 --- /dev/null +++ b/src/Semi.Avalonia.DataGrid/Shared.axaml @@ -0,0 +1,19 @@ + + 12 0 + + 32 + 1 + 1 + + 12 0 0 0 + 32 + + M6.45096 8.34102L11.247 2.86102C11.3408 2.75361 11.4566 2.66753 11.5865 2.60854C11.7163 2.54956 11.8573 2.51904 12 2.51904C12.1426 2.51904 12.2836 2.54956 12.4135 2.60854C12.5433 2.66753 12.6591 2.75361 12.753 2.86102L17.549 8.34102C18.115 8.98802 17.655 10 16.796 10H7.20396C6.34396 10 5.88496 8.98802 6.45096 8.34102Z + M17.549 15.659L12.753 21.139C12.6591 21.2464 12.5434 21.3325 12.4135 21.3915C12.2836 21.4505 12.1427 21.481 12 21.481C11.8574 21.481 11.7164 21.4505 11.5865 21.3915C11.4566 21.3325 11.3409 21.2464 11.247 21.139L6.45101 15.659C5.88501 15.011 6.34501 14 7.20401 14H16.796C17.656 14 18.115 15.012 17.549 15.659Z + + 8 0 + + 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 + \ No newline at end of file From eaff3ebad007a7c8a69f7cb03898991ce89965a2 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 19 Jul 2023 11:50:30 +0800 Subject: [PATCH 22/46] fix: restore the missing resources. --- src/Semi.Avalonia/Themes/Dark/DatePicker.axaml | 2 ++ src/Semi.Avalonia/Themes/Dark/DropDownButton.axaml | 2 ++ src/Semi.Avalonia/Themes/Dark/NumericUpDown.axaml | 2 ++ src/Semi.Avalonia/Themes/Dark/SplitButton.axaml | 2 ++ src/Semi.Avalonia/Themes/Dark/TabControl.axaml | 2 ++ src/Semi.Avalonia/Themes/Dark/TimePicker.axaml | 2 ++ src/Semi.Avalonia/Themes/Dark/_index.axaml | 6 ++++++ src/Semi.Avalonia/Themes/Light/DatePicker.axaml | 2 ++ src/Semi.Avalonia/Themes/Light/DropDownButton.axaml | 2 ++ src/Semi.Avalonia/Themes/Light/NumericUpDown.axaml | 2 ++ src/Semi.Avalonia/Themes/Light/SplitButton.axaml | 2 ++ src/Semi.Avalonia/Themes/Light/TabControl.axaml | 2 ++ src/Semi.Avalonia/Themes/Light/TimePicker.axaml | 2 ++ src/Semi.Avalonia/Themes/Light/_index.axaml | 6 ++++++ src/Semi.Avalonia/Themes/Shared/DataValidationErrors.axaml | 2 ++ src/Semi.Avalonia/Themes/Shared/GridSplitter.axaml | 2 ++ src/Semi.Avalonia/Themes/Shared/Palette.axaml | 2 ++ src/Semi.Avalonia/Themes/Shared/TabControl.axaml | 2 ++ src/Semi.Avalonia/Themes/Shared/Window.axaml | 2 ++ src/Semi.Avalonia/Themes/Shared/_index.axaml | 7 ++++++- 20 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/Semi.Avalonia/Themes/Dark/DatePicker.axaml create mode 100644 src/Semi.Avalonia/Themes/Dark/DropDownButton.axaml create mode 100644 src/Semi.Avalonia/Themes/Dark/NumericUpDown.axaml create mode 100644 src/Semi.Avalonia/Themes/Dark/SplitButton.axaml create mode 100644 src/Semi.Avalonia/Themes/Dark/TabControl.axaml create mode 100644 src/Semi.Avalonia/Themes/Dark/TimePicker.axaml create mode 100644 src/Semi.Avalonia/Themes/Light/DatePicker.axaml create mode 100644 src/Semi.Avalonia/Themes/Light/DropDownButton.axaml create mode 100644 src/Semi.Avalonia/Themes/Light/NumericUpDown.axaml create mode 100644 src/Semi.Avalonia/Themes/Light/SplitButton.axaml create mode 100644 src/Semi.Avalonia/Themes/Light/TabControl.axaml create mode 100644 src/Semi.Avalonia/Themes/Light/TimePicker.axaml create mode 100644 src/Semi.Avalonia/Themes/Shared/DataValidationErrors.axaml create mode 100644 src/Semi.Avalonia/Themes/Shared/GridSplitter.axaml create mode 100644 src/Semi.Avalonia/Themes/Shared/Palette.axaml create mode 100644 src/Semi.Avalonia/Themes/Shared/TabControl.axaml create mode 100644 src/Semi.Avalonia/Themes/Shared/Window.axaml diff --git a/src/Semi.Avalonia/Themes/Dark/DatePicker.axaml b/src/Semi.Avalonia/Themes/Dark/DatePicker.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Dark/DatePicker.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/DropDownButton.axaml b/src/Semi.Avalonia/Themes/Dark/DropDownButton.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Dark/DropDownButton.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/NumericUpDown.axaml b/src/Semi.Avalonia/Themes/Dark/NumericUpDown.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Dark/NumericUpDown.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/SplitButton.axaml b/src/Semi.Avalonia/Themes/Dark/SplitButton.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Dark/SplitButton.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/TabControl.axaml b/src/Semi.Avalonia/Themes/Dark/TabControl.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Dark/TabControl.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/TimePicker.axaml b/src/Semi.Avalonia/Themes/Dark/TimePicker.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Dark/TimePicker.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/_index.axaml b/src/Semi.Avalonia/Themes/Dark/_index.axaml index 0fc69c4..5b328e6 100644 --- a/src/Semi.Avalonia/Themes/Dark/_index.axaml +++ b/src/Semi.Avalonia/Themes/Dark/_index.axaml @@ -13,7 +13,9 @@ + + @@ -23,15 +25,19 @@ + + + + diff --git a/src/Semi.Avalonia/Themes/Light/DatePicker.axaml b/src/Semi.Avalonia/Themes/Light/DatePicker.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Light/DatePicker.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/DropDownButton.axaml b/src/Semi.Avalonia/Themes/Light/DropDownButton.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Light/DropDownButton.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/NumericUpDown.axaml b/src/Semi.Avalonia/Themes/Light/NumericUpDown.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Light/NumericUpDown.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/SplitButton.axaml b/src/Semi.Avalonia/Themes/Light/SplitButton.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Light/SplitButton.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/TabControl.axaml b/src/Semi.Avalonia/Themes/Light/TabControl.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Light/TabControl.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/TimePicker.axaml b/src/Semi.Avalonia/Themes/Light/TimePicker.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Light/TimePicker.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/_index.axaml b/src/Semi.Avalonia/Themes/Light/_index.axaml index 397d751..3baba8f 100644 --- a/src/Semi.Avalonia/Themes/Light/_index.axaml +++ b/src/Semi.Avalonia/Themes/Light/_index.axaml @@ -13,7 +13,9 @@ + + @@ -23,15 +25,19 @@ + + + + diff --git a/src/Semi.Avalonia/Themes/Shared/DataValidationErrors.axaml b/src/Semi.Avalonia/Themes/Shared/DataValidationErrors.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Shared/DataValidationErrors.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Shared/GridSplitter.axaml b/src/Semi.Avalonia/Themes/Shared/GridSplitter.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Shared/GridSplitter.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Shared/Palette.axaml b/src/Semi.Avalonia/Themes/Shared/Palette.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Shared/Palette.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Shared/TabControl.axaml b/src/Semi.Avalonia/Themes/Shared/TabControl.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Shared/TabControl.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Shared/Window.axaml b/src/Semi.Avalonia/Themes/Shared/Window.axaml new file mode 100644 index 0000000..d1981be --- /dev/null +++ b/src/Semi.Avalonia/Themes/Shared/Window.axaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Shared/_index.axaml b/src/Semi.Avalonia/Themes/Shared/_index.axaml index 12db9e4..249105f 100644 --- a/src/Semi.Avalonia/Themes/Shared/_index.axaml +++ b/src/Semi.Avalonia/Themes/Shared/_index.axaml @@ -1,5 +1,6 @@  + @@ -11,10 +12,13 @@ + + + @@ -29,6 +33,7 @@ + @@ -37,6 +42,6 @@ - + \ No newline at end of file From 98770145129751e3c560b84a0dd442dbd775a367 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:02:22 +0800 Subject: [PATCH 23/46] feat: github pages. --- .github/workflows/deploy.yml | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..bcd5bde --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,50 @@ +name: Deploy to GitHub Pages + +env: + PROJECT_PATH: demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj + OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Debug/net7.0/browser-wasm/AppBundle +on: + push: + branches: [ "deploy" ] + pull_request: + branches: [ "deploy" ] + +jobs: + deploy-to-github-pages: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup .NET Core SDK + uses: actions/setup-dotnet@v1.9.0 + + - name: Install wasm-tools + run: dotnet workload install wasm-tools wasm-experimental + + - name: Install DotNetCompress + run: dotnet tool install --global DotNetCompress --version 2.0.0 --no-cache + + - name: Publish .NET Project + run: dotnet publish $PROJECT_PATH -c Debug -o debug --nologo + + - name: Change base-tag in index.html + run: sed -i 's///g' $OUTPUT_PATH/index.html + + - name: copy index.html to 404.html + run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html + + - name: Compress Output using Brotli + run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format br --threads 4 + + - name: Compress Output using GZip + run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format gz --threads 4 + + - name: Add .nojekyll file + run: touch $OUTPUT_PATH/.nojekyll + + - name: Commit wwwroot to GitHub Pages + uses: JamesIves/github-pages-deploy-action@4.1.7 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: ${{ env.OUTPUT_PATH }} From 5e94fd7bfab664475f869a4da3fe227db7493df8 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Tue, 25 Jul 2023 10:46:50 +0800 Subject: [PATCH 24/46] feat: change DataGrid demo data. --- .../Pages/DataGridDemo.axaml | 224 ++++---- .../Pages/DataGridDemo.axaml.cs | 485 +----------------- .../ViewModels/DataGridDemoViewModel.cs | 153 ++++++ 3 files changed, 254 insertions(+), 608 deletions(-) create mode 100644 demo/Semi.Avalonia.Demo/ViewModels/DataGridDemoViewModel.cs diff --git a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml index 44729f3..5a36e71 100644 --- a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml @@ -5,122 +5,95 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="using:Semi.Avalonia.Demo.Pages" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels;assembly=Semi.Avalonia.Demo" d:DesignHeight="450" d:DesignWidth="800" + x:CompileBindings="True" + x:DataType="vm:DataGridDemoViewModel" mc:Ignorable="d"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + x:DataType="vm:Song" + Binding="{Binding Title}" + Header="Title" /> + Width="6*" + x:DataType="vm:Song" + Binding="{Binding Artist}" + Header="Artist" /> - - + Width="6*" + x:DataType="vm:Song" + Binding="{Binding Album}" + Header="Album" /> + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + - + Margin="8" + ItemsSource="{Binding GridData3}"> - - - + + + + + Text="{Binding CountOfComment}" /> @@ -174,17 +151,14 @@ + Value="{Binding CountOfComment}" />