Compare commits

...

12 Commits

Author SHA1 Message Date
Zhang Dian
6459863395 misc: bump version. 2024-12-31 14:18:23 +08:00
Dong Bin
ab824fbcd2 Merge pull request #516 from irihitech/detail
fix Hex Color code in demo
2024-12-31 14:09:16 +08:00
Zhang Dian
e4adde26d2 fix: fix AOT issue. 2024-12-31 13:59:30 +08:00
Zhang Dian
057c31a311 feat: Color.ToString() -> real Hex. 2024-12-31 13:22:06 +08:00
Zhang Dian
ef8531d25d misc: rearrange demo theme resources. 2024-12-31 13:22:05 +08:00
Zhang Dian
c44b9a0173 fix: fix debug crash issue. 2024-12-31 13:22:05 +08:00
Zhang Dian
5715bba345 fix: add the missing basic color. 2024-12-31 13:21:30 +08:00
Zhang Dian
96b0999db1 fix: fix AOT issue. 2024-12-30 23:54:15 +08:00
Zhang Dian
ffd9b08acc fix: fix the issue of input value invalid. 2024-12-30 16:50:59 +08:00
Zhang Dian
64fd8a787a misc: enhance .csproj files. 2024-12-30 16:19:30 +08:00
Zhang Dian
4087b685e8 misc: resolve IDE problems. 2024-12-30 15:16:14 +08:00
Zhang Dian
70669406b2 misc: fix missing reference issue. 2024-12-30 14:06:19 +08:00
33 changed files with 193 additions and 158 deletions

View File

@@ -44,17 +44,17 @@ jobs:
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
- name: Enable Native AOT in .csproj - name: Enable Native AOT in .csproj
if: ${{ github.event.inputs.include_aot == true }} if: ${{ github.event.inputs.include_aot == 'true' }}
run: | run: |
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
- name: Publish win-x64 AOT - name: Publish win-x64 AOT
if: ${{ github.event.inputs.include_aot == true }} if: ${{ github.event.inputs.include_aot == 'true' }}
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
- name: Zip win-x64 AOT - name: Zip win-x64 AOT
if: ${{ github.event.inputs.include_aot == true }} if: ${{ github.event.inputs.include_aot == 'true' }}
run: | run: |
$files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb $files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
@@ -82,11 +82,11 @@ jobs:
run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb" run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
- name: Publish linux-x64 DRM - name: Publish linux-x64 DRM
if: ${{ github.event.inputs.include_drm == true }} if: ${{ github.event.inputs.include_drm == 'true' }}
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/drm run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/drm
- name: Zip linux-x64 DRM - name: Zip linux-x64 DRM
if: ${{ github.event.inputs.include_drm == true }} if: ${{ github.event.inputs.include_drm == 'true' }}
run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb" run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
- name: Upload a Build Artifact - name: Upload a Build Artifact

View File

@@ -1,7 +1,6 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Nullable>enable</Nullable> <AvaloniaVersion>11.2.3</AvaloniaVersion>
<AvaloniaVersion>11.2.2</AvaloniaVersion> <CommunityToolkitVersion>8.4.0</CommunityToolkitVersion>
<CommunityToolkitVersion>8.3.2</CommunityToolkitVersion> </PropertyGroup>
</PropertyGroup>
</Project> </Project>

View File

@@ -1,13 +1,11 @@
using Avalonia; using System;
using Avalonia;
using Avalonia.Dialogs; using Avalonia.Dialogs;
using Avalonia.Media; using Avalonia.Media;
using System;
using System.Linq;
using System.Threading;
namespace Semi.Avalonia.Demo.Desktop; namespace Semi.Avalonia.Demo.Desktop;
class Program sealed class Program
{ {
// Initialization code. Don't use any Avalonia, third-party APIs or any // Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
@@ -33,4 +31,4 @@ class Program
.UsePlatformDetect() .UsePlatformDetect()
.With(new Win32PlatformOptions()) .With(new Win32PlatformOptions())
.LogToTrace(); .LogToTrace();
} }

View File

