From 2b37df580f0b810f69f547ea5d5e2ff060001bcc Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Mon, 22 Jul 2024 20:48:04 +0800 Subject: [PATCH] feat: Button Outline theme & colors. * add Outline Theme to Button. * :disabled, Tertiary Classes Button color. --- .../Semi.Avalonia.Demo/Pages/ButtonDemo.axaml | 280 +++++++++++------- .../Pages/RepeatButtonDemo.axaml | 40 ++- .../Pages/ToggleButtonDemo.axaml | 73 ++++- src/Semi.Avalonia/Controls/Button.axaml | 39 ++- .../Controls/DropDownButton.axaml | 33 ++- src/Semi.Avalonia/Controls/RepeatButton.axaml | 33 ++- src/Semi.Avalonia/Controls/SplitButton.axaml | 37 ++- src/Semi.Avalonia/Controls/ToggleButton.axaml | 4 +- src/Semi.Avalonia/Themes/Dark/Button.axaml | 17 +- .../Themes/Dark/ToggleButton.axaml | 4 +- src/Semi.Avalonia/Themes/Light/Button.axaml | 17 +- .../Themes/Light/ToggleButton.axaml | 4 +- 12 files changed, 434 insertions(+), 147 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml index 4f94211..2974962 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml @@ -4,114 +4,176 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - d:DesignHeight="450" - d:DesignWidth="800" mc:Ignorable="d"> - - Light (Default) - - - - - - - - + + + + + + + + + Light (Default) + + + + + + + + + + Solid + + + + + + + + + + Outline + + + + + + + + + + Borderless + + + + + + + + + + Disabled + + + + + + + Size Classes + + + + + + + DropDownButton + + + + + + + + + + + + + + + + + + + + + + + + + + SplitButton + + + + + + + + + + + + + + + + + + + + + + + + + + ToggleSplitButton + + + + + + + + + + + + + + + + + + + + - Solid - - - - - - - - - - Borderless - - - - - - - - - - DropDownButton - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/RepeatButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/RepeatButtonDemo.axaml index 5bf1e7f..a9045c9 100644 --- a/demo/Semi.Avalonia.Demo/Pages/RepeatButtonDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/RepeatButtonDemo.axaml @@ -16,7 +16,7 @@ Success Warning Danger - Danger + Disabled Solid @@ -27,10 +27,25 @@ Warning Danger - Danger + Disabled + + + Outline + + Primary + Secondary + Tertiary + Success + Warning + Danger + + Disabled Borderless @@ -42,11 +57,24 @@ Warning Danger - Danger + Disabled + Disabled + + + + + + + Size Classes + + Small + Default + Large + - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml index 5701f79..a954a7b 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml @@ -17,7 +17,7 @@ Success Warning Danger - Danger + Disabled @@ -28,18 +28,71 @@ Success Warning Danger - Danger + + Disabled + - Default - Primary - Secondary - Tertiary - Success - Warning - Danger - Danger + Default + + Primary + + + Secondary + + + Tertiary + + + Success + + + Warning + + + Danger + + + Disabled + + + + + Default + Checked + Indeterminate + + + + Small + Default + Large \ No newline at end of file diff --git a/src/Semi.Avalonia/Controls/Button.axaml b/src/Semi.Avalonia/Controls/Button.axaml index 594b759..1567ea0 100644 --- a/src/Semi.Avalonia/Controls/Button.axaml +++ b/src/Semi.Avalonia/Controls/Button.axaml @@ -2,9 +2,9 @@ xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:CompileBindings="True"> - - - + + + @@ -76,7 +76,6 @@ @@ -186,7 +185,37 @@ + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Controls/DropDownButton.axaml b/src/Semi.Avalonia/Controls/DropDownButton.axaml index c8bc667..65237d4 100644 --- a/src/Semi.Avalonia/Controls/DropDownButton.axaml +++ b/src/Semi.Avalonia/Controls/DropDownButton.axaml @@ -88,7 +88,6 @@ @@ -235,7 +234,37 @@ + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Controls/RepeatButton.axaml b/src/Semi.Avalonia/Controls/RepeatButton.axaml index cad9922..7bb6f40 100644 --- a/src/Semi.Avalonia/Controls/RepeatButton.axaml +++ b/src/Semi.Avalonia/Controls/RepeatButton.axaml @@ -71,7 +71,6 @@ @@ -172,7 +171,37 @@ + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Controls/SplitButton.axaml b/src/Semi.Avalonia/Controls/SplitButton.axaml index 66644d1..e58ebba 100644 --- a/src/Semi.Avalonia/Controls/SplitButton.axaml +++ b/src/Semi.Avalonia/Controls/SplitButton.axaml @@ -124,9 +124,12 @@ + + + + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Controls/ToggleButton.axaml b/src/Semi.Avalonia/Controls/ToggleButton.axaml index 3393064..fa2519b 100644 --- a/src/Semi.Avalonia/Controls/ToggleButton.axaml +++ b/src/Semi.Avalonia/Controls/ToggleButton.axaml @@ -67,6 +67,7 @@ @@ -242,12 +244,12 @@