Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport the lastest features to 11.1.x #484

Merged
merged 42 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
62935ee
misc: revert high-contrast Theme feat.
zdpcdt Dec 2, 2024
f7ef821
fix: fix palette demo initial data context issue.
rabbitism Oct 2, 2024
9fc2457
[Update] - Add Ukrainian localization and make minimal stylistic adju…
kYaRick Oct 6, 2024
9bb9aa2
feat: add the Second text to ja-jp.
zdpcdt Oct 31, 2024
12f3a63
fix: fix the issue of Ukrainian abbreviation errors causing it to not…
zdpcdt Nov 22, 2024
8f649e2
feat: add missing translation.
zdpcdt Dec 2, 2024
53cdfec
feat: make group header customizable.
rabbitism Oct 8, 2024
6b72dfa
feat: make colorpicker dropdown button customizable.
rabbitism Oct 18, 2024
0ced8e6
misc: clean prefix Control.
zdpcdt Nov 6, 2024
f1836b0
misc: replace x:Name to Name.
zdpcdt Nov 7, 2024
782749f
fix: unify RadioButton & CheckBox themes of ListBox.
zdpcdt Nov 6, 2024
3a6fe15
feat: using RadioButton & CheckBox Resources instead of creating newl…
zdpcdt Nov 7, 2024
ab3d88a
feat: design an AdornerLayer for Solid Button.
zdpcdt Nov 7, 2024
7fcedf1
feat: redesign HyperlinkButton.
zdpcdt Nov 8, 2024
4da2467
feat: redesign GroupBox theme for HeaderedContentControl.
zdpcdt Nov 8, 2024
d1c38db
misc: Restore > to >.
zdpcdt Nov 12, 2024
ffbfe95
feat: adjust ComboBox, ListBox, DatePicker & TimePicker item Padding.
zdpcdt Nov 12, 2024
590d141
feat: extract ComboBox resources.
zdpcdt Nov 12, 2024
26549f0
feat: extract CommunityToolkit version.
zdpcdt Nov 12, 2024
cd2c4bd
feat: resolve AOT issue.
zdpcdt Nov 12, 2024
45b33bb
feat: add basic BoxShadows.
zdpcdt Nov 8, 2024
b23f79f
fix: fix BoxShadows.
zdpcdt Nov 13, 2024
c87f6a8
fix: fix popup BoxShadow and unclosed corner issues.
zdpcdt Nov 14, 2024
ebdb0b1
misc: format codes.
zdpcdt Nov 14, 2024
d039440
feat: add Shadow part to PaletteDemo.
zdpcdt Nov 14, 2024
8e88f79
misc: unify BoxShadows resources.
zdpcdt Nov 14, 2024
c30f8d2
fix: fix font issue in WASM demo.
zdpcdt Nov 15, 2024
0ecb6e5
feat: add pack&publish scripts to workflow.
zdpcdt Nov 15, 2024
ea895c9
misc: add Version markup to TreeDataGrid.csproj.
zdpcdt Nov 15, 2024
0404111
feat: redesign inner PathIcon.
zdpcdt Nov 18, 2024
ed0e256
feat: adjust the rest of PathIcon.
zdpcdt Nov 18, 2024
3bc7383
fix: fix DatePicker & TimePicker icon Margin.
zdpcdt Nov 19, 2024
237fe72
feat: enhance Carousel.
zdpcdt Nov 19, 2024
eb1748a
feat: simplify MainView.
zdpcdt Nov 24, 2024
483a909
feat: add new Theme - ThemeToggleSwitch.
zdpcdt Nov 27, 2024
5273898
misc: swap SimpleToggleSwitch & ButtonToggleSwitch.
zdpcdt Nov 29, 2024
f3aad8d
misc: enhance Switch.
zdpcdt Nov 29, 2024
ee3fa83
fix: fix Switch BorderThickness issue.
zdpcdt Nov 29, 2024
8563ad9
feat: redesign ButtonToggleSwitch.
zdpcdt Dec 1, 2024
a9526fb
fix: fix popup Padding.
zdpcdt Dec 1, 2024
6c2c7ef
feat: align with the part of TextBox.
zdpcdt Dec 1, 2024
bb85123
feat: remove Calendar BorderThickness.
zdpcdt Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/pack-tree.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pack TreeDataGrid Nuget

on:
push:
branches: [ "action/pack-tree" ]
pull_request:
branches: [ "action/pack-tree" ]

jobs:
nuget:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1

- name: Nuget Semi.Avalonia.TreeDataGrid
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets

- name: Publish NuGet package
run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
with:
name: nugets
path: ./nugets
4 changes: 2 additions & 2 deletions .github/workflows/pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- name: Nuget Semi.Avalonia.DataGrid
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets

