diff --git a/README.md b/README.md index f8309f1..9050702 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,11 @@ Avalonia Theme inspired by Semi Design -> Semi.Avalonia is still in very early stage. Please don't use in production. - # How to Use ## Installation ```bash -dotnet add package Semi.Avalonia --version 0.1.0-preview8 +dotnet add package Semi.Avalonia --version 11.0.0-rc1 ``` Include Semi Design Styles in application: @@ -25,8 +23,8 @@ That's all. DataGrid and ColorPicker are distributed in separated packages. Please install if you need. ```bash -dotnet add package Semi.Avalonia.ColorPicker --version 0.1.0-preview8 -dotnet add package Semi.Avalonia.DataGrid --version 0.1.0-preview8 +dotnet add package Semi.Avalonia.ColorPicker --version 11.0.0-rc1 +dotnet add package Semi.Avalonia.DataGrid --version 11.0.0-rc1 ``` ```xaml @@ -44,6 +42,7 @@ https://github.com/irihitech/Semi.Avalonia/releases | Semi Design Version | Avalonia Version | |:--------------------|:-----------------| +| 11.0.0-rc1 | 11.0.0-rc1.1 | | 0.1.0-preview3 | 11.0-preview4 | | 0.1.0-preview5.x | 11.0-preview5 | | 0.1.0-preview6.x | 11.0-preview6 | diff --git a/demo/Directory.Build.props b/demo/Directory.Build.props index 4b12cba..5a014d1 100644 --- a/demo/Directory.Build.props +++ b/demo/Directory.Build.props @@ -1,6 +1,6 @@ enable - 11.0.0-preview8 + 11.0.0-rc1.1 diff --git a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml new file mode 100644 index 0000000..d5c312b --- /dev/null +++ b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml @@ -0,0 +1,14 @@ + + + + + Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。 + + + + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml.cs new file mode 100644 index 0000000..fa951c1 --- /dev/null +++ b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace Semi.Avalonia.Demo.Pages; + +public partial class HeaderedContentControlDemo : UserControl +{ + public HeaderedContentControlDemo() + { + InitializeComponent(); + } +} \ 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 8064cfc..5bf1e7f 100644 --- a/demo/Semi.Avalonia.Demo/Pages/RepeatButtonDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/RepeatButtonDemo.axaml @@ -13,6 +13,7 @@ Primary Secondary Tertiary + Success Warning Danger Danger @@ -22,6 +23,7 @@ Primary Secondary Tertiary + Success Warning Danger Primary Secondary Tertiary + Success Warning Danger + Fill="{DynamicResource SemiYellow2}" /> + Fill="{DynamicResource SemiYellow2}" /> diff --git a/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml index 5b3a663..4cbba96 100644 --- a/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml @@ -4,10 +4,13 @@ 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" + xmlns:vm="clr-namespace:Semi.Avalonia.Demo.Pages" d:DesignHeight="450" d:DesignWidth="800" + x:CompileBindings="True" + x:DataType="vm:TreeViewVm" mc:Ignorable="d"> - + @@ -42,5 +45,12 @@ - + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml.cs index 523ce73..1bd90f7 100644 --- a/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml.cs @@ -1,6 +1,8 @@ +using System.Collections.ObjectModel; using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; +using CommunityToolkit.Mvvm.ComponentModel; namespace Semi.Avalonia.Demo.Pages; @@ -9,5 +11,34 @@ public partial class TreeViewDemo : UserControl public TreeViewDemo() { InitializeComponent(); + this.DataContext = new TreeViewVm(); } +} + +public class TreeViewVm : ObservableObject +{ + public ObservableCollection Items { get; set; } + + public TreeViewVm() + { + Items = new ObservableCollection() + { + new TreeViewItemVm() {Name = "Item 1", Id = "1"}, + new TreeViewItemVm() {Name = "Item 2", Id = "2"}, + new TreeViewItemVm() {Name = "Item 3", Id = "3", Items = new ObservableCollection() + { + new TreeViewItemVm() {Name = "Item 3.1", Id = "3.1"}, + new TreeViewItemVm() {Name = "Item 3.2", Id = "3.2"}, + new TreeViewItemVm() {Name = "Item 3.3", Id = "3.3"}, + }, + }, + }; + } +} + +public partial class TreeViewItemVm : ObservableObject +{ + public ObservableCollection Items { get; set; } + public string Name { get; set; } + public string Id { get; set; } } \ 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 39aa54d..13b37f7 100644 --- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml +++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml @@ -123,6 +123,9 @@ + + + diff --git a/src/Package.props b/src/Package.props index 4b0f2f6..0143a6e 100644 --- a/src/Package.props +++ b/src/Package.props @@ -3,11 +3,11 @@ net6.0;netstandard2.0 enable 10 - 0.1.0-preview8 + 11.0.0-rc1 IRIHI Technology Avalonia Theme inspired by Semi Design. https://github.com/irihitech/Semi.Avalonia - 11.0.0-preview8 + 11.0.0-rc1.1 MIT \ No newline at end of file diff --git a/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml b/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml index 08315af..396c747 100644 --- a/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml +++ b/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml @@ -135,8 +135,8 @@ ColorComponent="{Binding ThirdComponent, ElementName=ColorSpectrum}" ColorModel="Hsva" HsvColor="{Binding HsvColor, ElementName=ColorSpectrum}" - IsAlphaMaxForced="True" - IsSaturationValueMaxForced="False" + IsAlphaVisible="True" + IsPerceptive="False" IsVisible="{TemplateBinding IsColorSpectrumSliderVisible}" Orientation="Vertical" /> Semi.Avalonia.ColorPicker - Update to Avalonia 11.0.0-preview8 + Update to Avalonia 11.0.0-rc1 diff --git a/src/Semi.Avalonia.DataGrid/Semi.Avalonia.DataGrid.csproj b/src/Semi.Avalonia.DataGrid/Semi.Avalonia.DataGrid.csproj index 4cc36a5..e84e6b4 100644 --- a/src/Semi.Avalonia.DataGrid/Semi.Avalonia.DataGrid.csproj +++ b/src/Semi.Avalonia.DataGrid/Semi.Avalonia.DataGrid.csproj @@ -4,7 +4,7 @@ Semi.Avalonia.DataGrid - Update to Avalonia 11.0.0-preview8 + Update to Avalonia 11.0.0-rc1 diff --git a/src/Semi.Avalonia/Controls/Controls.axaml b/src/Semi.Avalonia/Controls/Controls.axaml index 1674a64..7933d64 100644 --- a/src/Semi.Avalonia/Controls/Controls.axaml +++ b/src/Semi.Avalonia/Controls/Controls.axaml @@ -24,6 +24,7 @@ + diff --git a/src/Semi.Avalonia/Controls/HeaderedContentControl.axaml b/src/Semi.Avalonia/Controls/HeaderedContentControl.axaml new file mode 100644 index 0000000..918dc26 --- /dev/null +++ b/src/Semi.Avalonia/Controls/HeaderedContentControl.axaml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Controls/Label.axaml b/src/Semi.Avalonia/Controls/Label.axaml index 052394a..1f5945d 100644 --- a/src/Semi.Avalonia/Controls/Label.axaml +++ b/src/Semi.Avalonia/Controls/Label.axaml @@ -342,6 +342,7 @@ diff --git a/src/Semi.Avalonia/Controls/ScrollViewer.axaml b/src/Semi.Avalonia/Controls/ScrollViewer.axaml index 6960c16..9bda75f 100644 --- a/src/Semi.Avalonia/Controls/ScrollViewer.axaml +++ b/src/Semi.Avalonia/Controls/ScrollViewer.axaml @@ -214,13 +214,14 @@ Background="{TemplateBinding Background}" HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}" HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}" + ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}" VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}" VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}"> + IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}" /> + IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}" /> - + + + + diff --git a/src/Semi.Avalonia/Controls/TreeView.axaml b/src/Semi.Avalonia/Controls/TreeView.axaml index 863244f..4904225 100644 --- a/src/Semi.Avalonia/Controls/TreeView.axaml +++ b/src/Semi.Avalonia/Controls/TreeView.axaml @@ -131,6 +131,7 @@ HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Content="{TemplateBinding Header}" + ContentTemplate="{TemplateBinding HeaderTemplate}" Focusable="False" Foreground="{TemplateBinding Foreground}" /> diff --git a/src/Semi.Avalonia/Semi.Avalonia.csproj b/src/Semi.Avalonia/Semi.Avalonia.csproj index 23333d8..9579c92 100644 --- a/src/Semi.Avalonia/Semi.Avalonia.csproj +++ b/src/Semi.Avalonia/Semi.Avalonia.csproj @@ -4,7 +4,7 @@ Semi.Avalonia - Update to Avalonia 11.0.0-preview8 + Update to Avalonia 11.0.0-rc1 diff --git a/src/Semi.Avalonia/Themes/Dark/Button.axaml b/src/Semi.Avalonia/Themes/Dark/Button.axaml index 5586dc2..131c68d 100644 --- a/src/Semi.Avalonia/Themes/Dark/Button.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Button.axaml @@ -36,7 +36,7 @@ - + diff --git a/src/Semi.Avalonia/Themes/Dark/Dark.axaml b/src/Semi.Avalonia/Themes/Dark/Dark.axaml index b588cdd..03fb808 100644 --- a/src/Semi.Avalonia/Themes/Dark/Dark.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Dark.axaml @@ -19,6 +19,7 @@ + diff --git a/src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml b/src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml new file mode 100644 index 0000000..5a991bb --- /dev/null +++ b/src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml @@ -0,0 +1,6 @@ + + + + 4 + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/Label.axaml b/src/Semi.Avalonia/Themes/Dark/Label.axaml index 7f23e92..a7e2ce0 100644 --- a/src/Semi.Avalonia/Themes/Dark/Label.axaml +++ b/src/Semi.Avalonia/Themes/Dark/Label.axaml @@ -1,5 +1,6 @@ @@ -28,8 +29,8 @@ - - + + @@ -40,13 +41,13 @@ - - + + - - + + @@ -80,10 +81,11 @@ + - + diff --git a/src/Semi.Avalonia/Themes/Dark/ToggleButton.axaml b/src/Semi.Avalonia/Themes/Dark/ToggleButton.axaml index 9f01c67..0c35d26 100644 --- a/src/Semi.Avalonia/Themes/Dark/ToggleButton.axaml +++ b/src/Semi.Avalonia/Themes/Dark/ToggleButton.axaml @@ -49,7 +49,7 @@ - + diff --git a/src/Semi.Avalonia/Themes/Light/HeaderedContentControl.axaml b/src/Semi.Avalonia/Themes/Light/HeaderedContentControl.axaml new file mode 100644 index 0000000..8c35c3d --- /dev/null +++ b/src/Semi.Avalonia/Themes/Light/HeaderedContentControl.axaml @@ -0,0 +1,6 @@ + + + + 4 + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/Label.axaml b/src/Semi.Avalonia/Themes/Light/Label.axaml index 4ad4f42..b2ee04d 100644 --- a/src/Semi.Avalonia/Themes/Light/Label.axaml +++ b/src/Semi.Avalonia/Themes/Light/Label.axaml @@ -28,8 +28,8 @@ - - + + diff --git a/src/Semi.Avalonia/Themes/Light/Light.axaml b/src/Semi.Avalonia/Themes/Light/Light.axaml index 2116c6b..3eb48db 100644 --- a/src/Semi.Avalonia/Themes/Light/Light.axaml +++ b/src/Semi.Avalonia/Themes/Light/Light.axaml @@ -18,6 +18,7 @@ +