@@ -19,16 +19,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<TrimmerRootDescriptor Include="Roots.xml" /> <TrimmerRootDescriptor Include="Roots.xml"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" /> <PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" /> <ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -7,7 +7,7 @@ using Avalonia.Dialogs;
namespace Semi.Avalonia.Demo.Drm; namespace Semi.Avalonia.Demo.Drm;
class Program sealed class Program
{ {
// Initialization code. Don't use any Avalonia, third-party APIs or any // Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized // SynchronizationContext-reliant code before AppMain is called: things aren't initialized

View File

@@ -19,17 +19,15 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<TrimmerRootDescriptor Include="Roots.xml" /> <TrimmerRootDescriptor Include="Roots.xml"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" /> <PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <PackageReference Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)"/>
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" /> <ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -3,6 +3,7 @@
<TargetFramework>net8.0-browser</TargetFramework> <TargetFramework>net8.0-browser</TargetFramework>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -7,8 +7,15 @@
<!-- You can still reference in old way. --> <!-- You can still reference in old way. -->
<!-- <StyleInclude Source="avares://Semi.Avalonia/Index.axaml" /> --> <!-- <StyleInclude Source="avares://Semi.Avalonia/Index.axaml" /> -->
<semi:SemiTheme Locale="zh-CN" /> <semi:SemiTheme Locale="zh-CN" />
<semi:SemiPopupAnimations/> <semi:SemiPopupAnimations />
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" /> <StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" /> <StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
</Application.Styles> </Application.Styles>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="Themes/_index.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application> </Application>

View File

@@ -1,8 +1,10 @@
using System.Globalization; using System.Globalization;
using System.Threading.Tasks;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Primitives; using Avalonia.Controls.Primitives;
using Avalonia.Media; using Avalonia.Media;
using Semi.Avalonia.Demo.Converters;
namespace Semi.Avalonia.Demo.Controls; namespace Semi.Avalonia.Demo.Controls;
@@ -10,6 +12,7 @@ public class ColorDetailControl : TemplatedControl
{ {
public const string KEY_ResourceKey = "ResourceKey"; public const string KEY_ResourceKey = "ResourceKey";
public const string KEY_Hex = "Hex"; public const string KEY_Hex = "Hex";
public const string KEY_Hex2 = "Hex2";
public const string KEY_Opacity = "Opacity"; public const string KEY_Opacity = "Opacity";
public const string KEY_ColorResourceKey = "ColorResourceKey"; public const string KEY_ColorResourceKey = "ColorResourceKey";
@@ -51,6 +54,17 @@ public class ColorDetailControl : TemplatedControl
private set => SetAndRaise(HexProperty, ref _hex, value); private set => SetAndRaise(HexProperty, ref _hex, value);
} }
private string? _hex2;
public static readonly DirectProperty<ColorDetailControl, string?> Hex2Property =
AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(nameof(Hex2), o => o.Hex2);
public string? Hex2
{
get => _hex2;
set => SetAndRaise(Hex2Property, ref _hex2, value);
}
public static readonly DirectProperty<ColorDetailControl, string?> OpacityNumberProperty = public static readonly DirectProperty<ColorDetailControl, string?> OpacityNumberProperty =
AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(nameof(OpacityNumber), o => o.OpacityNumber); AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(nameof(OpacityNumber), o => o.OpacityNumber);
@@ -70,34 +84,30 @@ public class ColorDetailControl : TemplatedControl
private void OnBackgroundChanged(AvaloniaPropertyChangedEventArgs args) private void OnBackgroundChanged(AvaloniaPropertyChangedEventArgs args)
{ {
var color = args.GetNewValue<IBrush>(); var color = args.GetNewValue<IBrush>();
if (color is ISolidColorBrush b) if (color is ISolidColorBrush brush)
{ {
Hex = b.Color.ToString().ToUpperInvariant(); var hex1 = ColorConverter.ToHex.Convert(brush.Color, typeof(string), false, CultureInfo.InvariantCulture);
OpacityNumber = b.Opacity.ToString(CultureInfo.InvariantCulture); var hex2 = ColorConverter.ToHex.Convert(brush.Color, typeof(string), true, CultureInfo.InvariantCulture);
Hex = hex1 as string;
Hex2 = hex2 as string;
OpacityNumber = brush.Opacity.ToString(CultureInfo.InvariantCulture);
} }
} }
public async void Copy(object o) public async Task Copy(object o)
{ {
string? text = null; string? text = null;
if (o is string s) if (o is string s)
{ {
switch (s) text = s switch
{ {
case KEY_ResourceKey: KEY_ResourceKey => ResourceKey,
text = ResourceKey; KEY_Hex => Hex,
break; KEY_Hex2 => Hex2,
case KEY_Hex: KEY_Opacity => OpacityNumber,
text = Hex; KEY_ColorResourceKey => ColorResourceKey,
break; _ => string.Empty
case KEY_Opacity: };
text = OpacityNumber;
break;
case KEY_ColorResourceKey:
text = ColorResourceKey;
break;
default: text = string.Empty; break;
}
} }
var toplevel = TopLevel.GetTopLevel(this); var toplevel = TopLevel.GetTopLevel(this);

View File

@@ -0,0 +1,22 @@
using Avalonia.Data.Converters;
using Avalonia.Media;
namespace Semi.Avalonia.Demo.Converters;
public static class ColorConverter
{
public static readonly IValueConverter ToHex =
new FuncValueConverter<object, bool, string>(
(obj, withAlpha) =>
obj switch
{
Color color => withAlpha
? $"#{color.A:X2}{color.R:X2}{color.G:X2}{color.B:X2}"
: $"#{color.R:X2}{color.G:X2}{color.B:X2}",
ISolidColorBrush brush => withAlpha
? $"#{brush.Color.A:X2}{brush.Color.R:X2}{brush.Color.G:X2}{brush.Color.B:X2}"
: $"#{brush.Color.R:X2}{brush.Color.G:X2}{brush.Color.B:X2}",
_ => string.Empty
}
);
}

View File

@@ -4,21 +4,14 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls" xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
xmlns:cvt="clr-namespace:Semi.Avalonia.Demo.Converters"
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="1450" mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="1450"
x:DataType="vm:HighContrastDemoViewModel" x:DataType="vm:HighContrastDemoViewModel"
x:CompileBindings="True"
x:Class="Semi.Avalonia.Demo.Pages.HighContrastDemo"> x:Class="Semi.Avalonia.Demo.Pages.HighContrastDemo">
<Design.DataContext> <Design.DataContext>
<vm:HighContrastDemoViewModel /> <vm:HighContrastDemoViewModel />
</Design.DataContext> </Design.DataContext>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="../Themes/ToggleSwitch.axaml" />
<ResourceInclude Source="../Controls/ColorItemControl.axaml" />
<ResourceInclude Source="../Controls/ColorDetailControl.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<SplitView <SplitView
Name="splitView" Name="splitView"
CompactPaneLength="50" CompactPaneLength="50"
@@ -285,7 +278,8 @@
<SelectableTextBlock <SelectableTextBlock
Margin="12 0" Margin="12 0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding Hex}" /> Text="{Binding Brush,
Converter={x:Static cvt:ColorConverter.ToHex},ConverterParameter={x:False}}" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>

View File

@@ -9,18 +9,18 @@ public partial class Overview : UserControl
InitializeComponent(); InitializeComponent();
} }
public string MainInstall { get; set; } = "dotnet add package Semi.Avalonia --version 11.2.1.2"; public string MainInstall { get; set; } = "dotnet add package Semi.Avalonia --version 11.2.1.3";
public string MainStyle { get; set; } = public string MainStyle { get; set; } =
""" """
<Application.Styles> <Application.Styles>
<!-- You can still reference in old way. --> <!-- You can still reference in old way. -->
<!-- <StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" /> --> <!-- <StyleInclude Source="avares://Semi.Avalonia/Index.axaml" /> -->
<semi:SemiTheme Locale="zh-cn" /> <semi:SemiTheme Locale="zh-CN" />
</Application.Styles> </Application.Styles>
"""; """;
public string ColorPickerInstall { get; set; } = "dotnet add package Semi.Avalonia.ColorPicker --version 11.2.1.2"; public string ColorPickerInstall { get; set; } = "dotnet add package Semi.Avalonia.ColorPicker --version 11.2.1.3";
public string ColorPickerStyle { get; set; } = public string ColorPickerStyle { get; set; } =
""" """
@@ -29,7 +29,7 @@ public partial class Overview : UserControl
</Application.Styles> </Application.Styles>
"""; """;
public string DataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.DataGrid --version 11.2.1.2"; public string DataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.DataGrid --version 11.2.1.3";
public string DataGridStyle { get; set; } = public string DataGridStyle { get; set; } =
""" """

View File

@@ -14,17 +14,6 @@
<Design.DataContext> <Design.DataContext>
<viewModels:PaletteDemoViewModel /> <viewModels:PaletteDemoViewModel />
</Design.DataContext> </Design.DataContext>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="../Themes/ToggleSwitch.axaml" />
<ResourceInclude Source="../Controls/ColorItemControl.axaml" />
<ResourceInclude Source="../Controls/ColorDetailControl.axaml" />
<ResourceInclude Source="../Controls/FunctionalColorGroupControl.axaml" />
<ResourceInclude Source="../Controls/ShadowGroupControl.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<SplitView <SplitView
Name="splitView" Name="splitView"
CompactPaneLength="50" CompactPaneLength="50"

View File

@@ -4,22 +4,26 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<AvaloniaResource Include="Assets\**" /> <AvaloniaResource Include="Assets\**"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" /> <PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/>
<PackageReference Include="Avalonia.Controls.DataGrid" Version="$(AvaloniaVersion)" /> <PackageReference Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
<PackageReference Include="Avalonia.Controls.DataGrid" Version="$(AvaloniaVersion)"/>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" /> <PackageReference Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)">
<PackageReference Include="CommunityToolkit.Mvvm" Version="$(CommunityToolkitVersion)" /> <IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference>
<PackageReference Include="CommunityToolkit.Mvvm" Version="$(CommunityToolkitVersion)"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Semi.Avalonia.ColorPicker\Semi.Avalonia.ColorPicker.csproj" /> <ProjectReference Include="..\..\src\Semi.Avalonia.ColorPicker\Semi.Avalonia.ColorPicker.csproj"/>
<ProjectReference Include="..\..\src\Semi.Avalonia.DataGrid\Semi.Avalonia.DataGrid.csproj" /> <ProjectReference Include="..\..\src\Semi.Avalonia.DataGrid\Semi.Avalonia.DataGrid.csproj"/>
<ProjectReference Include="..\..\src\Semi.Avalonia\Semi.Avalonia.csproj" /> <ProjectReference Include="..\..\src\Semi.Avalonia\Semi.Avalonia.csproj"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,7 +1,8 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"> xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
x:CompileBindings="True">
<ControlTheme x:Key="{x:Type controls:ColorDetailControl}" TargetType="controls:ColorDetailControl"> <ControlTheme x:Key="{x:Type controls:ColorDetailControl}" TargetType="controls:ColorDetailControl">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="controls:ColorDetailControl"> <ControlTemplate TargetType="controls:ColorDetailControl">
@@ -16,7 +17,7 @@
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
CornerRadius="6" /> CornerRadius="6" />
<Grid ColumnDefinitions="*, Auto" RowDefinitions="*, *, *, *, *, *, *"> <Grid ColumnDefinitions="*, Auto" RowDefinitions="*, *, *, *, *, *, *, *">
<!-- Row 0-1-2 ResourceKey --> <!-- Row 0-1-2 ResourceKey -->
<TextBlock <TextBlock
Grid.Column="0" Grid.Column="0"
@@ -47,7 +48,7 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ColorResourceKey, Converter={x:Static ObjectConverters.IsNotNull}}" IsVisible="{TemplateBinding ColorResourceKey, Converter={x:Static ObjectConverters.IsNotNull}}"
Text="{TemplateBinding ColorResourceKey}" /> Text="{TemplateBinding ColorResourceKey}" />
<Button <Button
Grid.Row="2" Grid.Row="2"
@@ -56,7 +57,7 @@
Padding="8" Padding="8"
Command="{Binding $parent[controls:ColorDetailControl].Copy}" Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_ColorResourceKey}" CommandParameter="{x:Static controls:ColorDetailControl.KEY_ColorResourceKey}"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ColorResourceKey, Converter={x:Static ObjectConverters.IsNotNull}}" IsVisible="{TemplateBinding ColorResourceKey, Converter={x:Static ObjectConverters.IsNotNull}}"
Theme="{DynamicResource BorderlessButton}"> Theme="{DynamicResource BorderlessButton}">
<PathIcon <PathIcon
Theme="{DynamicResource InnerPathIcon}" Theme="{DynamicResource InnerPathIcon}"
@@ -64,7 +65,7 @@
Foreground="{Binding $parent[Button].Foreground}" /> Foreground="{Binding $parent[Button].Foreground}" />
</Button> </Button>
<!-- Row 3-4 HEX --> <!-- Row 3-4-5 HEX -->
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
@@ -72,7 +73,7 @@
Margin="4,8,0,0" Margin="4,8,0,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Tertiary" Classes="Tertiary"
Text="ARGB" /> Text="Hex" />
<SelectableTextBlock <SelectableTextBlock
Grid.Row="4" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
@@ -91,23 +92,41 @@
Data="{StaticResource SemiIconCopy}" Data="{StaticResource SemiIconCopy}"
Foreground="{Binding $parent[Button].Foreground}" /> Foreground="{Binding $parent[Button].Foreground}" />
</Button> </Button>
<SelectableTextBlock
<!-- Row 5-6 Opacity -->
<TextBlock
Grid.Row="5" Grid.Row="5"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center"
Text="{TemplateBinding Hex2}" />
<Button
Grid.Row="5"
Grid.Column="1"
Classes="Tertiary"
Padding="8"
Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_Hex2}"
Theme="{DynamicResource BorderlessButton}">
<PathIcon
Theme="{DynamicResource InnerPathIcon}"
Data="{StaticResource SemiIconCopy}"
Foreground="{Binding $parent[Button].Foreground}" />
</Button>
<!-- Row 6-7 Opacity -->
<TextBlock
Grid.Row="6"
Grid.Column="0"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
Margin="4,8,0,0" Margin="4,8,0,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Tertiary" Classes="Tertiary"
Text="Opacity" /> Text="Opacity" />
<SelectableTextBlock <SelectableTextBlock
Grid.Row="6" Grid.Row="7"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{TemplateBinding OpacityNumber}" /> Text="{TemplateBinding OpacityNumber}" />
<Button <Button
Grid.Row="6" Grid.Row="7"
Grid.Column="1" Grid.Column="1"
Classes="Tertiary" Classes="Tertiary"
Padding="8" Padding="8"
@@ -124,4 +143,4 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,7 +1,8 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Semi.Avalonia.Demo.Controls"> xmlns:controls="using:Semi.Avalonia.Demo.Controls"
x:CompileBindings="True">
<Design.PreviewWith> <Design.PreviewWith>
<controls:ColorItemControl /> <controls:ColorItemControl />
</Design.PreviewWith> </Design.PreviewWith>