- name: Nuget Semi.Avalonia.TreeDataGrid
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
- name: Publish NuGet package
run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
Expand Down
8 changes: 8 additions & 0 deletions Semi.Avalonia.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
src\Package.props = src\Package.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Action", "GitHub Action", "{318534A1-1CC3-40FB-B4AE-736F94465232}"
ProjectSection(SolutionItems) = preProject
.github\workflows\deploy.yml = .github\workflows\deploy.yml
.github\workflows\pack.yml = .github\workflows\pack.yml
.github\workflows\pack-tree.yml = .github\workflows\pack-tree.yml
.github\workflows\publish.yml = .github\workflows\publish.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{43091528-9509-43CB-A003-9C5C11E96DD6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Desktop", "demo\Semi.Avalonia.Demo.Desktop\Semi.Avalonia.Demo.Desktop.csproj", "{2ADCA724-2B6D-46EC-87F7-604D7918B89A}"
Expand Down
1 change: 1 addition & 0 deletions demo/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<PropertyGroup>
<Nullable>enable</Nullable>
<AvaloniaVersion>11.1.3</AvaloniaVersion>
<CommunityToolkitVersion>8.3.2</CommunityToolkitVersion>
</PropertyGroup>
</Project>
6 changes: 3 additions & 3 deletions demo/Semi.Avalonia.Demo.Desktop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class Program
public static void Main(string[] args) => BuildAvaloniaApp()
.With(new FontManagerOptions
{
FontFallbacks = new[]
{
FontFallbacks =
[
new FontFallback
{
FontFamily = new FontFamily("Microsoft YaHei")
}
}
]
})
.StartWithClassicDesktopLifetime(args);

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public static AppBuilder WithSourceHanSansCNFont(this AppBuilder builder) =>
builder.With(new FontManagerOptions
{
DefaultFamilyName = DefaultFontFamily,
FontFallbacks = new[] { new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) } }
FontFallbacks = [new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) }]
});
}
1 change: 1 addition & 0 deletions demo/Semi.Avalonia.Demo/Controls/ColorDetailControl.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
x:DataType="viewModels:ColorItemViewModel">
<StreamGeometry x:Key="CopyIcon">M5 7C3.89543 7 3 7.89543 3 9V19C3 20.1046 3.89543 21 5 21H15C16.1046 21 17 20.1046 17 19V9C17 7.89543 16.1046 7 15 7H5Z,M7 4C7 2.89543 7.89543 2 9 2H20C21.1046 2 22 2.89543 22 4V15C22 16.1046 21.1046 17 20 17H19V8C19 6 18 5 16 5H7V4Z</StreamGeometry>
<ControlTheme x:Key="{x:Type controls:ColorDetailControl}" TargetType="controls:ColorDetailControl">
<!-- Add Resources Here -->
<Setter Property="controls:ColorDetailControl.Template">
<ControlTemplate TargetType="controls:ColorDetailControl">
<StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
x:CompileBindings="True"
x:DataType="viewModels:FunctionalColorGroupViewModel">
<ControlTheme x:Key="{x:Type controls:FunctionalColorGroupControl}" TargetType="controls:FunctionalColorGroupControl">
<Setter Property="controls:FunctionalColorGroupControl.Template">
<ControlTemplate x:DataType="viewModels:FunctionalColorGroupViewModel" TargetType="controls:FunctionalColorGroupControl">
<Setter Property="Template">
<ControlTemplate TargetType="controls:FunctionalColorGroupControl">
<Grid RowDefinitions="Auto, *">
<TextBlock
<SelectableTextBlock
Grid.Row="0"
Margin="0,16,0,0"
Classes="H3"
Text="{TemplateBinding Title}"
Theme="{DynamicResource TitleTextBlock}" />
Theme="{DynamicResource TitleSelectableTextBlock}" />
<TabControl Grid.Row="1">
<TabItem Header="Light">
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding LightColors}">
Expand Down Expand Up @@ -129,4 +129,4 @@
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>
</ResourceDictionary>
27 changes: 16 additions & 11 deletions demo/Semi.Avalonia.Demo/Controls/FunctionalColorGroupControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,38 @@

namespace Semi.Avalonia.Demo.Controls;

