From e37f97042e18232877d1a8e62f8b046ac86acc12 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Thu, 9 Feb 2023 22:21:36 +0800 Subject: [PATCH 01/15] feat: use vertical navigation tab control. --- .../Pages/AutoCompleteBoxDemo.axaml | 5 +- .../Semi.Avalonia.Demo/Pages/BorderDemo.axaml | 14 +++-- .../Semi.Avalonia.Demo/Pages/ButtonDemo.axaml | 5 +- .../Pages/ButtonSpinnerDemo.axaml | 5 +- .../Pages/CalendarDatePickerDemo.axaml | 2 +- .../Pages/CalendarDatePickerDemo.axaml.cs | 5 -- .../Pages/CalendarDemo.axaml | 2 +- .../Pages/CheckBoxDemo.axaml | 2 +- .../Pages/ColorPickerDemo.axaml | 2 +- .../Pages/ComboBoxDemo.axaml | 2 +- .../Pages/ComboBoxDemo.axaml.cs | 5 -- .../Pages/DataGridDemo.axaml | 2 +- .../Pages/DatePickerDemo.axaml | 2 +- .../Pages/ExpanderDemo.axaml | 23 +++++--- demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 17 +++--- .../Pages/ListBoxDemo.axaml | 2 +- demo/Semi.Avalonia.Demo/Pages/MenuDemo.axaml | 6 +-- .../Pages/NotificationDemo.axaml | 5 +- .../Pages/NumericUpDownDemo.axaml | 5 +- demo/Semi.Avalonia.Demo/Pages/Overview.axaml | 2 +- .../Pages/ProgressBarDemo.axaml | 5 +- .../Pages/RadioButtonDemo.axaml | 13 ++--- .../Pages/RefreshContainerDemo.axaml | 5 +- .../Pages/RepeatButtonDemo.axaml | 32 +++++++---- .../Semi.Avalonia.Demo/Pages/SliderDemo.axaml | 5 +- .../Pages/SplitViewDemo.axaml | 1 - .../Pages/TabControlDemo.axaml | 2 +- .../Pages/TimePickerDemo.axaml | 2 +- .../Pages/ToggleButtonDemo.axaml | 2 +- .../Pages/ToggleSwitchDemo.axaml | 2 +- demo/Semi.Avalonia.Demo/Views/MainView.axaml | 13 ++++- demo/Semi.Avalonia.Demo/Views/TabMenu.axaml | 53 +++++++++++++++++++ 32 files changed, 152 insertions(+), 96 deletions(-) create mode 100644 demo/Semi.Avalonia.Demo/Views/TabMenu.axaml diff --git a/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml index 8b249b9..65e30b9 100644 --- a/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml @@ -11,10 +11,7 @@ - + + + From c9cc49a67cc6a69acd55cbbc5db2c47956d8cf14 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Thu, 9 Feb 2023 22:26:12 +0800 Subject: [PATCH 02/15] fix: fix checkbox vertical alignment. --- src/Semi.Avalonia/Controls/CheckBox.axaml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/Semi.Avalonia/Controls/CheckBox.axaml b/src/Semi.Avalonia/Controls/CheckBox.axaml index e1d9e21..8386807 100644 --- a/src/Semi.Avalonia/Controls/CheckBox.axaml +++ b/src/Semi.Avalonia/Controls/CheckBox.axaml @@ -15,15 +15,18 @@ + Grid.Column="0" + Margin="0,2,0,0" + VerticalAlignment="Center"> + Opacity="0" + Stretch="Uniform" /> + RecognizesAccessKey="True" + TextWrapping="Wrap" /> From b591c96968acca22fea3ec3f20bf494f47127f99 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Thu, 9 Feb 2023 22:28:58 +0800 Subject: [PATCH 03/15] Fix AutoCompleteBox default Border. Fix TextBox ClearButton layout. --- src/Semi.Avalonia/Controls/AutoCompleteBox.axaml | 1 + src/Semi.Avalonia/Controls/TextBox.axaml | 16 +++++++--------- .../Themes/Dark/AutoCompleteBox.axaml | 1 + .../Themes/Light/AutoCompleteBox.axaml | 1 + 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml b/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml index 19dc917..64a6416 100644 --- a/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml +++ b/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml @@ -8,6 +8,7 @@ + diff --git a/src/Semi.Avalonia/Controls/TextBox.axaml b/src/Semi.Avalonia/Controls/TextBox.axaml index 3d67fd1..c8afe84 100644 --- a/src/Semi.Avalonia/Controls/TextBox.axaml +++ b/src/Semi.Avalonia/Controls/TextBox.axaml @@ -48,15 +48,13 @@ - + + + From bef55df65b02077c3437708095b0f8705f64bb50 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Thu, 9 Feb 2023 22:43:55 +0800 Subject: [PATCH 05/15] fix: simplify checkbox layout. --- src/Semi.Avalonia/Controls/CheckBox.axaml | 26 +++++++------------ src/Semi.Avalonia/Themes/Dark/CheckBox.axaml | 5 ++++ src/Semi.Avalonia/Themes/Light/CheckBox.axaml | 8 +++++- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/Semi.Avalonia/Controls/CheckBox.axaml b/src/Semi.Avalonia/Controls/CheckBox.axaml index 8386807..9bab81d 100644 --- a/src/Semi.Avalonia/Controls/CheckBox.axaml +++ b/src/Semi.Avalonia/Controls/CheckBox.axaml @@ -36,18 +36,12 @@ BorderThickness="{DynamicResource CheckboxBoxBorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" UseLayoutRounding="False" /> + - - - - - - - @@ -140,9 +133,8 @@ - diff --git a/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml index e483028..1b0f815 100644 --- a/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml +++ b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml @@ -30,9 +30,14 @@ 14 16 16 + 12 + 12 400 3 8 0 0 0 1 + + M17.4111 7.30848C18.0692 7.81171 18.1947 8.75312 17.6915 9.41119L11.1915 17.9112C10.909 18.2806 10.4711 18.4981 10.0061 18.5C9.54105 18.5019 9.10143 18.288 8.81592 17.9209L5.31592 13.4209C4.80731 12.767 4.92512 11.8246 5.57904 11.316C6.23296 10.8074 7.17537 10.9252 7.68398 11.5791L9.98988 14.5438L15.3084 7.58884C15.8116 6.93077 16.7531 6.80525 17.4111 7.30848Z + M5 12.5C5 11.6716 5.67157 11 6.5 11H17.5C18.3284 11 19 11.6716 19 12.5C19 13.3284 18.3284 14 17.5 14H6.5C5.67157 14 5 13.3284 5 12.5Z diff --git a/src/Semi.Avalonia/Themes/Light/CheckBox.axaml b/src/Semi.Avalonia/Themes/Light/CheckBox.axaml index b0ceafe..b87b68c 100644 --- a/src/Semi.Avalonia/Themes/Light/CheckBox.axaml +++ b/src/Semi.Avalonia/Themes/Light/CheckBox.axaml @@ -1,5 +1,6 @@ @@ -29,9 +30,14 @@ 14 16 16 + 12 + 12 400 3 8 0 0 0 1 + + M17.4111 7.30848C18.0692 7.81171 18.1947 8.75312 17.6915 9.41119L11.1915 17.9112C10.909 18.2806 10.4711 18.4981 10.0061 18.5C9.54105 18.5019 9.10143 18.288 8.81592 17.9209L5.31592 13.4209C4.80731 12.767 4.92512 11.8246 5.57904 11.316C6.23296 10.8074 7.17537 10.9252 7.68398 11.5791L9.98988 14.5438L15.3084 7.58884C15.8116 6.93077 16.7531 6.80525 17.4111 7.30848Z + M5 12.5C5 11.6716 5.67157 11 6.5 11H17.5C18.3284 11 19 11.6716 19 12.5C19 13.3284 18.3284 14 17.5 14H6.5C5.67157 14 5 13.3284 5 12.5Z From 7fb3460e02e06706564eb46c79fcc83447fada61 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Thu, 9 Feb 2023 22:55:33 +0800 Subject: [PATCH 06/15] fix: more fix on file chooser. --- src/Semi.Avalonia/Controls/ManagedFileChooser.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml b/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml index 6671456..6be3470 100644 --- a/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml +++ b/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml @@ -70,12 +70,12 @@ From ee4a9c0e9a01ddba01881dc90e2f0f43ca072ad6 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Thu, 9 Feb 2023 23:19:12 +0800 Subject: [PATCH 07/15] fix: add default theme textelement handling. --- src/Semi.Avalonia/Controls/ThemeVariantScope.axaml | 3 +++ src/Semi.Avalonia/Themes/Base.axaml | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Semi.Avalonia/Controls/ThemeVariantScope.axaml b/src/Semi.Avalonia/Controls/ThemeVariantScope.axaml index 8540fc0..c7df298 100644 --- a/src/Semi.Avalonia/Controls/ThemeVariantScope.axaml +++ b/src/Semi.Avalonia/Controls/ThemeVariantScope.axaml @@ -2,5 +2,8 @@ + + + diff --git a/src/Semi.Avalonia/Themes/Base.axaml b/src/Semi.Avalonia/Themes/Base.axaml index e3c2410..c195896 100644 --- a/src/Semi.Avalonia/Themes/Base.axaml +++ b/src/Semi.Avalonia/Themes/Base.axaml @@ -1,7 +1,16 @@ + + + + + + + + 14 Inter, -apple-system,BlinkMacSystemFont,PingFang SC, Microsoft YaHei, Segoe UI, Hiragino Sans GB, Helvetica Neue,Helvetica,Arial,sans-serif Cascadia Code, Consolas, Inconsolata, monospace From 43db0c0293acf2c1849a725c9868881197db7e1d Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 10 Feb 2023 00:34:48 +0800 Subject: [PATCH 08/15] feat: add header for demo. --- demo/Semi.Avalonia.Demo/Pages/Overview.axaml | 12 - .../{Views => Themes}/TabMenu.axaml | 33 +-- .../Themes/ToggleButton.axaml | 33 +++ demo/Semi.Avalonia.Demo/Views/MainView.axaml | 272 ++++++++++-------- .../Views/MainView.axaml.cs | 13 + 5 files changed, 211 insertions(+), 152 deletions(-) rename demo/Semi.Avalonia.Demo/{Views => Themes}/TabMenu.axaml (57%) create mode 100644 demo/Semi.Avalonia.Demo/Themes/ToggleButton.axaml diff --git a/demo/Semi.Avalonia.Demo/Pages/Overview.axaml b/demo/Semi.Avalonia.Demo/Pages/Overview.axaml index 2e100a2..a2a8569 100644 --- a/demo/Semi.Avalonia.Demo/Pages/Overview.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/Overview.axaml @@ -9,18 +9,6 @@ mc:Ignorable="d"> - - - - diff --git a/demo/Semi.Avalonia.Demo/Views/TabMenu.axaml b/demo/Semi.Avalonia.Demo/Themes/TabMenu.axaml similarity index 57% rename from demo/Semi.Avalonia.Demo/Views/TabMenu.axaml rename to demo/Semi.Avalonia.Demo/Themes/TabMenu.axaml index 5c7a38f..0c9ec39 100644 --- a/demo/Semi.Avalonia.Demo/Views/TabMenu.axaml +++ b/demo/Semi.Avalonia.Demo/Themes/TabMenu.axaml @@ -12,27 +12,18 @@ BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"> - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo/Views/MainView.axaml b/demo/Semi.Avalonia.Demo/Views/MainView.axaml index 608e5e0..0074644 100644 --- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml +++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml @@ -11,126 +11,160 @@ - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs b/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs index 5464c27..b48ee71 100644 --- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs @@ -1,4 +1,7 @@ +using Avalonia; using Avalonia.Controls; +using Avalonia.Interactivity; +using Avalonia.Styling; namespace Semi.Avalonia.Demo.Views; @@ -8,4 +11,14 @@ public partial class MainView : UserControl { InitializeComponent(); } + + private void ToggleButton_OnIsCheckedChanged(object sender, RoutedEventArgs e) + { + var app = Application.Current; + if (app is not null) + { + var theme = app.ActualThemeVariant; + app.RequestedThemeVariant = theme == ThemeVariant.Dark ? ThemeVariant.Default : ThemeVariant.Dark; + } + } } \ No newline at end of file From 0d306bdf518c04cdf96e95810ab38cabccf666fc Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 10 Feb 2023 00:49:07 +0800 Subject: [PATCH 09/15] fix: fix theme toggle. --- demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs b/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs index b48ee71..3a69c9c 100644 --- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs @@ -18,7 +18,7 @@ public partial class MainView : UserControl if (app is not null) { var theme = app.ActualThemeVariant; - app.RequestedThemeVariant = theme == ThemeVariant.Dark ? ThemeVariant.Default : ThemeVariant.Dark; + app.RequestedThemeVariant = theme == ThemeVariant.Dark ? ThemeVariant.Light : ThemeVariant.Dark; } } } \ No newline at end of file From f8188a43bcb340183fef619679fbb84c62dd3b40 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 10 Feb 2023 01:17:30 +0800 Subject: [PATCH 10/15] fix: fix split button separator. --- demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml | 6 +++--- src/Semi.Avalonia/Controls/SplitButton.axaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml index fdd9d20..bbd60b0 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml @@ -46,7 +46,7 @@ DropdownButton - + @@ -72,7 +72,7 @@ - + @@ -90,7 +90,7 @@ Content="Submit" IsEnabled="False" /> - + diff --git a/src/Semi.Avalonia/Controls/SplitButton.axaml b/src/Semi.Avalonia/Controls/SplitButton.axaml index f4cf5ae..906a5eb 100644 --- a/src/Semi.Avalonia/Controls/SplitButton.axaml +++ b/src/Semi.Avalonia/Controls/SplitButton.axaml @@ -46,7 +46,7 @@ x:Name="SeparatorBorder" Grid.Column="1" Width="{DynamicResource SplitButtonSeparatorWidth}" - Background="White" + Background="Transparent" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0.5" /> From 42c526f9278cac562162479c6fb65c7bfe0e7746 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 10 Feb 2023 11:02:40 +0800 Subject: [PATCH 11/15] fix: temporarily fix combobox demo display issue. --- .../Pages/ComboBoxDemo.axaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml index eca2b5e..df5a595 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml @@ -9,19 +9,19 @@ mc:Ignorable="d"> - AAA - BBB - CCC + AAA + BBB + CCC - AAA - BBB - CCC + AAA + BBB + CCC - AAA - BBB - CCC + AAA + BBB + CCC From 0797e2e5df253d36f74b8d9f5a9f8800bc7c2fea Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 10 Feb 2023 11:16:05 +0800 Subject: [PATCH 12/15] fix: fix file chooser selection. --- src/Semi.Avalonia/Controls/ManagedFileChooser.axaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml b/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml index 6be3470..c9608ff 100644 --- a/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml +++ b/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml @@ -139,7 +139,11 @@ - + From 7cababb1400078543fc444f8c2543fcf2b6041fd Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 10 Feb 2023 12:05:54 +0800 Subject: [PATCH 13/15] fix Checkbox null content behavior, and icon stretch in menu. --- demo/Semi.Avalonia.Demo/Pages/MenuDemo.axaml | 2 ++ src/Semi.Avalonia/Controls/CheckBox.axaml | 4 +++- src/Semi.Avalonia/Controls/Menu.axaml | 12 +++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/MenuDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/MenuDemo.axaml index fb31939..52d3b0d 100644 --- a/demo/Semi.Avalonia.Demo/Pages/MenuDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/MenuDemo.axaml @@ -89,6 +89,7 @@ @@ -115,6 +116,7 @@ diff --git a/src/Semi.Avalonia/Controls/CheckBox.axaml b/src/Semi.Avalonia/Controls/CheckBox.axaml index 9bab81d..fde8b43 100644 --- a/src/Semi.Avalonia/Controls/CheckBox.axaml +++ b/src/Semi.Avalonia/Controls/CheckBox.axaml @@ -25,7 +25,7 @@ diff --git a/src/Semi.Avalonia/Controls/Menu.axaml b/src/Semi.Avalonia/Controls/Menu.axaml index a9316fe..2a13721 100644 --- a/src/Semi.Avalonia/Controls/Menu.axaml +++ b/src/Semi.Avalonia/Controls/Menu.axaml @@ -132,15 +132,17 @@ - + Stretch="Uniform"> + Date: Fri, 10 Feb 2023 23:58:12 +0800 Subject: [PATCH 14/15] fix: fix colorpicker layout, remove datagrid animation. --- src/Semi.Avalonia.ColorPicker/Controls/ColorView.axaml | 3 ++- src/Semi.Avalonia.DataGrid/DataGrid.axaml | 8 +------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Semi.Avalonia.ColorPicker/Controls/ColorView.axaml b/src/Semi.Avalonia.ColorPicker/Controls/ColorView.axaml index 80b6429..b6aab24 100644 --- a/src/Semi.Avalonia.ColorPicker/Controls/ColorView.axaml +++ b/src/Semi.Avalonia.ColorPicker/Controls/ColorView.axaml @@ -317,7 +317,8 @@ + RowDefinitions="Auto,24,1*,1*,1*,1*,12" + UseLayoutRounding="False"> @@ -387,13 +391,7 @@ Minimum="{Binding Minimum, ElementName=Component1Slider}" NumberFormat="{StaticResource ColorViewComponentNumberFormat}" ShowButtonSpinner="False" - Value="{Binding Value, ElementName=Component1Slider}"> - - - - + Value="{Binding Value, ElementName=Component1Slider}" />