View File

@@ -25,7 +25,7 @@
<ControlTheme x:Key="SplitViewToggleSwitch" <ControlTheme x:Key="SplitViewToggleSwitch"
BasedOn="{StaticResource ThemeToggleSwitch}" BasedOn="{StaticResource ThemeToggleSwitch}"
TargetType="ToggleSwitch"> TargetType="ToggleSwitch">
<Setter Property="Content" <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
Value="M5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5C2 3.34315 3.34315 2 5 2ZM6 4C5.44772 4 5 4.44772 5 5V19C5 19.5523 5.44772 20 6 20H9C9.55229 20 10 19.5523 10 19V5C10 4.44772 9.55229 4 9 4H6Z" /> <Setter Property="Content" Value="{StaticResource SemiIconSidebar}" />
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -0,0 +1,10 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="ColorDetailControl.axaml" />
<ResourceInclude Source="ColorItemControl.axaml" />
<ResourceInclude Source="FunctionalColorGroupControl.axaml" />
<ResourceInclude Source="ShadowGroupControl.axaml" />
<ResourceInclude Source="TabMenu.axaml" />
<ResourceInclude Source="ToggleSwitch.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@@ -33,7 +33,6 @@ public partial class HighContrastDemoViewModel : ObservableObject
{ {
ResourceKey = "WindowColor", ResourceKey = "WindowColor",
Brush = new SolidColorBrush(Color.Parse("#202020")), Brush = new SolidColorBrush(Color.Parse("#202020")),
Hex = "#FF202020",
Description = "Background of pages, panes, popups, and windows.", Description = "Background of pages, panes, popups, and windows.",
PairWith = "WindowTextColor" PairWith = "WindowTextColor"
}, },
@@ -41,7 +40,6 @@ public partial class HighContrastDemoViewModel : ObservableObject
{ {
ResourceKey = "WindowTextColor", ResourceKey = "WindowTextColor",
Brush = new SolidColorBrush(Color.Parse("#FFFFFF")), Brush = new SolidColorBrush(Color.Parse("#FFFFFF")),
Hex = "WHITE",
Description = "Headings, body copy, lists, placeholder text, app and window borders.", Description = "Headings, body copy, lists, placeholder text, app and window borders.",
PairWith = "WindowColor" PairWith = "WindowColor"
}, },
@@ -49,7 +47,6 @@ public partial class HighContrastDemoViewModel : ObservableObject
{ {
ResourceKey = "HotlightColor", ResourceKey = "HotlightColor",
Brush = new SolidColorBrush(Color.Parse("#75E9FC")), Brush = new SolidColorBrush(Color.Parse("#75E9FC")),
Hex = "#FF75E9FC",
Description = "Hyperlinks.", Description = "Hyperlinks.",
PairWith = "WindowColor" PairWith = "WindowColor"
}, },
@@ -57,7 +54,6 @@ public partial class HighContrastDemoViewModel : ObservableObject
{ {
ResourceKey = "GrayTextColor", ResourceKey = "GrayTextColor",
Brush = new SolidColorBrush(Color.Parse("#A6A6A6")), Brush = new SolidColorBrush(Color.Parse("#A6A6A6")),
Hex = "#FFA6A6A6",
Description = "Inactive (disabled) UI.", Description = "Inactive (disabled) UI.",
PairWith = "WindowColor" PairWith = "WindowColor"
}, },
@@ -65,7 +61,6 @@ public partial class HighContrastDemoViewModel : ObservableObject
{ {
ResourceKey = "HighlightTextColor", ResourceKey = "HighlightTextColor",
Brush = new SolidColorBrush(Color.Parse("#263B50")), Brush = new SolidColorBrush(Color.Parse("#263B50")),
Hex = "#FF263B50",
Description = Description =
"Foreground color for text or UI that is in selected, interacted with (hover, pressed), or in progress.", "Foreground color for text or UI that is in selected, interacted with (hover, pressed), or in progress.",
PairWith = "HighlightColor" PairWith = "HighlightColor"
@@ -74,7 +69,6 @@ public partial class HighContrastDemoViewModel : ObservableObject
{ {
ResourceKey = "HighlightColor", ResourceKey = "HighlightColor",
Brush = new SolidColorBrush(Color.Parse("#8EE3F0")), Brush = new SolidColorBrush(Color.Parse("#8EE3F0")),
Hex = "#FF8EE3F0",
Description = Description =
"Background or accent color for UI that is in selected, interacted with (hover, pressed), or in progress.", "Background or accent color for UI that is in selected, interacted with (hover, pressed), or in progress.",
PairWith = "HighlightTextColor" PairWith = "HighlightTextColor"
@@ -83,7 +77,6 @@ public partial class HighContrastDemoViewModel : ObservableObject
{ {
ResourceKey = "ButtonTextColor", ResourceKey = "ButtonTextColor",
Brush = new SolidColorBrush(Color.Parse("#FFFFFF")), Brush = new SolidColorBrush(Color.Parse("#FFFFFF")),
Hex = "WHITE",
Description = "Foreground color for buttons and any UI that can be interacted with.", Description = "Foreground color for buttons and any UI that can be interacted with.",
PairWith = "ButtonFaceColor" PairWith = "ButtonFaceColor"
}, },
@@ -91,7 +84,6 @@ public partial class HighContrastDemoViewModel : ObservableObject
{ {
ResourceKey = "ButtonFaceColor", ResourceKey = "ButtonFaceColor",
Brush = new SolidColorBrush(Color.Parse("#202020")), Brush = new SolidColorBrush(Color.Parse("#202020")),
Hex = "#FF202020",
Description = "Background color for buttons and any UI that can be interacted with.", Description = "Background color for buttons and any UI that can be interacted with.",
PairWith = "ButtonTextColor" PairWith = "ButtonTextColor"
}, },
@@ -111,7 +103,6 @@ public partial class HighContrastDemoViewModel : ObservableObject
if (topLevel?.TryFindResource(colorResource.ResourceKey, value, out var o) == true && o is Color color) if (topLevel?.TryFindResource(colorResource.ResourceKey, value, out var o) == true && o is Color color)
{ {
colorResource.Brush = new SolidColorBrush(color); colorResource.Brush = new SolidColorBrush(color);
colorResource.Hex = color.ToString().ToUpperInvariant();
} }
} }
} }
@@ -131,7 +122,6 @@ public partial class ColorResource : ObservableObject
{ {
[ObservableProperty] private string? _resourceKey; [ObservableProperty] private string? _resourceKey;
[ObservableProperty] private SolidColorBrush? _brush; [ObservableProperty] private SolidColorBrush? _brush;
[ObservableProperty] private string? _hex;
[ObservableProperty] private string? _description; [ObservableProperty] private string? _description;
[ObservableProperty] private string? _pairWith; [ObservableProperty] private string? _pairWith;
} }

