From cd0945771040c12265796bd879f6e98f30f7523d Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 9 Dec 2022 01:14:49 +0800 Subject: [PATCH] feat: update button themes. --- src/Semi.Avalonia.Demo/App.axaml | 9 +- src/Semi.Avalonia.Demo/MainWindow.axaml | 28 ++- src/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml | 42 ++-- .../Pages/CheckBoxDemo.axaml | 24 +++ .../Pages/CheckBoxDemo.axaml.cs | 18 ++ src/Semi.Avalonia.Demo/Program.cs | 1 + .../Semi.Avalonia.Demo.csproj | 8 +- src/Semi.Avalonia/Controls/Button.axaml | 182 +++++++++++++---- src/Semi.Avalonia/Controls/CheckBox.axaml | 184 ++++++++++++++++++ src/Semi.Avalonia/Controls/Controls.axaml | 14 +- src/Semi.Avalonia/Controls/TabControl.axaml | 45 +++++ src/Semi.Avalonia/Controls/TabItem.axaml | 114 +++++++++++ src/Semi.Avalonia/Semi.Avalonia.csproj | 2 +- src/Semi.Avalonia/Themes/Dark/CheckBox.axaml | 54 +++++ src/Semi.Avalonia/Themes/Dark/Dark.axaml | 14 +- .../Themes/Dark/TabControl.axaml | 3 + src/Semi.Avalonia/Themes/Dark/TabItem.axaml | 3 + src/Semi.Avalonia/Themes/Light/Button.axaml | 122 ++++++++++-- src/Semi.Avalonia/Themes/Light/CheckBox.axaml | 53 +++++ src/Semi.Avalonia/Themes/Light/Light.axaml | 12 +- .../Themes/Light/TabControl.axaml | 3 + src/Semi.Avalonia/Themes/Light/TabItem.axaml | 3 + 22 files changed, 828 insertions(+), 110 deletions(-) create mode 100644 src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml create mode 100644 src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml.cs create mode 100644 src/Semi.Avalonia/Controls/CheckBox.axaml create mode 100644 src/Semi.Avalonia/Controls/TabControl.axaml create mode 100644 src/Semi.Avalonia/Controls/TabItem.axaml create mode 100644 src/Semi.Avalonia/Themes/Dark/CheckBox.axaml create mode 100644 src/Semi.Avalonia/Themes/Dark/TabControl.axaml create mode 100644 src/Semi.Avalonia/Themes/Dark/TabItem.axaml create mode 100644 src/Semi.Avalonia/Themes/Light/CheckBox.axaml create mode 100644 src/Semi.Avalonia/Themes/Light/TabControl.axaml create mode 100644 src/Semi.Avalonia/Themes/Light/TabItem.axaml diff --git a/src/Semi.Avalonia.Demo/App.axaml b/src/Semi.Avalonia.Demo/App.axaml index 3946d7d..e381db9 100644 --- a/src/Semi.Avalonia.Demo/App.axaml +++ b/src/Semi.Avalonia.Demo/App.axaml @@ -1,7 +1,8 @@ - + - + diff --git a/src/Semi.Avalonia.Demo/MainWindow.axaml b/src/Semi.Avalonia.Demo/MainWindow.axaml index 7093382..c047a31 100644 --- a/src/Semi.Avalonia.Demo/MainWindow.axaml +++ b/src/Semi.Avalonia.Demo/MainWindow.axaml @@ -1,10 +1,20 @@ - - + + + + + + + + + diff --git a/src/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml b/src/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml index 6bb0593..6c2ec75 100644 --- a/src/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml +++ b/src/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml @@ -1,14 +1,32 @@ - - - - - - + + + Light (Default) + + + + + + + + + Solid + + + + + + + + + Borderless + + + + + + + + diff --git a/src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml b/src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml new file mode 100644 index 0000000..8a5350a --- /dev/null +++ b/src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml @@ -0,0 +1,24 @@ + + + Unchecked + Unchecked + Checked + Checked + Indeterminate + + Indeterminate + + Checkbox should wrap its text + + diff --git a/src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml.cs b/src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml.cs new file mode 100644 index 0000000..b2460b0 --- /dev/null +++ b/src/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml.cs @@ -0,0 +1,18 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Semi.Avalonia.Demo.Pages; + +public partial class CheckBoxDemo : UserControl +{ + public CheckBoxDemo() + { + InitializeComponent(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } +} \ No newline at end of file diff --git a/src/Semi.Avalonia.Demo/Program.cs b/src/Semi.Avalonia.Demo/Program.cs index d490a7f..025b4f1 100644 --- a/src/Semi.Avalonia.Demo/Program.cs +++ b/src/Semi.Avalonia.Demo/Program.cs @@ -16,6 +16,7 @@ namespace Semi.Avalonia.Demo public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure() .UsePlatformDetect() + .With(new Win32PlatformOptions(){ UseCompositor = false}) .LogToTrace(); } } \ No newline at end of file diff --git a/src/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj b/src/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj index dff342f..fd3a937 100644 --- a/src/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj +++ b/src/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj @@ -18,11 +18,11 @@ - - + + - - + + diff --git a/src/Semi.Avalonia/Controls/Button.axaml b/src/Semi.Avalonia/Controls/Button.axaml index d2876fc..a256ed6 100644 --- a/src/Semi.Avalonia/Controls/Button.axaml +++ b/src/Semi.Avalonia/Controls/Button.axaml @@ -1,54 +1,66 @@ - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - + TextElement.FontSize="{TemplateBinding FontSize}" + TextElement.FontWeight="{TemplateBinding FontWeight}" + UseLayoutRounding="False" /> - - - + + + + + + + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Controls/CheckBox.axaml b/src/Semi.Avalonia/Controls/CheckBox.axaml new file mode 100644 index 0000000..e35f0cf --- /dev/null +++ b/src/Semi.Avalonia/Controls/CheckBox.axaml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Controls/Controls.axaml b/src/Semi.Avalonia/Controls/Controls.axaml index 352e9bc..ee0dd9c 100644 --- a/src/Semi.Avalonia/Controls/Controls.axaml +++ b/src/Semi.Avalonia/Controls/Controls.axaml @@ -1,9 +1,11 @@ - - + + - - - + + + + + + diff --git a/src/Semi.Avalonia/Controls/TabControl.axaml b/src/Semi.Avalonia/Controls/TabControl.axaml new file mode 100644 index 0000000..11b1caa --- /dev/null +++ b/src/Semi.Avalonia/Controls/TabControl.axaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Controls/TabItem.axaml b/src/Semi.Avalonia/Controls/TabItem.axaml new file mode 100644 index 0000000..39da335 --- /dev/null +++ b/src/Semi.Avalonia/Controls/TabItem.axaml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Semi.Avalonia.csproj b/src/Semi.Avalonia/Semi.Avalonia.csproj index 6daaaf9..24aa0da 100644 --- a/src/Semi.Avalonia/Semi.Avalonia.csproj +++ b/src/Semi.Avalonia/Semi.Avalonia.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml new file mode 100644 index 0000000..b1dc4fe --- /dev/null +++ b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 14 + 16 + 16 + 400 + + 3 + 8 0 0 0 + 1 + diff --git a/src/Semi.Avalonia/Themes/Dark/Dark.axaml b/src/Semi.Avalonia/Themes/Dark/Dark.axaml index f82c807..b4add3a 100644 --- a/src/Semi.Avalonia/Themes/Dark/Dark.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Dark.axaml @@ -1,10 +1,10 @@ - - + + - - - - + + + + + diff --git a/src/Semi.Avalonia/Themes/Dark/TabControl.axaml b/src/Semi.Avalonia/Themes/Dark/TabControl.axaml new file mode 100644 index 0000000..9017e8d --- /dev/null +++ b/src/Semi.Avalonia/Themes/Dark/TabControl.axaml @@ -0,0 +1,3 @@ + + + diff --git a/src/Semi.Avalonia/Themes/Dark/TabItem.axaml b/src/Semi.Avalonia/Themes/Dark/TabItem.axaml new file mode 100644 index 0000000..9017e8d --- /dev/null +++ b/src/Semi.Avalonia/Themes/Dark/TabItem.axaml @@ -0,0 +1,3 @@ + + + diff --git a/src/Semi.Avalonia/Themes/Light/Button.axaml b/src/Semi.Avalonia/Themes/Light/Button.axaml index 020d5f7..bbb5338 100644 --- a/src/Semi.Avalonia/Themes/Light/Button.axaml +++ b/src/Semi.Avalonia/Themes/Light/Button.axaml @@ -1,25 +1,109 @@ - - + + 14 600 - + 12 6 16 10 6 2 - - - - - - - - - - - - - - + + 1 + + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Themes/Light/CheckBox.axaml b/src/Semi.Avalonia/Themes/Light/CheckBox.axaml new file mode 100644 index 0000000..4556c69 --- /dev/null +++ b/src/Semi.Avalonia/Themes/Light/CheckBox.axaml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 14 + 16 + 16 + 400 + + 3 + 8 0 0 0 + 1 + diff --git a/src/Semi.Avalonia/Themes/Light/Light.axaml b/src/Semi.Avalonia/Themes/Light/Light.axaml index 58f3952..0796013 100644 --- a/src/Semi.Avalonia/Themes/Light/Light.axaml +++ b/src/Semi.Avalonia/Themes/Light/Light.axaml @@ -1,9 +1,9 @@ - + - - - - + + + + + diff --git a/src/Semi.Avalonia/Themes/Light/TabControl.axaml b/src/Semi.Avalonia/Themes/Light/TabControl.axaml new file mode 100644 index 0000000..9017e8d --- /dev/null +++ b/src/Semi.Avalonia/Themes/Light/TabControl.axaml @@ -0,0 +1,3 @@ + + + diff --git a/src/Semi.Avalonia/Themes/Light/TabItem.axaml b/src/Semi.Avalonia/Themes/Light/TabItem.axaml new file mode 100644 index 0000000..9017e8d --- /dev/null +++ b/src/Semi.Avalonia/Themes/Light/TabItem.axaml @@ -0,0 +1,3 @@ + + +