public class FunctionalColorGroupControl: TemplatedControl
public class FunctionalColorGroupControl : TemplatedControl
{
public static readonly StyledProperty<string?> TitleProperty = AvaloniaProperty.Register<FunctionalColorGroupControl, string?>(
nameof(Title));
public static readonly StyledProperty<string?> TitleProperty =
AvaloniaProperty.Register<FunctionalColorGroupControl, string?>(nameof(Title));

public string? Title
{
get => GetValue(TitleProperty);
set => SetValue(TitleProperty, value);
}

public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> LightColorsProperty = AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(
nameof(LightColors), o => o.LightColors, (o, v) => o.LightColors = v);

public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> LightColorsProperty =
AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(nameof(LightColors),
o => o.LightColors, (o, v) => o.LightColors = v);

private IEnumerable? _lightColors;

public IEnumerable? LightColors
{
get => _lightColors;
set => SetAndRaise(LightColorsProperty, ref _lightColors, value);
}

public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> DarkColorsProperty = AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(
nameof(DarkColors), o => o.DarkColors, (o, v) => o.DarkColors = v);

public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> DarkColorsProperty =
AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(nameof(DarkColors),
o => o.DarkColors, (o, v) => o.DarkColors = v);

private IEnumerable? _darkColors;

public IEnumerable? DarkColors
{
get => _darkColors;
set => SetAndRaise(DarkColorsProperty, ref _darkColors, value);
}


}
88 changes: 88 additions & 0 deletions demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
x:CompileBindings="True"
x:DataType="viewModels:ShadowGroupViewModel">
<ControlTheme x:Key="{x:Type controls:ShadowGroupControl}" TargetType="controls:ShadowGroupControl">
<Setter Property="Template">
<ControlTemplate TargetType="controls:ShadowGroupControl">
<Grid RowDefinitions="Auto, *">
<SelectableTextBlock
Grid.Row="0"
Margin="0,16,0,0"
Classes="H3"
Text="{TemplateBinding Title}"
Theme="{DynamicResource TitleSelectableTextBlock}" />
<TabControl Grid.Row="1">
<TabItem Header="Light">
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding LightShadows}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="*" Header="ResourceKey">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ShadowItemViewModel">
<SelectableTextBlock
Margin="12,0,12,0"
VerticalAlignment="Center"
Text="{Binding ResourceKey}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn
Width="*"
x:DataType="viewModels:ShadowItemViewModel"
Binding="{Binding ShadowDisplayName}"
CanUserSort="False"
Header="Name" />
<DataGridTemplateColumn Width="300" Header="BoxShadows">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ShadowItemViewModel">
<SelectableTextBlock
Margin="12,0,12,0"
VerticalAlignment="Center"
Text="{Binding BoxShadowValue}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</TabItem>
<TabItem Header="Dark">
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding DarkShadows}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="*" Header="ResourceKey">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ShadowItemViewModel">
<SelectableTextBlock
Margin="12,0,12,0"
VerticalAlignment="Center"
Text="{Binding ResourceKey}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn
Width="*"
x:DataType="viewModels:ShadowItemViewModel"
Binding="{Binding ShadowDisplayName}"
CanUserSort="False"
Header="Name" />
<DataGridTemplateColumn Width="300" Header="BoxShadows">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ShadowItemViewModel">
<SelectableTextBlock
Margin="12,0,12,0"
VerticalAlignment="Center"
Text="{Binding BoxShadowValue}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</TabItem>
</TabControl>
</Grid>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>
41 changes: 41 additions & 0 deletions demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System.Collections;
using Avalonia;
using Avalonia.Controls.Primitives;

namespace Semi.Avalonia.Demo.Controls;

public class ShadowGroupControl : TemplatedControl
{
public static readonly StyledProperty<string?> TitleProperty =
AvaloniaProperty.Register<ShadowGroupControl, string?>(nameof(Title));

public string? Title
{
get => GetValue(TitleProperty);
set => SetValue(TitleProperty, value);
}

private IEnumerable? _lightShadows;

public static readonly DirectProperty<ShadowGroupControl, IEnumerable?> LightShadowsProperty =
AvaloniaProperty.RegisterDirect<ShadowGroupControl, IEnumerable?>(nameof(LightShadows),
o => o.LightShadows, (o, v) => o.LightShadows = v);

public IEnumerable? LightShadows
{
get => _lightShadows;
set => SetAndRaise(LightShadowsProperty, ref _lightShadows, value);
}

private IEnumerable? _darkShadows;

public static readonly DirectProperty<ShadowGroupControl, IEnumerable?> DarkShadowsProperty =
AvaloniaProperty.RegisterDirect<ShadowGroupControl, IEnumerable?>(nameof(DarkShadows),
o => o.DarkShadows, (o, v) => o.DarkShadows = v);

public IEnumerable? DarkShadows
{
get => _darkShadows;
set => SetAndRaise(DarkShadowsProperty, ref _darkShadows, value);
}
}
Loading