View File

@@ -1,11 +1,13 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Globalization;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Media; using Avalonia.Media;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Messaging; using CommunityToolkit.Mvvm.Messaging;
using Semi.Avalonia.Tokens.Palette; using Semi.Avalonia.Tokens.Palette;
using Semi.Avalonia.Demo.Converters;
namespace Semi.Avalonia.Demo.ViewModels; namespace Semi.Avalonia.Demo.ViewModels;
@@ -212,7 +214,8 @@ public class ColorItemViewModel : ObservableObject
ColorDisplayName = colorDisplayName; ColorDisplayName = colorDisplayName;
Brush = brush; Brush = brush;
ResourceKey = resourceKey; ResourceKey = resourceKey;
Hex = brush.ToString().ToUpperInvariant(); var hex = ColorConverter.ToHex.Convert(brush.Color, typeof(string), false, CultureInfo.InvariantCulture);
Hex = hex as string ?? string.Empty;
if ((light && index < 5) || (!light && index >= 5)) if ((light && index < 5) || (!light && index >= 5))
{ {
TextBrush = Brushes.Black; TextBrush = Brushes.Black;

View File

@@ -11,14 +11,6 @@
x:CompileBindings="True" x:CompileBindings="True"
x:DataType="views:MainViewModel" x:DataType="views:MainViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="../Themes/TabMenu.axaml" />
<ResourceInclude Source="../Themes/ToggleSwitch.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid RowDefinitions="Auto, *"> <Grid RowDefinitions="Auto, *">
<Border <Border
Grid.Row="0" Grid.Row="0"
@@ -50,10 +42,6 @@
<Setter Property="Padding" Value="8" /> <Setter Property="Padding" Value="8" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
</Style> </Style>
<Style Selector="ToggleSwitch">
<Setter Property="Theme" Value="{DynamicResource ThemeToggleSwitch}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
</Style>
<Style Selector="PathIcon"> <Style Selector="PathIcon">
<Setter Property="Theme" Value="{DynamicResource InnerPathIcon}" /> <Setter Property="Theme" Value="{DynamicResource InnerPathIcon}" />
</Style> </Style>
@@ -68,6 +56,8 @@
</Button> </Button>
<ToggleSwitch <ToggleSwitch
Theme="{DynamicResource ThemeToggleSwitch}"
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}"
Command="{Binding ToggleThemeCommand}" Command="{Binding ToggleThemeCommand}"
OnContent="{StaticResource SemiIconMoon}" OnContent="{StaticResource SemiIconMoon}"
OffContent="{StaticResource SemiIconSun}" /> OffContent="{StaticResource SemiIconSun}" />

View File

@@ -2,11 +2,10 @@
x:Class="Semi.Avalonia.TreeDataGrid.Demo.App" x:Class="Semi.Avalonia.TreeDataGrid.Demo.App"
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
RequestedThemeVariant="Default"> xmlns:semi="https://irihi.tech/semi">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
<Application.Styles> <Application.Styles>
<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" /> <semi:SemiTheme Locale="zh-CN" />
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" /> <StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
</Application.Styles> </Application.Styles>
</Application> </Application>

View File

@@ -1,10 +1,10 @@
using Avalonia; using System;
using System; using Avalonia;
using Avalonia.Media; using Avalonia.Media;
namespace Semi.Avalonia.TreeDataGrid.Demo; namespace Semi.Avalonia.TreeDataGrid.Demo;
class Program sealed class Program
{ {
// Initialization code. Don't use any Avalonia, third-party APIs or any // Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized // SynchronizationContext-reliant code before AppMain is called: things aren't initialized

View File

@@ -12,18 +12,21 @@
<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>--> <!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
</PropertyGroup> </PropertyGroup>
<Import Project="../Directory.Build.props" /> <Import Project="../Directory.Build.props"/>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" /> <PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" /> <PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" /> <PackageReference Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)">
<PackageReference Include="CommunityToolkit.Mvvm" Version="$(CommunityToolkitVersion)" /> <IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference>
<PackageReference Include="CommunityToolkit.Mvvm" Version="$(CommunityToolkitVersion)"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Semi.Avalonia.TreeDataGrid\Semi.Avalonia.TreeDataGrid.csproj" /> <ProjectReference Include="..\..\src\Semi.Avalonia.TreeDataGrid\Semi.Avalonia.TreeDataGrid.csproj"/>
<ProjectReference Include="..\..\src\Semi.Avalonia\Semi.Avalonia.csproj" /> <ProjectReference Include="..\..\src\Semi.Avalonia\Semi.Avalonia.csproj"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -3,7 +3,7 @@
<TargetFrameworks>net6.0;net8.0;netstandard2.0</TargetFrameworks> <TargetFrameworks>net6.0;net8.0;netstandard2.0</TargetFrameworks>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Version>11.2.1.2</Version> <Version>11.2.1.3</Version>
<Authors>IRIHI Technology Co., Ltd.</Authors> <Authors>IRIHI Technology Co., Ltd.</Authors>
<Description>Avalonia Theme inspired by Semi Design.</Description> <Description>Avalonia Theme inspired by Semi Design.</Description>
<RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl> <RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl>

View File

@@ -76,7 +76,6 @@
Width="300" Width="300"
Height="300" Height="300"
RowDefinitions="*,Auto"> RowDefinitions="*,Auto">
<Grid.Styles />
<!-- Backgrounds --> <!-- Backgrounds -->
<!-- TODO: Background="{DynamicResource ColorViewTabBackgroundBrush}" --> <!-- TODO: Background="{DynamicResource ColorViewTabBackgroundBrush}" -->
<Border <Border
@@ -143,7 +142,7 @@
IsVisible="{TemplateBinding IsColorSpectrumSliderVisible}" IsVisible="{TemplateBinding IsColorSpectrumSliderVisible}"
Orientation="Vertical" /> Orientation="Vertical" />
<primitives:ColorSpectrum <primitives:ColorSpectrum
Name="ColorSpectrum" x:Name="ColorSpectrum"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
@@ -334,7 +333,7 @@
ShowButtonSpinner="False" ShowButtonSpinner="False"
Value="{Binding Value, ElementName=Component1Slider}" /> Value="{Binding Value, ElementName=Component1Slider}" />
<primitives:ColorSlider <primitives:ColorSlider
Name="Component1Slider" x:Name="Component1Slider"
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
@@ -365,7 +364,7 @@
ShowButtonSpinner="False" ShowButtonSpinner="False"
Value="{Binding Value, ElementName=Component2Slider}" /> Value="{Binding Value, ElementName=Component2Slider}" />
<primitives:ColorSlider <primitives:ColorSlider
Name="Component2Slider" x:Name="Component2Slider"
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
@@ -396,7 +395,7 @@
ShowButtonSpinner="False" ShowButtonSpinner="False"
Value="{Binding Value, ElementName=Component3Slider}" /> Value="{Binding Value, ElementName=Component3Slider}" />
<primitives:ColorSlider <primitives:ColorSlider
Name="Component3Slider" x:Name="Component3Slider"
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
@@ -434,7 +433,7 @@
</NumericUpDown.IsVisible> </NumericUpDown.IsVisible>
</NumericUpDown> </NumericUpDown>
<primitives:ColorSlider <primitives:ColorSlider
Name="AlphaComponentSlider" x:Name="AlphaComponentSlider"
Grid.Row="5" Grid.Row="5"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
@@ -559,7 +558,7 @@
CornerRadius="8 8 0 0" CornerRadius="8 8 0 0"
ClipToBounds="True"> ClipToBounds="True">
<primitives:ColorSpectrum <primitives:ColorSpectrum
Name="ColorSpectrum" x:Name="ColorSpectrum"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Components="{TemplateBinding ColorSpectrumComponents}" Components="{TemplateBinding ColorSpectrumComponents}"
@@ -585,7 +584,7 @@
Orientation="Horizontal" /> Orientation="Horizontal" />
<primitives:ColorSlider <primitives:ColorSlider
Name="ColorSpectrumAlphaSlider" x:Name="ColorSpectrumAlphaSlider"
Grid.Row="2" Grid.Row="2"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Center" VerticalAlignment="Center"

View File

@@ -237,7 +237,7 @@
IsVisible="{TemplateBinding IsColorSpectrumSliderVisible}" IsVisible="{TemplateBinding IsColorSpectrumSliderVisible}"
Orientation="Vertical" /> Orientation="Vertical" />
<primitives:ColorSpectrum <primitives:ColorSpectrum
Name="ColorSpectrum" x:Name="ColorSpectrum"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
@@ -251,7 +251,7 @@
MinValue="{TemplateBinding MinValue}" MinValue="{TemplateBinding MinValue}"
Shape="{TemplateBinding ColorSpectrumShape}" /> Shape="{TemplateBinding ColorSpectrumShape}" />
<primitives:ColorSlider <primitives:ColorSlider
Name="ColorSpectrumAlphaSlider" x:Name="ColorSpectrumAlphaSlider"
Grid.Column="2" Grid.Column="2"
Margin="12,0,0,0" Margin="12,0,0,0"
HorizontalAlignment="Center" HorizontalAlignment="Center"
@@ -347,7 +347,7 @@
CornerRadius="3"> CornerRadius="3">
<Grid ColumnDefinitions="1*,1*" IsVisible="{TemplateBinding IsColorModelVisible}"> <Grid ColumnDefinitions="1*,1*" IsVisible="{TemplateBinding IsColorModelVisible}">
<RadioButton <RadioButton
Name="RgbRadioButton" x:Name="RgbRadioButton"
Grid.Column="0" Grid.Column="0"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
@@ -359,7 +359,7 @@
Mode=TwoWay}" Mode=TwoWay}"
Theme="{DynamicResource ColorViewRadioButton}" /> Theme="{DynamicResource ColorViewRadioButton}" />
<RadioButton <RadioButton
Name="HsvRadioButton" x:Name="HsvRadioButton"
Grid.Column="1" Grid.Column="1"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
@@ -373,7 +373,7 @@
</Grid> </Grid>
</Border> </Border>
<TextBox <TextBox
Name="PART_HexTextBox" x:Name="PART_HexTextBox"
Grid.Column="2" Grid.Column="2"
Height="32" Height="32"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
@@ -400,7 +400,7 @@
ShowButtonSpinner="False" ShowButtonSpinner="False"
Value="{Binding Value, ElementName=Component1Slider}" /> Value="{Binding Value, ElementName=Component1Slider}" />
<primitives:ColorSlider <primitives:ColorSlider
Name="Component1Slider" x:Name="Component1Slider"
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
@@ -431,7 +431,7 @@
ShowButtonSpinner="False" ShowButtonSpinner="False"
Value="{Binding Value, ElementName=Component2Slider}" /> Value="{Binding Value, ElementName=Component2Slider}" />
<primitives:ColorSlider <primitives:ColorSlider
Name="Component2Slider" x:Name="Component2Slider"
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
@@ -462,7 +462,7 @@
ShowButtonSpinner="False" ShowButtonSpinner="False"
Value="{Binding Value, ElementName=Component3Slider}" /> Value="{Binding Value, ElementName=Component3Slider}" />
<primitives:ColorSlider <primitives:ColorSlider
Name="Component3Slider" x:Name="Component3Slider"
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
@@ -500,7 +500,7 @@
</NumericUpDown.IsVisible> </NumericUpDown.IsVisible>
</NumericUpDown> </NumericUpDown>
<primitives:ColorSlider <primitives:ColorSlider
Name="AlphaComponentSlider" x:Name="AlphaComponentSlider"
Grid.Row="5" Grid.Row="5"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
@@ -584,7 +584,7 @@
CornerRadius="8 8 0 0" CornerRadius="8 8 0 0"
ClipToBounds="True"> ClipToBounds="True">
<primitives:ColorSpectrum <primitives:ColorSpectrum
Name="ColorSpectrum" x:Name="ColorSpectrum"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Components="{TemplateBinding ColorSpectrumComponents}" Components="{TemplateBinding ColorSpectrumComponents}"
@@ -610,7 +610,7 @@
Orientation="Horizontal" /> Orientation="Horizontal" />
<primitives:ColorSlider <primitives:ColorSlider
Name="ColorSpectrumAlphaSlider" x:Name="ColorSpectrumAlphaSlider"
Grid.Row="2" Grid.Row="2"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Center" VerticalAlignment="Center"

View File

@@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<Title>Semi.Avalonia.ColorPicker</Title> <Title>Semi.Avalonia.ColorPicker</Title>
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 11.2.1.2</PackageReleaseNotes> <PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 11.2.1.3</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

View File

@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Package.props"/> <Import Project="../Package.props"/>
<PropertyGroup> <PropertyGroup>
<Title>Semi.Avalonia.DataGrid</Title> <Title>Semi.Avalonia.DataGrid</Title>
<PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 11.2.1.2</PackageReleaseNotes> <PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 11.2.1.3</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

View File

@@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<Title>Semi.Avalonia</Title> <Title>Semi.Avalonia</Title>
<PackageReleaseNotes>Update to Semi.Avalonia 11.2.1.2</PackageReleaseNotes> <PackageReleaseNotes>Update to Semi.Avalonia 11.2.1.3</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

View File

@@ -170,6 +170,7 @@
<SolidColorBrush x:Key="SemiWhite" Color="{StaticResource SemiWhiteColor}" /> <SolidColorBrush x:Key="SemiWhite" Color="{StaticResource SemiWhiteColor}" />
<SolidColorBrush x:Key="SemiBlack" Color="{StaticResource SemiBlackColor}" /> <SolidColorBrush x:Key="SemiBlack" Color="{StaticResource SemiBlackColor}" />
<SolidColorBrush x:Key="SemiRed0" Color="{StaticResource SemiRed0Color}" />
<SolidColorBrush x:Key="SemiRed1" Color="{StaticResource SemiRed1Color}" /> <SolidColorBrush x:Key="SemiRed1" Color="{StaticResource SemiRed1Color}" />
<SolidColorBrush x:Key="SemiRed2" Color="{StaticResource SemiRed2Color}" /> <SolidColorBrush x:Key="SemiRed2" Color="{StaticResource SemiRed2Color}" />
<SolidColorBrush x:Key="SemiRed3" Color="{StaticResource SemiRed3Color}" /> <SolidColorBrush x:Key="SemiRed3" Color="{StaticResource SemiRed3Color}" />