From 7c63d45d5ea5e4dc055b59ef65acc76dfdbbf6f6 Mon Sep 17 00:00:00 2001 From: MakesYT <2696703792@qq.com> Date: Sun, 28 Jul 2024 17:46:36 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20expander=E9=BB=98?= =?UTF-8?q?=E8=AE=A4HorizontalContentAlignment=E4=B8=BAStretch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Semi.Avalonia/Controls/Expander.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Semi.Avalonia/Controls/Expander.axaml b/src/Semi.Avalonia/Controls/Expander.axaml index 600b203..a7aea15 100644 --- a/src/Semi.Avalonia/Controls/Expander.axaml +++ b/src/Semi.Avalonia/Controls/Expander.axaml @@ -23,7 +23,7 @@ - + From d355410ff20053c1a718b63b2f23b84a16348aed Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:22:49 +0800 Subject: [PATCH 2/9] feat: add Loading Classes. --- .../Pages/ToggleSwitchDemo.axaml | 6 ++ src/Semi.Avalonia/Controls/ToggleSwitch.axaml | 84 +++++++++++++++++++ .../Themes/Shared/ToggleSwitch.axaml | 2 + 3 files changed, 92 insertions(+) diff --git a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml index d747949..94299c2 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml @@ -27,14 +27,20 @@ + + + + + + diff --git a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml index 5f7a8ae..8bb8bc6 100644 --- a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml +++ b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml @@ -72,6 +72,37 @@ Background="White" BoxShadow="0 0 1 1 #222E3238" CornerRadius="100" /> + + + + + + + + + + + + + @@ -149,6 +180,22 @@ + + + + + + + + + @@ -261,6 +314,37 @@ Background="White" BoxShadow="0 0 1 1 #222E3238" CornerRadius="100" /> + + + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml b/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml index 16a1e78..56a0b72 100644 --- a/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml +++ b/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml @@ -11,6 +11,8 @@ 2 0 0 0 1 0 0 0 3 0 0 0 + 1 + 3 12 14 From 3af7e2f29a3ac2d55d6266849c07de8bfdd0ba7f Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:38:45 +0800 Subject: [PATCH 3/9] feat: add OnContent & OffContent to SimpleToggleSwitch. --- .../Pages/ToggleSwitchDemo.axaml | 25 +++++-- src/Semi.Avalonia/Controls/ToggleSwitch.axaml | 68 ++++++++++++++----- .../Themes/Dark/ToggleSwitch.axaml | 3 + .../Themes/Light/ToggleSwitch.axaml | 3 + .../Themes/Shared/ToggleSwitch.axaml | 2 + 5 files changed, 79 insertions(+), 22 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml index 94299c2..1a23866 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml @@ -26,9 +26,9 @@ OnContent="OnContent" /> - + - + @@ -38,9 +38,26 @@ - + - + + + + + + + + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml index 8bb8bc6..0ea882c 100644 --- a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml +++ b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml @@ -278,29 +278,29 @@ x:Key="SimpleToggleSwitch" BasedOn="{StaticResource {x:Type ToggleSwitch}}" TargetType="ToggleSwitch"> + + + - + Width="{DynamicResource ToggleSwitchDefaultWidth}" + Height="{DynamicResource ToggleSwitchDefaultHeight}" + CornerRadius="100"> + + + + + - - - - - - + ColumnDefinitions="*,*"> @@ -347,9 +347,41 @@ - - + + + + + + + + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml b/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml index e087b2f..f5d6888 100644 --- a/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml +++ b/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml @@ -10,4 +10,7 @@ + + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml b/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml index f1807ce..b86d9b1 100644 --- a/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml +++ b/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml @@ -10,4 +10,7 @@ + + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml b/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml index 56a0b72..eaa89b4 100644 --- a/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml +++ b/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml @@ -19,4 +19,6 @@ 8 4 8 4 + + 14 \ No newline at end of file From 5644cf59dc72257648c02c933b91a368204f9d1d Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:06:13 +0800 Subject: [PATCH 4/9] feat: update Default AdornerLayer style. --- src/Semi.Avalonia/Controls/AdornerLayer.axaml | 7 ++----- src/Semi.Avalonia/Controls/CheckBox.axaml | 1 + src/Semi.Avalonia/Controls/RadioButton.axaml | 6 +++++- src/Semi.Avalonia/Themes/Dark/AdornerLayer.axaml | 2 +- src/Semi.Avalonia/Themes/Light/AdornerLayer.axaml | 2 +- src/Semi.Avalonia/Themes/Shared/AdornerLayer.axaml | 3 +-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Semi.Avalonia/Controls/AdornerLayer.axaml b/src/Semi.Avalonia/Controls/AdornerLayer.axaml index 1093deb..03a7694 100644 --- a/src/Semi.Avalonia/Controls/AdornerLayer.axaml +++ b/src/Semi.Avalonia/Controls/AdornerLayer.axaml @@ -5,11 +5,8 @@ - + diff --git a/src/Semi.Avalonia/Controls/CheckBox.axaml b/src/Semi.Avalonia/Controls/CheckBox.axaml index 8a26fc9..450b88c 100644 --- a/src/Semi.Avalonia/Controls/CheckBox.axaml +++ b/src/Semi.Avalonia/Controls/CheckBox.axaml @@ -26,6 +26,7 @@ - + - + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/AdornerLayer.axaml b/src/Semi.Avalonia/Themes/Light/AdornerLayer.axaml index 9cd5cb5..5060345 100644 --- a/src/Semi.Avalonia/Themes/Light/AdornerLayer.axaml +++ b/src/Semi.Avalonia/Themes/Light/AdornerLayer.axaml @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Shared/AdornerLayer.axaml b/src/Semi.Avalonia/Themes/Shared/AdornerLayer.axaml index b570b21..a5119bf 100644 --- a/src/Semi.Avalonia/Themes/Shared/AdornerLayer.axaml +++ b/src/Semi.Avalonia/Themes/Shared/AdornerLayer.axaml @@ -1,4 +1,3 @@ - 1 - 1 + 2 \ No newline at end of file From 3849d7efebe1089b6978710c3d4f28e5cdc55e5c Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:07:56 +0800 Subject: [PATCH 5/9] feat: update ToggleSwitch AdornerLayer. --- src/Semi.Avalonia/Controls/ToggleSwitch.axaml | 193 +++++++++--------- 1 file changed, 99 insertions(+), 94 deletions(-) diff --git a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml index 0ea882c..f495b36 100644 --- a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml +++ b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml @@ -15,6 +15,13 @@ + + + + + + RowDefinitions="Auto,*" + ColumnDefinitions="Auto, *"> - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - + Margin="{DynamicResource ToggleSwitchIndicatorDefaultMargin}"> + + + + + + + + + + + + + + + + + - - - - + + @@ -241,6 +240,12 @@ + + + + + - - - + + + - + From 4b71b18e72415fffa1fbb5efad7859e36260c4bf Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:30:28 +0800 Subject: [PATCH 6/9] fix: TextBox inner button colors. --- demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml | 5 +++-- src/Semi.Avalonia/Controls/TextBox.axaml | 8 +++++++- src/Semi.Avalonia/Themes/Dark/Button.axaml | 6 +++--- src/Semi.Avalonia/Themes/Dark/TextBox.axaml | 3 --- src/Semi.Avalonia/Themes/Light/Button.axaml | 6 +++--- src/Semi.Avalonia/Themes/Light/TextBox.axaml | 3 --- src/Semi.Avalonia/Themes/Shared/TextBox.axaml | 4 ++-- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml index e1c9346..b62fa68 100644 --- a/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml @@ -24,8 +24,9 @@ + Classes="ClearButton RevealPasswordButton" + PasswordChar="*" + Text="123456" /> - + @@ -45,6 +45,12 @@ + + diff --git a/src/Semi.Avalonia/Themes/Dark/Button.axaml b/src/Semi.Avalonia/Themes/Dark/Button.axaml index 2f9ff5a..73279bf 100644 --- a/src/Semi.Avalonia/Themes/Dark/Button.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Button.axaml @@ -82,7 +82,7 @@ - - - + + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/TextBox.axaml b/src/Semi.Avalonia/Themes/Dark/TextBox.axaml index 31a0922..f9b5024 100644 --- a/src/Semi.Avalonia/Themes/Dark/TextBox.axaml +++ b/src/Semi.Avalonia/Themes/Dark/TextBox.axaml @@ -9,9 +9,6 @@ - - - diff --git a/src/Semi.Avalonia/Themes/Light/Button.axaml b/src/Semi.Avalonia/Themes/Light/Button.axaml index ba9513c..adbc890 100644 --- a/src/Semi.Avalonia/Themes/Light/Button.axaml +++ b/src/Semi.Avalonia/Themes/Light/Button.axaml @@ -82,7 +82,7 @@ - - - + + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/TextBox.axaml b/src/Semi.Avalonia/Themes/Light/TextBox.axaml index 92ba58c..467e67b 100644 --- a/src/Semi.Avalonia/Themes/Light/TextBox.axaml +++ b/src/Semi.Avalonia/Themes/Light/TextBox.axaml @@ -9,9 +9,6 @@ - - - diff --git a/src/Semi.Avalonia/Themes/Shared/TextBox.axaml b/src/Semi.Avalonia/Themes/Shared/TextBox.axaml index 155efd3..cea288d 100644 --- a/src/Semi.Avalonia/Themes/Shared/TextBox.axaml +++ b/src/Semi.Avalonia/Themes/Shared/TextBox.axaml @@ -13,6 +13,6 @@ 12 5 90 - M12 4C5 4 1 10 1 12C1 14 5 20 12 20C19 20 23 14 23 12C23 10 19 4 12 4ZM17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z - M2.02949 4.67856C2.7593 4.28654 3.66871 4.56038 4.06073 5.29018C6.21313 9.29726 8.83179 11.5 12.0001 11.5C15.1685 11.5 17.7871 9.29726 19.9395 5.29018C20.3315 4.56038 21.241 4.28655 21.9708 4.67856C22.7006 5.07058 22.9744 5.97999 22.5824 6.7098C21.9049 7.97104 21.1385 9.15419 20.2743 10.199L23.2001 14.1C23.6971 14.7627 23.5628 15.7029 22.9001 16.2C22.2373 16.697 21.2971 16.5627 20.8001 15.9L18.1186 12.3246C17.448 12.8501 16.7322 13.2957 15.9687 13.6441L17.4046 17.4733C17.6955 18.249 17.3025 19.1136 16.5268 19.4045C15.7511 19.6954 14.8865 19.3024 14.5956 18.5267L13.0956 14.5267C13.0852 14.4988 13.0756 14.4709 13.0669 14.4428C12.7193 14.4806 12.3638 14.5 12.0001 14.5C11.6365 14.5 11.281 14.4806 10.9333 14.4428C10.9246 14.4709 10.9151 14.4988 10.9046 14.5267L9.40463 18.5267C9.11375 19.3024 8.24913 19.6954 7.47345 19.4045C6.69777 19.1136 6.30476 18.249 6.59564 17.4733L8.03159 13.6441C7.26806 13.2957 6.55223 12.8501 5.88163 12.3246L3.20009 15.9C2.70303 16.5627 1.76283 16.697 1.10009 16.2C0.437347 15.7029 0.303032 14.7627 0.800088 14.1L3.72589 10.1989C2.86177 9.15415 2.09533 7.97101 1.41787 6.70979C1.02585 5.97999 1.29969 5.07057 2.02949 4.67856Z + M21.7071 3.70711C22.0976 3.31658 22.0976 2.68342 21.7071 2.29289C21.3166 1.90237 20.6834 1.90237 20.2929 2.29289L17.3135 5.27233C15.8114 4.50566 14.0321 4 12 4C5 4 1 10 1 12C1 13.1757 2.38219 15.7335 4.94345 17.6423L2.29289 20.2929C1.90237 20.6834 1.90237 21.3166 2.29289 21.7071C2.68342 22.0976 3.31658 22.0976 3.70711 21.7071L21.7071 3.70711ZM7.8284 14.7574L9.29237 13.2934C9.10495 12.9018 9 12.4631 9 12C9 10.3431 10.3431 9 12 9C12.4631 9 12.9018 9.10495 13.2934 9.29237L14.7574 7.8284C13.967 7.30488 13.0191 7 12 7C9.23858 7 7 9.23858 7 12C7 13.0191 7.30488 13.967 7.8284 14.7574Z M12 20C10.7789 20 9.64914 19.8174 8.61594 19.5054L11.1871 16.9342C11.4516 16.9775 11.7232 17 12 17C14.7614 17 17 14.7614 17 12C17 11.7232 16.9775 11.4516 16.9342 11.1871L20.5032 7.61808C22.1342 9.27317 23 11.0695 23 12C23 14 19 20 12 20Z + M12 4C5 4 1 10 1 12C1 14 5 20 12 20C19 20 23 14 23 12C23 10 19 4 12 4ZM17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z \ No newline at end of file From 7a6c42e1066606daecc6448bfcc01ef8baf9072f Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:17:22 +0800 Subject: [PATCH 7/9] fix: ClearButton will take the icon place when TextBox has value. --- src/Semi.Avalonia/Controls/CalendarDatePicker.axaml | 9 ++++++--- src/Semi.Avalonia/Controls/ComboBox.axaml | 11 +++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/Semi.Avalonia/Controls/CalendarDatePicker.axaml b/src/Semi.Avalonia/Controls/CalendarDatePicker.axaml index 7d4a0ad..a3755ef 100644 --- a/src/Semi.Avalonia/Controls/CalendarDatePicker.axaml +++ b/src/Semi.Avalonia/Controls/CalendarDatePicker.axaml @@ -76,7 +76,7 @@