From 445b31893e471dd40b7e3822d32f2af84e2def35 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Sun, 9 Nov 2025 11:26:49 +0800 Subject: [PATCH 1/2] feat: enhance button styles with AI Colorful classes and update ButtonDemo layout. --- .../Semi.Avalonia.Demo/Pages/ButtonDemo.axaml | 537 +++++++++++++----- .../Pages/RepeatButtonDemo.axaml | 80 --- .../Pages/RepeatButtonDemo.axaml.cs | 11 - .../Pages/ToggleButtonDemo.axaml | 98 ---- .../Pages/ToggleButtonDemo.axaml.cs | 11 - demo/Semi.Avalonia.Demo/Views/MainView.axaml | 6 - src/Semi.Avalonia/Controls/Button.axaml | 142 ++++- .../Controls/DropDownButton.axaml | 143 ++++- src/Semi.Avalonia/Controls/SplitButton.axaml | 177 +++++- src/Semi.Avalonia/Controls/ToggleButton.axaml | 116 +++- src/Semi.Avalonia/Themes/Dark/Button.axaml | 16 + src/Semi.Avalonia/Themes/Light/Button.axaml | 16 + 12 files changed, 948 insertions(+), 405 deletions(-) delete mode 100644 demo/Semi.Avalonia.Demo/Pages/RepeatButtonDemo.axaml delete mode 100644 demo/Semi.Avalonia.Demo/Pages/RepeatButtonDemo.axaml.cs delete mode 100644 demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml delete mode 100644 demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml.cs diff --git a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml index 72cc9df..e518737 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml @@ -6,174 +6,399 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - + - - - + + + + + + + + + + + + + + + - - - - - - - - Solid - - - - - - - - - - Outline - - - - - - - - - - Borderless - - - - - - - - - - Disabled - - - - - - - Size Classes - - - - - + + + - - - - - Size Classes - - Small - Default - Large - - - \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/RepeatButtonDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/RepeatButtonDemo.axaml.cs deleted file mode 100644 index 3c0a63e..0000000 --- a/demo/Semi.Avalonia.Demo/Pages/RepeatButtonDemo.axaml.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Avalonia.Controls; - -namespace Semi.Avalonia.Demo.Pages; - -public partial class RepeatButtonDemo : UserControl -{ - public RepeatButtonDemo() - { - InitializeComponent(); - } -} \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml deleted file mode 100644 index a954a7b..0000000 --- a/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - Default - Primary - Secondary - Tertiary - Success - Warning - Danger - Disabled - - - - Default - Primary - Secondary - Tertiary - Success - Warning - Danger - - Disabled - - - - - Default - - Primary - - - Secondary - - - Tertiary - - - Success - - - Warning - - - Danger - - - Disabled - - - - - Default - Checked - Indeterminate - - - - Small - Default - Large - - - \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml.cs deleted file mode 100644 index 643ed31..0000000 --- a/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Avalonia.Controls; - -namespace Semi.Avalonia.Demo.Pages; - -public partial class ToggleButtonDemo : UserControl -{ - public ToggleButtonDemo() - { - InitializeComponent(); - } -} \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Views/MainView.axaml b/demo/Semi.Avalonia.Demo/Views/MainView.axaml index 639de3c..fa86d0c 100644 --- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml +++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml @@ -161,15 +161,9 @@ - - - - - - diff --git a/src/Semi.Avalonia/Controls/Button.axaml b/src/Semi.Avalonia/Controls/Button.axaml index 7218632..ad4c871 100644 --- a/src/Semi.Avalonia/Controls/Button.axaml +++ b/src/Semi.Avalonia/Controls/Button.axaml @@ -1,11 +1,97 @@ - - - + + + + + + + + + +