Compare commits

...

60 Commits

Author SHA1 Message Date
Zhang Dian
78bc6c370b misc: bump version. 2025-01-24 10:46:03 +08:00
Dong Bin
2999beefac Merge pull request #540 from irihitech/variable
Unify tokens
2025-01-23 17:49:28 +08:00
Zhang Dian
77a05fb801 fix: fix AOT issue. 2025-01-23 17:39:19 +08:00
Zhang Dian
98dd72e9e3 misc: unify tokens. 2025-01-23 14:27:58 +08:00
Dong Bin
5a954fbca8 Merge pull request #539 from irihitech/variable
add Variable Demo & add copy button to PaletteDemo, HighContrastDemo
2025-01-22 18:20:34 +08:00
Zhang Dian
2da0733bdf feat: add Type column. 2025-01-22 16:29:56 +08:00
Zhang Dian
a5255bd032 feat: using DataGridCollectionView. 2025-01-22 15:54:16 +08:00
Zhang Dian
7530061ca4 misc: simplify DataGridDemoViewModel. 2025-01-22 15:54:15 +08:00
Zhang Dian
58c1c365a9 misc: revert DynamicResource Copy Button. 2025-01-21 23:50:22 +08:00
Zhang Dian
b5fe4d92a6 feat: add CopyText to HighContrastDemo. 2025-01-21 21:17:20 +08:00
Zhang Dian
5d0116ca8e feat: add DynamicResource CopyButton. 2025-01-21 20:32:37 +08:00
Zhang Dian
e981fe1c82 feat: add CopyText to PaletteDemo. 2025-01-21 20:24:21 +08:00
Zhang Dian
232ce71677 feat: add CopyText; 2025-01-21 20:18:08 +08:00
Zhang Dian
3fceec143d feat: enhance display value & add Copy button. 2025-01-21 19:36:16 +08:00
Zhang Dian
a99db733ed feat: add VariablesDemo. 2025-01-21 18:51:54 +08:00
Zhang Dian
bb928fb239 misc: simplify PaletteDemo. 2025-01-21 16:46:21 +08:00
Zhang Dian
371eb1b0d3 Merge pull request #537 from irihitech/caption
fix: fix potential issue when assigning invalid culture at runtime.
2025-01-20 20:58:20 +08:00
Zhang Dian
e56ef9d6ca misc: format codes. 2025-01-20 20:56:38 +08:00
Dong Bin
0eeba47e88 fix: fix potential issue when assigning invalid culture at runtime. 2025-01-20 18:47:41 +08:00
Dong Bin
96078a4115 Merge pull request #533 from irihitech/caption
Redesign CaptionButtons
2025-01-20 15:59:17 +08:00
Zhang Dian
26ef3ebf36 feat: specify IconButton Width & Height. 2025-01-19 23:35:50 +08:00
Dong Bin
8615783b61 Merge pull request #536 from irihitech/517
Fix actual Height
2025-01-19 17:12:12 +08:00
Zhang Dian
a0ca9fa4d0 fix: remove vertical Padding to fix the actual height of Button & Label. 2025-01-19 17:02:14 +08:00
Zhang Dian
e6ff4103ef fix: fix DatePicker Height. 2025-01-19 15:57:11 +08:00
Zhang Dian
2514d919f1 feat: redesign CaptionButtons. 2025-01-17 00:04:14 +08:00
Dong Bin
7a4b18e14a Merge pull request #530 from irihitech/high-contrast
Replace SolidColorBrush with StaticResource in high-contrast themes.
2025-01-13 17:17:38 +08:00
Zhang Dian
32e5e6b5f2 feat: replace SolidColorBrush with StaticResource in high-contrast themes. 2025-01-13 15:06:39 +08:00
Dong Bin
c253154e8f Add TrayIcon demo (#529)
* feat: add tray demo, change icon.

* feat: include favicon.
2025-01-13 12:37:55 +08:00
Dong Bin
8955c83fd9 Merge pull request #528 from irihitech/sync
Add RegisterFollowSystemTheme extension to Application
2025-01-07 15:08:11 +08:00
Zhang Dian
ea51867f0f feat: add RegisterFollowSystemTheme extension. 2025-01-07 12:45:14 +08:00
Dong Bin
8bb314984e Merge pull request #527 from irihitech/sync
Sync high-contrast themes under the Windows OS.
2025-01-06 22:37:00 +08:00
Zhang Dian
af6c52660d feat: sync high-contrast themes under the Windows OS. 2025-01-06 22:14:06 +08:00
Ruben
f6962657fa add german language support (#526)
added german culture support
2025-01-06 22:10:12 +08:00
Dong Bin
8df91270b1 Merge pull request #525 from irihitech/iconbutton
Enhance Icon related Button in demo
2025-01-04 20:34:54 +08:00
Zhang Dian
22f61cd836 fix: fix Menu RepeatButton MaxHeight value. 2025-01-04 12:49:10 +08:00
Zhang Dian
86848b548f feat: enhance Icon related Button in demo. 2025-01-04 12:48:45 +08:00
Zhang Dian
67fd0c4ca3 Merge pull request #520 from irihitech/locale
Add locale switch helper method
2025-01-03 17:18:43 +08:00
Dong Bin
263c65dd18 feat: simplify menu. 2025-01-03 15:51:51 +08:00
Dong Bin
26bb251d1e misc: reduce menu level. 2025-01-03 15:34:38 +08:00
Dong Bin
609dfbb5f0 feat: add simple locale switch. 2025-01-03 15:19:32 +08:00
Dong Bin
ad4bead1bd feat: add helper method to set locale resources. 2025-01-03 15:02:26 +08:00
Dong Bin
02444f7f16 Merge pull request #519 from irihitech/token
add `Variables` tokens and replace resources with them
2025-01-02 18:44:40 +08:00
Zhang Dian
06d9e35add misc: delete Base.axaml file. 2025-01-02 17:44:28 +08:00
Zhang Dian
1200c9a1c9 feat: index RadiusCardCornerRadius. 2025-01-02 16:58:12 +08:00
Zhang Dian
7600b187f4 feat: replace most resources in Shared folder with basic design tokens. 2025-01-02 14:31:47 +08:00
Zhang Dian
c55efe8835 misc: format shared codes. 2025-01-02 14:18:43 +08:00
Zhang Dian
1fe4df3716 feat: add basic Variables. 2025-01-02 14:18:43 +08:00
Zhang Dian
c22211df24 misc: using single-commit mode for gh-pages branch. 2025-01-01 16:39:24 +08:00
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
149 changed files with 1864 additions and 1404 deletions

View File

@@ -36,6 +36,7 @@ jobs:
- name: Commit wwwroot to GitHub Pages - name: Commit wwwroot to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.5.0 uses: JamesIves/github-pages-deploy-action@v4.5.0
with: with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages branch: gh-pages
FOLDER: ${{ env.OUTPUT_PATH }} folder: ${{ env.OUTPUT_PATH }}
single-commit: true

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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 162 KiB

View File

@@ -6,6 +6,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./app.css" /> <link rel="stylesheet" href="./app.css" />
<link rel="icon" type="image/x-icon" href="/favicon.ico">
</head> </head>
<body style="margin: 0; overflow: hidden"> <body style="margin: 0; overflow: hidden">

View File

@@ -2,13 +2,35 @@
x:Class="Semi.Avalonia.Demo.App" x:Class="Semi.Avalonia.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"
xmlns:semi="https://irihi.tech/semi"> x:CompileBindings="True"
x:DataType="viewModels:ApplicationViewModel"
xmlns:semi="https://irihi.tech/semi"
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels">
<Application.Styles> <Application.Styles>
<!-- 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>
<TrayIcon.Icons>
<TrayIcons>
<TrayIcon Icon="/Assets/irihi.ico" MacOSProperties.IsTemplateIcon="true" ToolTipText="Semi Avalonia Demo">
<TrayIcon.Menu>
<NativeMenu>
<NativeMenuItem Header="Exit" Command="{Binding ExitCommand}" />
</NativeMenu>
</TrayIcon.Menu>
</TrayIcon>
</TrayIcons>
</TrayIcon.Icons>
</Application> </Application>

View File

@@ -2,6 +2,7 @@ using Avalonia;
using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Data.Core.Plugins; using Avalonia.Data.Core.Plugins;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Semi.Avalonia.Demo.ViewModels;
using Semi.Avalonia.Demo.Views; using Semi.Avalonia.Demo.Views;
namespace Semi.Avalonia.Demo; namespace Semi.Avalonia.Demo;
@@ -11,6 +12,7 @@ public partial class App : Application
public override void Initialize() public override void Initialize()
{ {
AvaloniaXamlLoader.Load(this); AvaloniaXamlLoader.Load(this);
this.DataContext = new ApplicationViewModel();
} }
public override void OnFrameworkInitializationCompleted() public override void OnFrameworkInitializationCompleted()
@@ -28,6 +30,7 @@ public partial class App : Application
break; break;
} }
this.RegisterFollowSystemTheme();
base.OnFrameworkInitializationCompleted(); base.OnFrameworkInitializationCompleted();
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

View File

@@ -0,0 +1,143 @@
using System;
using System.Collections.Generic;
namespace Semi.Avalonia.Demo.Constant;
public static class ColorTokens
{
public static IReadOnlyList<Tuple<string, string>> PrimaryTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorPrimary", "Primary"),
new("SemiColorPrimaryPointerover", "Primary Pointerover"),
new("SemiColorPrimaryActive", "Primary Active"),
new("SemiColorPrimaryDisabled", "Primary Disabled"),
new("SemiColorPrimaryLight", "Primary Light"),
new("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"),
new("SemiColorPrimaryLightActive", "Primary Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> SecondaryTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorSecondary", "Secondary"),
new("SemiColorSecondaryPointerover", "Secondary Pointerover"),
new("SemiColorSecondaryActive", "Secondary Active"),
new("SemiColorSecondaryDisabled", "Secondary Disabled"),
new("SemiColorSecondaryLight", "Secondary Light"),
new("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"),
new("SemiColorSecondaryLightActive", "Secondary Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> TertiaryTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorTertiary", "Tertiary"),
new("SemiColorTertiaryPointerover", "Tertiary Pointerover"),
new("SemiColorTertiaryActive", "Tertiary Active"),
new("SemiColorTertiaryLight", "Tertiary Light"),
new("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"),
new("SemiColorTertiaryLightActive", "Tertiary Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> InformationTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorInformation", "Information"),
new("SemiColorInformationPointerover", "Information Pointerover"),
new("SemiColorInformationActive", "Information Active"),
new("SemiColorInformationDisabled", "Information Disabled"),
new("SemiColorInformationLight", "Information Light"),
new("SemiColorInformationLightPointerover", "Information Light Pointerover"),
new("SemiColorInformationLightActive", "Information Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> SuccessTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorSuccess", "Success"),
new("SemiColorSuccessPointerover", "Success Pointerover"),
new("SemiColorSuccessActive", "Success Active"),
new("SemiColorSuccessDisabled", "Success Disabled"),
new("SemiColorSuccessLight", "Success Light"),
new("SemiColorSuccessLightPointerover", "Success Light Pointerover"),
new("SemiColorSuccessLightActive", "Success Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> WarningTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorWarning", "Warning"),
new("SemiColorWarningPointerover", "Warning Pointerover"),
new("SemiColorWarningActive", "Warning Active"),
new("SemiColorWarningLight", "Warning Light"),
new("SemiColorWarningLightPointerover", "Warning Light Pointerover"),
new("SemiColorWarningLightActive", "Warning Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> DangerTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorDanger", "Danger"),
new("SemiColorDangerPointerover", "Danger Pointerover"),
new("SemiColorDangerActive", "Danger Active"),
new("SemiColorDangerLight", "Danger Light"),
new("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
new("SemiColorDangerLightActive", "Danger Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> TextTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorText0", "Text 0"),
new("SemiColorText1", "Text 1"),
new("SemiColorText2", "Text 2"),
new("SemiColorText3", "Text 3"),
};
public static IReadOnlyList<Tuple<string, string>> LinkTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorLink", "Link"),
new("SemiColorLinkPointerover", "Link Pointerover"),
new("SemiColorLinkActive", "Link Active"),
new("SemiColorLinkVisited", "Link Visited"),
};
public static IReadOnlyList<Tuple<string, string>> BackgroundTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorBackground0", "Background 0"),
new("SemiColorBackground1", "Background 1"),
new("SemiColorBackground2", "Background 2"),
new("SemiColorBackground3", "Background 3"),
new("SemiColorBackground4", "Background 4"),
};
public static IReadOnlyList<Tuple<string, string>> FillTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorFill0", "Fill 0"),
new("SemiColorFill1", "Fill 1"),
new("SemiColorFill2", "Fill 2"),
};
public static IReadOnlyList<Tuple<string, string>> BorderTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorBorder", "Border"),
new("SemiColorFocusBorder", "Focus Border"),
};
public static IReadOnlyList<Tuple<string, string>> DisabledTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorDisabledText", "Disabled Text"),
new("SemiColorDisabledBorder", "Disabled Border"),
new("SemiColorDisabledBackground", "Disabled Background"),
new("SemiColorDisabledFill", "Disabled Fill"),
};
public static IReadOnlyList<Tuple<string, string>> OtherTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorWhite", "White"),
new("SemiColorBlack", "Black"),
new("SemiColorNavBackground", "Navigation Background"),
new("SemiColorOverlayBackground", "Overlay Background"),
new("SemiColorHighlightBackground", "Highlight Background"),
new("SemiColorHighlight", "Highlight Text"),
};
public static IReadOnlyList<Tuple<string, string>> ShadowTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorShadow", "Shadow"),
new("SemiShadowElevated", "Shadow Elevated"),
};
}

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,15 @@
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"
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
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"
@@ -32,7 +26,8 @@
Name="toggle" Name="toggle"
HorizontalAlignment="Right" HorizontalAlignment="Right"
IsChecked="True" IsChecked="True"
Theme="{DynamicResource SplitViewToggleSwitch}" /> Theme="{DynamicResource IconBorderlessToggleSwitch}"
Content="{StaticResource SemiIconSidebar}" />
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}"> <Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
<Panel> <Panel>
<TextBlock <TextBlock
@@ -285,7 +280,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>
@@ -311,6 +307,18 @@
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTemplateColumn Width="100" Header="CopyText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="vm:ColorResource">
<Button
Command="{Binding $parent[pages:HighContrastDemo].Copy}"
CommandParameter="{Binding CopyText}"
Theme="{DynamicResource IconBorderlessButton}"
Content="{StaticResource SemiIconCopy}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</StackPanel> </StackPanel>

View File

@@ -1,4 +1,5 @@
using Avalonia.Controls; using System.Threading.Tasks;
using Avalonia.Controls;
using Semi.Avalonia.Demo.ViewModels; using Semi.Avalonia.Demo.ViewModels;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -10,4 +11,14 @@ public partial class HighContrastDemo : UserControl
InitializeComponent(); InitializeComponent();
this.DataContext = new HighContrastDemoViewModel(); this.DataContext = new HighContrastDemoViewModel();
} }
public async Task Copy(object? o)
{
if (o is null) return;
var toplevel = TopLevel.GetTopLevel(this);
if (toplevel?.Clipboard is { } c)
{
await c.SetTextAsync(o.ToString());
}
}
} }

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.4";
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.4";
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.4";
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"
@@ -38,7 +27,8 @@
Name="toggle" Name="toggle"
HorizontalAlignment="Right" HorizontalAlignment="Right"
IsChecked="True" IsChecked="True"
Theme="{DynamicResource SplitViewToggleSwitch}" /> Theme="{DynamicResource IconBorderlessToggleSwitch}"
Content="{StaticResource SemiIconSidebar}" />
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}"> <Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
<Panel> <Panel>
<TextBlock <TextBlock

View File

@@ -1,8 +1,6 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Primitives; using Avalonia.Controls.Primitives;
using Avalonia.Markup.Xaml;
using Avalonia.Threading; using Avalonia.Threading;
using Semi.Avalonia.Demo.ViewModels; using Semi.Avalonia.Demo.ViewModels;
@@ -16,13 +14,20 @@ public partial class PaletteDemo : UserControl
this.DataContext = new PaletteDemoViewModel(); this.DataContext = new PaletteDemoViewModel();
} }
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e) protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
{ {
base.OnApplyTemplate(e); base.OnApplyTemplate(e);
PaletteDemoViewModel? vm = this.DataContext as PaletteDemoViewModel; PaletteDemoViewModel? vm = this.DataContext as PaletteDemoViewModel;
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() => { vm?.InitializeResources(); });
}
public async Task Copy(object? o)
{
if (o is null) return;
var toplevel = TopLevel.GetTopLevel(this);
if (toplevel?.Clipboard is { } c)
{ {
vm?.InitializeResources(); await c.SetTextAsync(o.ToString());
}); }
} }
} }

View File

@@ -109,7 +109,8 @@
ItemsSource="{Binding Songs}" /> ItemsSource="{Binding Songs}" />
<ToggleSwitch <ToggleSwitch
Grid.Row="2" Grid.Row="2"
Theme="{DynamicResource SplitViewToggleSwitch}" Theme="{DynamicResource IconBorderlessToggleSwitch}"
Content="{StaticResource SemiIconSidebar}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
IsChecked="{Binding #SplitView.IsPaneOpen}"> IsChecked="{Binding #SplitView.IsPaneOpen}">
</ToggleSwitch> </ToggleSwitch>

View File

@@ -20,7 +20,7 @@
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" /> <ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" />
<ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsChecked="True"/> <ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsChecked="True" />
<ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsEnabled="False" /> <ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsEnabled="False" />
<ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsEnabled="False" IsChecked="True" /> <ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsEnabled="False" IsChecked="True" />
</StackPanel> </StackPanel>
@@ -64,7 +64,9 @@
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<ToggleSwitch <ToggleSwitch
HorizontalAlignment="Left" HorizontalAlignment="Left"
Padding="8" Padding="{StaticResource SemiThicknessTight}"
Width="{StaticResource SemiSpacingExtraLoose}"
Height="{StaticResource SemiSpacingExtraLoose}"
Theme="{DynamicResource ButtonToggleSwitch}" Theme="{DynamicResource ButtonToggleSwitch}"
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}"> Foreground="{DynamicResource ButtonDefaultTertiaryForeground}">
<ToggleSwitch.Content> <ToggleSwitch.Content>
@@ -75,7 +77,9 @@
</ToggleSwitch> </ToggleSwitch>
<ToggleSwitch <ToggleSwitch
HorizontalAlignment="Left" HorizontalAlignment="Left"
Padding="8" Padding="{StaticResource SemiThicknessTight}"
Width="{StaticResource SemiSpacingExtraLoose}"
Height="{StaticResource SemiSpacingExtraLoose}"
Theme="{DynamicResource ButtonToggleSwitch}" Theme="{DynamicResource ButtonToggleSwitch}"
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}"> Foreground="{DynamicResource ButtonDefaultTertiaryForeground}">
<ToggleSwitch.OnContent> <ToggleSwitch.OnContent>

View File

@@ -0,0 +1,94 @@
<UserControl xmlns="https://github.com/avaloniaui"
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.ViewModels"
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Semi.Avalonia.Demo.Pages.VariablesDemo"
x:DataType="vm:VariablesDemoViewModel"
x:CompileBindings="True">
<Design.DataContext>
<vm:VariablesDemoViewModel />
</Design.DataContext>
<DataGrid
Margin="8"
CanUserReorderColumns="True"
CanUserResizeColumns="True"
CanUserSortColumns="True"
HeadersVisibility="All"
IsReadOnly="True"
ItemsSource="{Binding GridData}">
<DataGrid.Columns>
<DataGridTemplateColumn
Width="300"
x:DataType="vm:VariableItem"
Header="ResourceKey">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="vm:VariableItem">
<SelectableTextBlock
Margin="12,0"
VerticalAlignment="Center"
Text="{Binding ResourceKey}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn
Width="200"
x:DataType="vm:VariableItem"
Header="Type">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="vm:VariableItem">
<SelectableTextBlock
Margin="12,0"
VerticalAlignment="Center"
Text="{Binding Type.Name}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn
Width="200"
x:DataType="vm:VariableItem"
Header="Value">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="vm:VariableItem">
<SelectableTextBlock
Margin="12,0"
VerticalAlignment="Center"
Text="{Binding Value}"
TextWrapping="Wrap" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn
Width="*"
x:DataType="vm:VariableItem"
Header="Description">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="vm:VariableItem">
<SelectableTextBlock
Margin="12,0"
VerticalAlignment="Center"
Text="{Binding Description}"
TextWrapping="Wrap" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn
Width="100"
x:DataType="vm:VariableItem"
Header="CopyText"
SortMemberPath="Duration">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="vm:VariableItem">
<Button
Command="{Binding $parent[pages:VariablesDemo].Copy}"
CommandParameter="{Binding CopyText}"
Theme="{DynamicResource IconBorderlessButton}"
Content="{StaticResource SemiIconCopy}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</UserControl>

View File

@@ -0,0 +1,24 @@
using System.Threading.Tasks;
using Avalonia.Controls;
using Semi.Avalonia.Demo.ViewModels;
namespace Semi.Avalonia.Demo.Pages;
public partial class VariablesDemo : UserControl
{
public VariablesDemo()
{
InitializeComponent();
this.DataContext = new VariablesDemoViewModel();
}
public async Task Copy(object? o)
{
if (o is null) return;
var toplevel = TopLevel.GetTopLevel(this);
if (toplevel?.Clipboard is { } c)
{
await c.SetTextAsync(o.ToString());
}
}
}

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"
@@ -33,38 +34,26 @@
<Button <Button
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Classes="Tertiary"
Padding="8"
Command="{Binding $parent[controls:ColorDetailControl].Copy}" Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_ResourceKey}" CommandParameter="{x:Static controls:ColorDetailControl.KEY_ResourceKey}"
Theme="{DynamicResource BorderlessButton}"> Theme="{DynamicResource IconBorderlessButton}"
<PathIcon Content="{StaticResource SemiIconCopy}" />
Theme="{DynamicResource InnerPathIcon}"
Data="{StaticResource SemiIconCopy}"
Foreground="{Binding $parent[Button].Foreground}" />
</Button>
<SelectableTextBlock <SelectableTextBlock
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"
Grid.Column="1" Grid.Column="1"
Classes="Tertiary"
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 IconBorderlessButton}"
<PathIcon Content="{StaticResource SemiIconCopy}" />
Theme="{DynamicResource InnerPathIcon}"
Data="{StaticResource SemiIconCopy}"
Foreground="{Binding $parent[Button].Foreground}" />
</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 +61,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"
@@ -81,47 +70,48 @@
<Button <Button
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Classes="Tertiary"
Padding="8"
Command="{Binding $parent[controls:ColorDetailControl].Copy}" Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_Hex}" CommandParameter="{x:Static controls:ColorDetailControl.KEY_Hex}"
Theme="{DynamicResource BorderlessButton}"> Theme="{DynamicResource IconBorderlessButton}"
<PathIcon Content="{StaticResource SemiIconCopy}" />
Theme="{DynamicResource InnerPathIcon}" <SelectableTextBlock
Data="{StaticResource SemiIconCopy}"
Foreground="{Binding $parent[Button].Foreground}" />
</Button>
<!-- 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"
Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_Hex2}"
Theme="{DynamicResource IconBorderlessButton}"
Content="{StaticResource SemiIconCopy}" />
<!-- 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"
Padding="8"
Command="{Binding $parent[controls:ColorDetailControl].Copy}" Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_Opacity}" CommandParameter="{x:Static controls:ColorDetailControl.KEY_Opacity}"
Theme="{DynamicResource BorderlessButton}"> Theme="{DynamicResource IconBorderlessButton}"
<PathIcon Content="{StaticResource SemiIconCopy}" />
Theme="{DynamicResource InnerPathIcon}"
Data="{StaticResource SemiIconCopy}"
Foreground="{Binding $parent[Button].Foreground}" />
</Button>
</Grid> </Grid>
</StackPanel> </StackPanel>
</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

@@ -3,6 +3,7 @@
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"
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
x:CompileBindings="True" x:CompileBindings="True"
x:DataType="viewModels:FunctionalColorGroupViewModel"> x:DataType="viewModels:FunctionalColorGroupViewModel">
<ControlTheme x:Key="{x:Type controls:FunctionalColorGroupControl}" TargetType="controls:FunctionalColorGroupControl"> <ControlTheme x:Key="{x:Type controls:FunctionalColorGroupControl}" TargetType="controls:FunctionalColorGroupControl">
@@ -30,27 +31,21 @@
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTemplateColumn Width="*" Header="ResourceKey"> <DataGridTemplateColumn Width="300" Header="ResourceKey">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel"> <DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock <SelectableTextBlock
Margin="12,0,12,0" Margin="12,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding ResourceKey}" /> Text="{Binding ResourceKey}" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTextColumn
Width="*"
x:DataType="viewModels:ColorItemViewModel"
Binding="{Binding ColorDisplayName}"
CanUserSort="False"
Header="Name" />
<DataGridTemplateColumn Width="100" Header="Hex"> <DataGridTemplateColumn Width="100" Header="Hex">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel"> <DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock <SelectableTextBlock
Margin="12,0,12,0" Margin="12,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding Hex}" /> Text="{Binding Hex}" />
</DataTemplate> </DataTemplate>
@@ -60,13 +55,29 @@
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel"> <DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock <SelectableTextBlock
Margin="12,0,12,0" Margin="12,0"
HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding Brush.Opacity}" /> Text="{Binding Brush.Opacity}" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTextColumn
Width="*"
x:DataType="viewModels:ColorItemViewModel"
Binding="{Binding ColorDisplayName}"
CanUserSort="False"
Header="Description" />
<DataGridTemplateColumn Width="100" Header="CopyText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel">
<Button
Command="{Binding $parent[pages:PaletteDemo].Copy}"
CommandParameter="{Binding CopyText}"
Theme="{DynamicResource IconBorderlessButton}"
Content="{StaticResource SemiIconCopy}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</TabItem> </TabItem>
@@ -84,27 +95,21 @@
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTemplateColumn Width="*" Header="ResourceKey"> <DataGridTemplateColumn Width="300" Header="ResourceKey">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel"> <DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock <SelectableTextBlock
Margin="12,0,12,0" Margin="12,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding ResourceKey}" /> Text="{Binding ResourceKey}" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTextColumn
Width="*"
x:DataType="viewModels:ColorItemViewModel"
Binding="{Binding ColorDisplayName}"
CanUserSort="False"
Header="Name" />
<DataGridTemplateColumn Width="100" Header="Hex"> <DataGridTemplateColumn Width="100" Header="Hex">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel"> <DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock <SelectableTextBlock
Margin="12,0,12,0" Margin="12,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding Hex}" /> Text="{Binding Hex}" />
</DataTemplate> </DataTemplate>
@@ -114,13 +119,29 @@
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel"> <DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock <SelectableTextBlock
Margin="12,0,12,0" Margin="12,0"
HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding Brush.Opacity}" /> Text="{Binding Brush.Opacity}" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTextColumn
Width="*"
x:DataType="viewModels:ColorItemViewModel"
Binding="{Binding ColorDisplayName}"
CanUserSort="False"
Header="Description" />
<DataGridTemplateColumn Width="100" Header="CopyText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel">
<Button
Command="{Binding $parent[pages:PaletteDemo].Copy}"
CommandParameter="{Binding CopyText}"
Theme="{DynamicResource IconBorderlessButton}"
Content="{StaticResource SemiIconCopy}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</TabItem> </TabItem>

View File

@@ -3,6 +3,7 @@
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"
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
x:CompileBindings="True" x:CompileBindings="True"
x:DataType="viewModels:ShadowGroupViewModel"> x:DataType="viewModels:ShadowGroupViewModel">
<ControlTheme x:Key="{x:Type controls:ShadowGroupControl}" TargetType="controls:ShadowGroupControl"> <ControlTheme x:Key="{x:Type controls:ShadowGroupControl}" TargetType="controls:ShadowGroupControl">
@@ -19,29 +20,40 @@
<TabItem Header="Light"> <TabItem Header="Light">
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding LightShadows}"> <DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding LightShadows}">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTemplateColumn Width="*" Header="ResourceKey"> <DataGridTemplateColumn Width="300" Header="ResourceKey">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ShadowItemViewModel"> <DataTemplate DataType="viewModels:ShadowItemViewModel">
<SelectableTextBlock <SelectableTextBlock
Margin="12,0,12,0" Margin="12,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding ResourceKey}" /> Text="{Binding ResourceKey}" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTemplateColumn Width="300" Header="BoxShadows">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ShadowItemViewModel">
<SelectableTextBlock
Margin="12,0"
VerticalAlignment="Center"
Text="{Binding BoxShadowValue}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn <DataGridTextColumn
Width="*" Width="*"
x:DataType="viewModels:ShadowItemViewModel" x:DataType="viewModels:ShadowItemViewModel"
Binding="{Binding ShadowDisplayName}" Binding="{Binding ShadowDisplayName}"
CanUserSort="False" CanUserSort="False"
Header="Name" /> Header="Description" />
<DataGridTemplateColumn Width="300" Header="BoxShadows"> <DataGridTemplateColumn Width="100" Header="CopyText">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ShadowItemViewModel"> <DataTemplate DataType="viewModels:ShadowItemViewModel">
<SelectableTextBlock <Button
Margin="12,0,12,0" Command="{Binding $parent[pages:PaletteDemo].Copy}"
VerticalAlignment="Center" CommandParameter="{Binding CopyText}"
Text="{Binding BoxShadowValue}" /> Theme="{DynamicResource IconBorderlessButton}"
Content="{StaticResource SemiIconCopy}" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
@@ -51,29 +63,40 @@
<TabItem Header="Dark"> <TabItem Header="Dark">
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding DarkShadows}"> <DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding DarkShadows}">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTemplateColumn Width="*" Header="ResourceKey"> <DataGridTemplateColumn Width="300" Header="ResourceKey">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ShadowItemViewModel"> <DataTemplate DataType="viewModels:ShadowItemViewModel">
<SelectableTextBlock <SelectableTextBlock
Margin="12,0,12,0" Margin="12,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding ResourceKey}" /> Text="{Binding ResourceKey}" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTemplateColumn Width="300" Header="BoxShadows">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ShadowItemViewModel">
<SelectableTextBlock
Margin="12,0"
VerticalAlignment="Center"
Text="{Binding BoxShadowValue}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn <DataGridTextColumn
Width="*" Width="*"
x:DataType="viewModels:ShadowItemViewModel" x:DataType="viewModels:ShadowItemViewModel"
Binding="{Binding ShadowDisplayName}" Binding="{Binding ShadowDisplayName}"
CanUserSort="False" CanUserSort="False"
Header="Name" /> Header="Description" />
<DataGridTemplateColumn Width="300" Header="BoxShadows"> <DataGridTemplateColumn Width="100" Header="CopyText">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ShadowItemViewModel"> <DataTemplate DataType="viewModels:ShadowItemViewModel">
<SelectableTextBlock <Button
Margin="12,0,12,0" Command="{Binding $parent[pages:PaletteDemo].Copy}"
VerticalAlignment="Center" CommandParameter="{Binding CopyText}"
Text="{Binding BoxShadowValue}" /> Theme="{DynamicResource IconBorderlessButton}"
Content="{StaticResource SemiIconCopy}" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>

View File

@@ -1,31 +1,46 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme x:Key="ThemeToggleSwitch" <Design.PreviewWith>
<StackPanel Orientation="Horizontal">
<ToggleSwitch
Theme="{DynamicResource IconBorderlessToggleSwitch}"
Content="{StaticResource SemiIconStar}" />
<Button
Theme="{DynamicResource IconBorderlessButton}"
Content="{StaticResource SemiIconStar}" />
</StackPanel>
</Design.PreviewWith>
<ControlTheme x:Key="IconBorderlessToggleSwitch"
BasedOn="{StaticResource ButtonToggleSwitch}" BasedOn="{StaticResource ButtonToggleSwitch}"
TargetType="ToggleSwitch"> TargetType="ToggleSwitch">
<Setter Property="Padding" Value="8" /> <Setter Property="Padding" Value="{StaticResource SemiThicknessTight}" />
<Setter Property="OnContent" Value="{Binding $self.Content}" /> <Setter Property="Width" Value="{StaticResource SemiSpacingExtraLoose}" />
<Setter Property="Height" Value="{StaticResource SemiSpacingExtraLoose}" />
<Setter Property="Foreground" Value="{DynamicResource SemiColorText1}" />
<Setter Property="OnContentTemplate"> <Setter Property="OnContentTemplate">
<DataTemplate> <StaticResource ResourceKey="GeometryDataTemplate" />
<PathIcon Theme="{StaticResource InnerPathIcon}" Data="{Binding}" />
</DataTemplate>
</Setter> </Setter>
<Setter Property="OffContent" Value="{Binding $self.Content}" />
<Setter Property="OffContentTemplate"> <Setter Property="OffContentTemplate">
<DataTemplate> <StaticResource ResourceKey="GeometryDataTemplate" />
<PathIcon Theme="{StaticResource InnerPathIcon}" Data="{Binding}" />
</DataTemplate>
</Setter> </Setter>
<Setter Property="ContentTemplate"> <Setter Property="ContentTemplate">
<DataTemplate> <StaticResource ResourceKey="GeometryDataTemplate" />
<PathIcon Theme="{StaticResource InnerPathIcon}" Data="{Binding}" />
</DataTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="SplitViewToggleSwitch" <ControlTheme x:Key="IconBorderlessButton"
BasedOn="{StaticResource ThemeToggleSwitch}" BasedOn="{StaticResource BorderlessButton}"
TargetType="ToggleSwitch"> TargetType="Button">
<Setter Property="Content" <Setter Property="Padding" Value="{StaticResource SemiThicknessTight}" />
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="Width" Value="{StaticResource SemiSpacingExtraLoose}" />
<Setter Property="Height" Value="{StaticResource SemiSpacingExtraLoose}" />
<Setter Property="Foreground" Value="{DynamicResource SemiColorText1}" />
<Setter Property="ContentTemplate">
<StaticResource ResourceKey="GeometryDataTemplate" />
</Setter>
</ControlTheme> </ControlTheme>
<DataTemplate x:Key="GeometryDataTemplate" DataType="Geometry">
<PathIcon Theme="{StaticResource InnerPathIcon}" Data="{Binding}" />
</DataTemplate>
</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

@@ -0,0 +1,19 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Semi.Avalonia.Demo.Views;
namespace Semi.Avalonia.Demo.ViewModels;
public partial class ApplicationViewModel: ObservableObject
{
[RelayCommand]
private void Exit()
{
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.Shutdown();
}
}
}

View File

@@ -8,14 +8,14 @@ using CommunityToolkit.Mvvm.Input;
namespace Semi.Avalonia.Demo.ViewModels; namespace Semi.Avalonia.Demo.ViewModels;
public class DataGridDemoViewModel: ObservableObject public class DataGridDemoViewModel : ObservableObject
{ {
public ObservableCollection<Song> GridData1 { get; set; } public ObservableCollection<Song> GridData1 { get; set; }
public DataGridCollectionView GridData2 { get; set; } public DataGridCollectionView GridData2 { get; set; }
public ObservableCollection<SongViewModel> GridData3 { get; set; } public ObservableCollection<SongViewModel> GridData3 { get; set; }
public RelayCommand AddCommand { get; set; } public RelayCommand AddCommand { get; set; }
public DataGridDemoViewModel() public DataGridDemoViewModel()
@@ -23,7 +23,7 @@ public class DataGridDemoViewModel: ObservableObject
GridData1 = new ObservableCollection<Song>(Song.Songs); GridData1 = new ObservableCollection<Song>(Song.Songs);
GridData2 = new DataGridCollectionView(Song.Songs); GridData2 = new DataGridCollectionView(Song.Songs);
GridData2.GroupDescriptions.Add(new DataGridPathGroupDescription("Album")); GridData2.GroupDescriptions.Add(new DataGridPathGroupDescription("Album"));
GridData3 = new ObservableCollection<SongViewModel>(Song.Songs.Take(10).Select(a=>new SongViewModel() GridData3 = new ObservableCollection<SongViewModel>(Song.Songs.Take(10).Select(a => new SongViewModel()
{ {
Title = a.Title, Title = a.Title,
Artist = a.Artist, Artist = a.Artist,
@@ -57,11 +57,10 @@ public class Song
Album = album; Album = album;
CountOfComment = countOfComment; CountOfComment = countOfComment;
Url = $"https://music.163.com/song?id={netEaseId}"; Url = $"https://music.163.com/song?id={netEaseId}";
} }
public static List<Song> Songs { get; set; } = new List<Song>() public static List<Song> Songs =>
{ [
new("好肚有肚(feat.李玲玉)", "熊猫堂ProducePandas", 2, 50, "A.S.I.A", 730, 1487039339), new("好肚有肚(feat.李玲玉)", "熊猫堂ProducePandas", 2, 50, "A.S.I.A", 730, 1487039339),
new("荒诞秀", "熊猫堂ProducePandas", 3, 15, "A.S.I.A", 639, 1487037601), new("荒诞秀", "熊猫堂ProducePandas", 3, 15, "A.S.I.A", 639, 1487037601),
new("长大", "熊猫堂ProducePandas", 4, 6, "A.S.I.A", 1114, 1487037690), new("长大", "熊猫堂ProducePandas", 4, 6, "A.S.I.A", 1114, 1487037690),
@@ -122,41 +121,15 @@ public class Song
new("热带季风Remix", "熊猫堂ProducePandas", 3, 22, "W.O.R.L.D.", 23, 2063173319), new("热带季风Remix", "熊猫堂ProducePandas", 3, 22, "W.O.R.L.D.", 23, 2063173319),
new("加州梦境", "熊猫堂ProducePandas", 2, 56, "W.O.R.L.D.", 1662, 2063173324), new("加州梦境", "熊猫堂ProducePandas", 2, 56, "W.O.R.L.D.", 1662, 2063173324),
new("渐近自由", "熊猫堂ProducePandas", 4, 19, "W.O.R.L.D.", 124, 2063173321), new("渐近自由", "熊猫堂ProducePandas", 4, 19, "W.O.R.L.D.", 124, 2063173321),
new("世界所有的烂漫", "熊猫堂ProducePandas", 3, 30, "W.O.R.L.D.", 335, 2053388775), new("世界所有的烂漫", "熊猫堂ProducePandas", 3, 30, "W.O.R.L.D.", 335, 2053388775)
}; ];
} }
public class SongViewModel: ObservableObject public partial class SongViewModel : ObservableObject
{ {
private string? _title; [ObservableProperty] private string? _title;
private string? _artist; [ObservableProperty] private string? _artist;
private string? _album; [ObservableProperty] private string? _album;
private int _countOfComment; [ObservableProperty] private int _countOfComment;
private bool? _isSelected; [ObservableProperty] private bool? _isSelected;
public string? Title
{
get => _title;
set => SetProperty(ref _title, value);
}
public string? Artist
{
get => _artist;
set => SetProperty(ref _artist, value);
}
public string? Album
{
get => _album;
set => SetProperty(ref _album, value);
}
public int CountOfComment
{
get => _countOfComment;
set => SetProperty(ref _countOfComment, value);
}
public bool? IsSelected
{
get => _isSelected;
set => SetProperty(ref _isSelected, value);
}
} }

View File

@@ -31,67 +31,59 @@ public partial class HighContrastDemoViewModel : ObservableObject
[ [
new ColorResource new ColorResource
{ {
ResourceKey = "WindowColor", ResourceKey = "SemiColorWindow",
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"
}, },
new ColorResource new ColorResource
{ {
ResourceKey = "WindowTextColor", ResourceKey = "SemiColorWindowText",
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"
}, },
new ColorResource new ColorResource
{ {
ResourceKey = "HotlightColor", ResourceKey = "SemiColorHotlight",
Brush = new SolidColorBrush(Color.Parse("#75E9FC")), Brush = new SolidColorBrush(Color.Parse("#75E9FC")),
Hex = "#FF75E9FC",
Description = "Hyperlinks.", Description = "Hyperlinks.",
PairWith = "WindowColor" PairWith = "WindowColor"
}, },
new ColorResource new ColorResource
{ {
ResourceKey = "GrayTextColor", ResourceKey = "SemiColorGrayText",
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"
}, },
new ColorResource new ColorResource
{ {
ResourceKey = "HighlightTextColor", ResourceKey = "SemiColorHighlightText",
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"
}, },
new ColorResource new ColorResource
{ {
ResourceKey = "HighlightColor", ResourceKey = "SemiColorHighlight",
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"
}, },
new ColorResource new ColorResource
{ {
ResourceKey = "ButtonTextColor", ResourceKey = "SemiColorButtonText",
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"
}, },
new ColorResource new ColorResource
{ {
ResourceKey = "ButtonFaceColor", ResourceKey = "SemiColorButtonFace",
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"
}, },
@@ -108,10 +100,10 @@ public partial class HighContrastDemoViewModel : ObservableObject
foreach (var colorResource in ColorResources) foreach (var colorResource in ColorResources)
{ {
if (colorResource.ResourceKey is null) continue; if (colorResource.ResourceKey is null) continue;
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 ISolidColorBrush color)
{ {
colorResource.Brush = new SolidColorBrush(color); colorResource.Brush = color;
colorResource.Hex = color.ToString().ToUpperInvariant();
} }
} }
} }
@@ -130,8 +122,12 @@ public partial class HighContrastDemoViewModel : ObservableObject
public partial class ColorResource : ObservableObject public partial class ColorResource : ObservableObject
{ {
[ObservableProperty] private string? _resourceKey; [ObservableProperty] private string? _resourceKey;
[ObservableProperty] private SolidColorBrush? _brush; [ObservableProperty] private ISolidColorBrush? _brush;
[ObservableProperty] private string? _hex;
[ObservableProperty] private string? _description; [ObservableProperty] private string? _description;
[ObservableProperty] private string? _pairWith; [ObservableProperty] private string? _pairWith;
public string CopyText =>
$"""
<StaticResource x:Key="" ResourceKey="{ResourceKey}" />
""";
} }

View File

@@ -1,15 +1,18 @@
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.Demo.Constant;
using Semi.Avalonia.Demo.Converters;
using Semi.Avalonia.Tokens.Palette; using Semi.Avalonia.Tokens.Palette;
namespace Semi.Avalonia.Demo.ViewModels; namespace Semi.Avalonia.Demo.ViewModels;
public class PaletteDemoViewModel : ObservableObject public partial class PaletteDemoViewModel : ObservableObject
{ {
private readonly string[] _predefinedColorNames = private readonly string[] _predefinedColorNames =
[ [
@@ -22,31 +25,10 @@ public class PaletteDemoViewModel : ObservableObject
private readonly IResourceDictionary? _lightResourceDictionary; private readonly IResourceDictionary? _lightResourceDictionary;
private readonly IResourceDictionary? _darkResourceDictionary; private readonly IResourceDictionary? _darkResourceDictionary;
private ColorItemViewModel _selectedColor = null!; [ObservableProperty] private ColorItemViewModel? _selectedColor;
public ColorItemViewModel SelectedColor
{
get => _selectedColor;
set => SetProperty(ref _selectedColor, value);
}
private ObservableCollection<ColorListViewModel>? _lightLists;
public ObservableCollection<ColorListViewModel>? LightLists
{
get => _lightLists;
set => SetProperty(ref _lightLists, value);
}
private ObservableCollection<ColorListViewModel>? _darkLists;
public ObservableCollection<ColorListViewModel>? DarkLists
{
get => _darkLists;
set => SetProperty(ref _darkLists, value);
}
public ObservableCollection<ColorListViewModel> LightLists { get; set; } = [];
public ObservableCollection<ColorListViewModel> DarkLists { get; set; } = [];
public ObservableCollection<FunctionalColorGroupViewModel> FunctionalColors { get; set; } = []; public ObservableCollection<FunctionalColorGroupViewModel> FunctionalColors { get; set; } = [];
public ObservableCollection<ShadowGroupViewModel> Shadows { get; set; } = []; public ObservableCollection<ShadowGroupViewModel> Shadows { get; set; } = [];
@@ -54,7 +36,7 @@ public class PaletteDemoViewModel : ObservableObject
{ {
_lightResourceDictionary = new Light(); _lightResourceDictionary = new Light();
_darkResourceDictionary = new Dark(); _darkResourceDictionary = new Dark();
WeakReferenceMessenger.Default.Register<PaletteDemoViewModel, ColorItemViewModel>(this, OnClickColorItem); WeakReferenceMessenger.Default.Register<ColorItemViewModel>(this, (_, item) => SelectedColor = item);
} }
public void InitializeResources() public void InitializeResources()
@@ -66,7 +48,6 @@ public class PaletteDemoViewModel : ObservableObject
private void InitializePalette() private void InitializePalette()
{ {
LightLists = [];
foreach (var color in _predefinedColorNames) foreach (var color in _predefinedColorNames)
{ {
ColorListViewModel s = new ColorListViewModel(); ColorListViewModel s = new ColorListViewModel();
@@ -74,7 +55,6 @@ public class PaletteDemoViewModel : ObservableObject
LightLists.Add(s); LightLists.Add(s);
} }
DarkLists = [];
foreach (var color in _predefinedColorNames) foreach (var color in _predefinedColorNames)
{ {
ColorListViewModel s = new ColorListViewModel(); ColorListViewModel s = new ColorListViewModel();
@@ -85,126 +65,82 @@ public class PaletteDemoViewModel : ObservableObject
private void InitializeFunctionalColors() private void InitializeFunctionalColors()
{ {
FunctionalColors.Add(new FunctionalColorGroupViewModel("Primary", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.PrimaryTokens)); FunctionalColors.Add(new FunctionalColorGroupViewModel(
FunctionalColors.Add(new FunctionalColorGroupViewModel("Secondary", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.SecondaryTokens)); "Primary", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.PrimaryTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel("Tertiary", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.TertiaryTokens)); FunctionalColors.Add(new FunctionalColorGroupViewModel(
FunctionalColors.Add(new FunctionalColorGroupViewModel("Information", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.InformationTokens)); "Secondary", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.SecondaryTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel("Success", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.SuccessTokens)); FunctionalColors.Add(new FunctionalColorGroupViewModel(
FunctionalColors.Add(new FunctionalColorGroupViewModel("Warning", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.WarningTokens)); "Tertiary", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.TertiaryTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel("Danger", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.DangerTokens)); FunctionalColors.Add(new FunctionalColorGroupViewModel(
FunctionalColors.Add(new FunctionalColorGroupViewModel("Text", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.TextTokens)); "Information", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.InformationTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel("Link", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.LinkTokens)); FunctionalColors.Add(new FunctionalColorGroupViewModel(
FunctionalColors.Add(new FunctionalColorGroupViewModel("Background", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.BackgroundTokens)); "Success", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.SuccessTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel("Fill", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.FillTokens)); FunctionalColors.Add(new FunctionalColorGroupViewModel(
FunctionalColors.Add(new FunctionalColorGroupViewModel("Border", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.BorderTokens)); "Warning", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.WarningTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel("Disabled", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.DisabledTokens)); FunctionalColors.Add(new FunctionalColorGroupViewModel(
"Danger", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.DangerTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel(
"Text", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.TextTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel(
"Link", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.LinkTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel(
"Background", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.BackgroundTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel(
"Fill", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.FillTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel(
"Border", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.BorderTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel(
"Disabled", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.DisabledTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel(
"Others", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.OtherTokens));
} }
private void InitializeShadows() private void InitializeShadows()
{ {
Shadows.Add(new ShadowGroupViewModel("Shadow", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.ShadowTokens)); Shadows.Add(new ShadowGroupViewModel(
} "Shadow", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.ShadowTokens));
private void OnClickColorItem(PaletteDemoViewModel vm, ColorItemViewModel item)
{
SelectedColor = item;
} }
} }
public class ColorListViewModel : ObservableObject public partial class ColorListViewModel : ObservableObject
{ {
private ObservableCollection<ColorItemViewModel>? _colors; public ObservableCollection<ColorItemViewModel> Color { get; set; } = [];
public ObservableCollection<ColorItemViewModel>? Color [ObservableProperty] private string? _seriesName;
{
get => _colors;
set => SetProperty(ref _colors, value);
}
private string? _seriesName;
public string? SeriesName
{
get => _seriesName;
set => SetProperty(ref _seriesName, value);
}
internal void Initialize(IResourceDictionary? resourceDictionary, string color, bool light) internal void Initialize(IResourceDictionary? resourceDictionary, string color, bool light)
{ {
if (resourceDictionary is null) if (resourceDictionary is null) return;
{
return;
}
SeriesName = color; SeriesName = color;
Color = [];
for (var i = 0; i < 10; i++) for (var i = 0; i < 10; i++)
{ {
var key = "Semi" + color + i; var key = $"Semi{color}{i}";
if (resourceDictionary.TryGetValue(key, out var value)) if (resourceDictionary.TryGetValue(key, out var value) && value is ISolidColorBrush brush)
{ {
if (value is ISolidColorBrush brush) var name = $"{color} {i}";
{ var item = new ColorItemViewModel(name, brush, key, light, i);
string name = color + " " + i; item.ColorResourceKey = $"{item.ResourceKey}Color";
var item = new ColorItemViewModel(name, brush, key, light, i); Color.Add(item);
item.ColorResourceKey = item.ResourceKey + "Color";
Color.Add(item);
}
} }
} }
} }
} }
public class ColorItemViewModel : ObservableObject public partial class ColorItemViewModel : ObservableObject
{ {
private IBrush _brush = null!; [ObservableProperty] private IBrush? _brush;
[ObservableProperty] private IBrush? _textBrush;
[ObservableProperty] private string? _colorDisplayName;
[ObservableProperty] private string? _resourceKey;
[ObservableProperty] private string? _colorResourceKey;
[ObservableProperty] private string? _hex;
public IBrush Brush public string CopyText =>
{ $"""
get => _brush; <StaticResource x:Key="" ResourceKey="{ResourceKey}" />
set => SetProperty(ref _brush, value); """;
}
private IBrush _textBrush = null!;
public IBrush TextBrush
{
get => _textBrush;
set => SetProperty(ref _textBrush, value);
}
private string _colorDisplayName = null!;
public string ColorDisplayName
{
get => _colorDisplayName;
set => SetProperty(ref _colorDisplayName, value);
}
private string _resourceKey = null!;
public string ResourceKey
{
get => _resourceKey;
set => SetProperty(ref _resourceKey, value);
}
private string _colorResourceKey = null!;
public string ColorResourceKey
{
get => _colorResourceKey;
set => SetProperty(ref _colorResourceKey, value);
}
private string _hex = null!;
public string Hex
{
get => _hex;
set => SetProperty(ref _hex, value);
}
public ColorItemViewModel(string colorDisplayName, ISolidColorBrush brush, string resourceKey, bool light, public ColorItemViewModel(string colorDisplayName, ISolidColorBrush brush, string resourceKey, bool light,
int index) int index)
@@ -212,7 +148,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;
@@ -224,16 +161,9 @@ public class ColorItemViewModel : ObservableObject
} }
} }
public class FunctionalColorGroupViewModel : ObservableObject public partial class FunctionalColorGroupViewModel : ObservableObject
{ {
private string _title = null!; [ObservableProperty] private string? _title;
public string Title
{
get => _title;
set => SetProperty(ref _title, value);
}
public ObservableCollection<ColorItemViewModel> LightColors { get; set; } = []; public ObservableCollection<ColorItemViewModel> LightColors { get; set; } = [];
public ObservableCollection<ColorItemViewModel> DarkColors { get; set; } = []; public ObservableCollection<ColorItemViewModel> DarkColors { get; set; } = [];
@@ -262,31 +192,16 @@ public class FunctionalColorGroupViewModel : ObservableObject
} }
} }
public class ShadowItemViewModel : ObservableObject public partial class ShadowItemViewModel : ObservableObject
{ {
private string _shadowDisplayName = null!; [ObservableProperty] private string? _shadowDisplayName;
[ObservableProperty] private string? _resourceKey;
[ObservableProperty] private string? _boxShadowValue;
public string ShadowDisplayName public string CopyText =>
{ $"""
get => _shadowDisplayName; <StaticResource x:Key="" ResourceKey="{ResourceKey}" />
set => SetProperty(ref _shadowDisplayName, value); """;
}
private string _resourceKey = null!;
public string ResourceKey
{
get => _resourceKey;
set => SetProperty(ref _resourceKey, value);
}
private string _boxShadowValue = null!;
public string BoxShadowValue
{
get => _boxShadowValue;
set => SetProperty(ref _boxShadowValue, value);
}
public ShadowItemViewModel(string shadowDisplayName, BoxShadows boxShadows, string resourceKey) public ShadowItemViewModel(string shadowDisplayName, BoxShadows boxShadows, string resourceKey)
{ {
@@ -296,16 +211,9 @@ public class ShadowItemViewModel : ObservableObject
} }
} }
public class ShadowGroupViewModel : ObservableObject public partial class ShadowGroupViewModel : ObservableObject
{ {
private string _title = null!; [ObservableProperty] private string? _title;
public string Title
{
get => _title;
set => SetProperty(ref _title, value);
}
public ObservableCollection<ShadowItemViewModel> LightShadows { get; set; } = []; public ObservableCollection<ShadowItemViewModel> LightShadows { get; set; } = [];
public ObservableCollection<ShadowItemViewModel> DarkShadows { get; set; } = []; public ObservableCollection<ShadowItemViewModel> DarkShadows { get; set; } = [];
@@ -333,132 +241,4 @@ public class ShadowGroupViewModel : ObservableObject
} }
} }
} }
}
public static class ColorTokens
{
public static IReadOnlyList<Tuple<string, string>> PrimaryTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorPrimary", "Primary"),
new("SemiColorPrimaryPointerover", "Primary Pointerover"),
new("SemiColorPrimaryActive", "Primary Active"),
new("SemiColorPrimaryDisabled", "Primary Disabled"),
new("SemiColorPrimaryLight", "Primary Light"),
new("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"),
new("SemiColorPrimaryLightActive", "Primary Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> SecondaryTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorSecondary", "Secondary"),
new("SemiColorSecondaryPointerover", "Secondary Pointerover"),
new("SemiColorSecondaryActive", "Secondary Active"),
new("SemiColorSecondaryDisabled", "Secondary Disabled"),
new("SemiColorSecondaryLight", "Secondary Light"),
new("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"),
new("SemiColorSecondaryLightActive", "Secondary Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> TertiaryTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorTertiary", "Tertiary"),
new("SemiColorTertiaryPointerover", "Tertiary Pointerover"),
new("SemiColorTertiaryActive", "Tertiary Active"),
new("SemiColorTertiaryLight", "Tertiary Light"),
new("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"),
new("SemiColorTertiaryLightActive", "Tertiary Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> InformationTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorInformation", "Information"),
new("SemiColorInformationPointerover", "Information Pointerover"),
new("SemiColorInformationActive", "Information Active"),
new("SemiColorInformationDisabled", "Information Disabled"),
new("SemiColorInformationLight", "Information Light"),
new("SemiColorInformationLightPointerover", "Information Light Pointerover"),
new("SemiColorInformationLightActive", "Information Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> SuccessTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorSuccess", "Success"),
new("SemiColorSuccessPointerover", "Success Pointerover"),
new("SemiColorSuccessActive", "Success Active"),
new("SemiColorSuccessDisabled", "Success Disabled"),
new("SemiColorSuccessLight", "Success Light"),
new("SemiColorSuccessLightPointerover", "Success Light Pointerover"),
new("SemiColorSuccessLightActive", "Success Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> WarningTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorWarning", "Warning"),
new("SemiColorWarningPointerover", "Warning Pointerover"),
new("SemiColorWarningActive", "Warning Active"),
new("SemiColorWarningLight", "Warning Light"),
new("SemiColorWarningLightPointerover", "Warning Light Pointerover"),
new("SemiColorWarningLightActive", "Warning Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> DangerTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorDanger", "Danger"),
new("SemiColorDangerPointerover", "Danger Pointerover"),
new("SemiColorDangerActive", "Danger Active"),
new("SemiColorDangerLight", "Danger Light"),
new("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
new("SemiColorDangerLightActive", "Danger Light Active"),
};
public static IReadOnlyList<Tuple<string, string>> TextTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorText0", "Text 0"),
new("SemiColorText1", "Text 1"),
new("SemiColorText2", "Text 2"),
new("SemiColorText3", "Text 3"),
};
public static IReadOnlyList<Tuple<string, string>> LinkTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorLink", "Link"),
new("SemiColorLinkPointerover", "Link Pointerover"),
new("SemiColorLinkActive", "Link Active"),
new("SemiColorLinkVisited", "Link Visited"),
};
public static IReadOnlyList<Tuple<string, string>> BackgroundTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorBackground0", "Background 0"),
new("SemiColorBackground1", "Background 1"),
new("SemiColorBackground2", "Background 2"),
new("SemiColorBackground3", "Background 3"),
new("SemiColorBackground4", "Background 4"),
};
public static IReadOnlyList<Tuple<string, string>> FillTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorFill0", "Fill 0"),
new("SemiColorFill1", "Fill 1"),
new("SemiColorFill2", "Fill 2"),
};
public static IReadOnlyList<Tuple<string, string>> BorderTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorBorder", "Border"),
};
public static IReadOnlyList<Tuple<string, string>> DisabledTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorDisabledText", "Disabled Text"),
new("SemiColorDisabledBorder", "Disabled Border"),
new("SemiColorDisabledBackground", "Disabled Background"),
new("SemiColorDisabledFill", "Disabled Fill"),
};
public static IReadOnlyList<Tuple<string, string>> ShadowTokens { get; } = new List<Tuple<string, string>>
{
new("SemiColorShadow", "Shadow"),
new("SemiShadowElevated", "Shadow Elevated"),
};
} }

View File

@@ -0,0 +1,123 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using Avalonia;
using Avalonia.Collections;
using Avalonia.Controls;
using Avalonia.Media;
using CommunityToolkit.Mvvm.ComponentModel;
using Semi.Avalonia.Tokens;
namespace Semi.Avalonia.Demo.ViewModels;
public class VariablesDemoViewModel : ObservableObject
{
public DataGridCollectionView GridData { get; set; }
public VariablesDemoViewModel()
{
IResourceDictionary dictionary = new Variables();
foreach (var token in Tokens)
{
if (token.ResourceKey is not null && dictionary.TryGetValue(token.ResourceKey, out var value))
{
token.Type = value?.GetType();
token.Value = GetValueString(value);
}
}
GridData = new DataGridCollectionView(Tokens);
GridData.GroupDescriptions.Add(new DataGridPathGroupDescription(nameof(VariableItem.Category)));
}
private static string GetValueString(object? value)
{
if (value is null) return string.Empty;
return value switch
{
double d => d.ToString(CultureInfo.InvariantCulture),
CornerRadius c => c.IsUniform ? $"{c.TopLeft}" : c.ToString(),
Thickness t => t.IsUniform ? $"{t.Left}" : t.ToString(),
FontWeight fontWeight => Convert.ToInt32(fontWeight).ToString(),
FontFamily fontFamily => fontFamily.FamilyNames.ToString(),
_ => value.ToString()
};
}
private static List<VariableItem> Tokens { get; set; } =
[
new("Height", "SemiHeightControlSmall"),
new("Height", "SemiHeightControlDefault"),
new("Height", "SemiHeightControlLarge"),
new("Icon Size", "SemiWidthIconExtraSmall"),
new("Icon Size", "SemiWidthIconSmall"),
new("Icon Size", "SemiWidthIconMedium"),
new("Icon Size", "SemiWidthIconLarge"),
new("Icon Size", "SemiWidthIconExtraLarge"),
new("Border CornerRadius", "SemiBorderRadiusExtraSmall"),
new("Border CornerRadius", "SemiBorderRadiusSmall"),
new("Border CornerRadius", "SemiBorderRadiusMedium"),
new("Border CornerRadius", "SemiBorderRadiusLarge"),
new("Border CornerRadius", "SemiBorderRadiusFull"),
new("Border Spacing", "SemiBorderSpacing"),
new("Border Spacing", "SemiBorderSpacingControl"),
new("Border Spacing", "SemiBorderSpacingControlFocus"),
new("Border Thickness", "SemiBorderThickness"),
new("Border Thickness", "SemiBorderThicknessControl"),
new("Border Thickness", "SemiBorderThicknessControlFocus"),
new("Spacing", "SemiSpacingNone"),
new("Spacing", "SemiSpacingSuperTight"),
new("Spacing", "SemiSpacingExtraTight"),
new("Spacing", "SemiSpacingTight"),
new("Spacing", "SemiSpacingBaseTight"),
new("Spacing", "SemiSpacingBase"),
new("Spacing", "SemiSpacingBaseLoose"),
new("Spacing", "SemiSpacingLoose"),
new("Spacing", "SemiSpacingExtraLoose"),
new("Spacing", "SemiSpacingSuperLoose"),
new("Thickness", "SemiThicknessNone"),
new("Thickness", "SemiThicknessSuperTight"),
new("Thickness", "SemiThicknessExtraTight"),
new("Thickness", "SemiThicknessTight"),
new("Thickness", "SemiThicknessBaseTight"),
new("Thickness", "SemiThicknessBase"),
new("Thickness", "SemiThicknessBaseLoose"),
new("Thickness", "SemiThicknessLoose"),
new("Thickness", "SemiThicknessExtraLoose"),
new("Thickness", "SemiThicknessSuperLoose"),
new("FontSize", "SemiFontSizeSmall"),
new("FontSize", "SemiFontSizeRegular"),
new("FontSize", "SemiFontSizeHeader6"),
new("FontSize", "SemiFontSizeHeader5"),
new("FontSize", "SemiFontSizeHeader4"),
new("FontSize", "SemiFontSizeHeader3"),
new("FontSize", "SemiFontSizeHeader2"),
new("FontSize", "SemiFontSizeHeader1"),
new("FontWeight", "SemiFontWeightLight"),
new("FontWeight", "SemiFontWeightRegular"),
new("FontWeight", "SemiFontWeightBold"),
new("FontFamily", "SemiFontFamilyRegular"),
];
}
public class VariableItem()
{
public string? Category { get; set; }
public string? ResourceKey { get; set; }
public Type? Type { get; set; }
public string? Value { get; set; }
public string? Description { get; set; }
public VariableItem(string category, string resourceKey, string description = "") : this()
{
Category = category;
ResourceKey = resourceKey;
Description = description;
}
public string CopyText =>
$"""
<StaticResource x:Key="" ResourceKey="{ResourceKey}" />
""";
}

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"
@@ -29,7 +21,8 @@
<StackPanel Orientation="Horizontal" Spacing="8"> <StackPanel Orientation="Horizontal" Spacing="8">
<ToggleSwitch <ToggleSwitch
Name="ExpandButton" Name="ExpandButton"
Theme="{DynamicResource SplitViewToggleSwitch}" /> Theme="{DynamicResource IconBorderlessToggleSwitch}"
Content="{StaticResource SemiIconSidebar}" />
<SelectableTextBlock <SelectableTextBlock
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="H6" Classes="H6"
@@ -44,36 +37,27 @@
Text="{ReflectionBinding #tab.SelectedItem.Header}" /> Text="{ReflectionBinding #tab.SelectedItem.Header}" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<StackPanel.Styles> <Button
<Style Selector="Button"> Theme="{DynamicResource IconBorderlessButton}"
<Setter Property="Theme" Value="{DynamicResource BorderlessButton}" /> Command="{Binding OpenUrlCommand}"
<Setter Property="Padding" Value="8" /> CommandParameter="{Binding DocumentationUrl}"
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" /> Content="{StaticResource SemiIconGlobe}" />
</Style>
<Style Selector="ToggleSwitch">
<Setter Property="Theme" Value="{DynamicResource ThemeToggleSwitch}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
</Style>
<Style Selector="PathIcon">
<Setter Property="Theme" Value="{DynamicResource InnerPathIcon}" />
</Style>
</StackPanel.Styles>
<Button Command="{Binding OpenUrlCommand}" CommandParameter="{Binding DocumentationUrl}"> <Button
<PathIcon Data="{StaticResource SemiIconGlobe}" /> Theme="{DynamicResource IconBorderlessButton}"
</Button> Command="{Binding OpenUrlCommand}"
CommandParameter="{Binding RepoUrl}"
<Button Command="{Binding OpenUrlCommand}" CommandParameter="{Binding RepoUrl}"> Content="{StaticResource SemiIconGithubLogo}" />
<PathIcon Data="{StaticResource SemiIconGithubLogo}" />
</Button>
<ToggleSwitch <ToggleSwitch
Theme="{DynamicResource IconBorderlessToggleSwitch}"
Command="{Binding ToggleThemeCommand}" Command="{Binding ToggleThemeCommand}"
OnContent="{StaticResource SemiIconMoon}" OnContent="{StaticResource SemiIconMoon}"
OffContent="{StaticResource SemiIconSun}" /> OffContent="{StaticResource SemiIconSun}" />
<Button> <Button
<PathIcon Data="{StaticResource SemiIconMenu}" /> Theme="{DynamicResource IconBorderlessButton}"
Content="{StaticResource SemiIconMenu}">
<Button.Flyout> <Button.Flyout>
<MenuFlyout Placement="Bottom" ItemsSource="{Binding MenuItems}" /> <MenuFlyout Placement="Bottom" ItemsSource="{Binding MenuItems}" />
</Button.Flyout> </Button.Flyout>
@@ -107,6 +91,9 @@
<TabItem Header="HighContrastTheme"> <TabItem Header="HighContrastTheme">
<pages:HighContrastDemo /> <pages:HighContrastDemo />
</TabItem> </TabItem>
<TabItem Header="Variables">
<pages:VariablesDemo />
</TabItem>
<TabItem Header="Icon"> <TabItem Header="Icon">
<pages:IconDemo /> <pages:IconDemo />
</TabItem> </TabItem>

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
using Avalonia; using Avalonia;
@@ -32,9 +33,14 @@ public partial class MainViewModel : ObservableObject
[ [
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "High Contrast Theme", Header = "Theme",
Items = Items =
[ [
new MenuItemViewModel
{
Header = "Auto",
Command = FollowSystemThemeCommand
},
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "Aquatic", Header = "Aquatic",
@@ -60,10 +66,65 @@ public partial class MainViewModel : ObservableObject
CommandParameter = SemiTheme.NightSky CommandParameter = SemiTheme.NightSky
}, },
] ]
},
new MenuItemViewModel
{
Header = "Locale",
Items =
[
new MenuItemViewModel
{
Header = "简体中文",
Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("zh-cn")
},
new MenuItemViewModel
{
Header = "English",
Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("en-us")
},
new MenuItemViewModel
{
Header = "日本語",
Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("ja-jp")
},
new MenuItemViewModel
{
Header = "Українська",
Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("uk-ua")
},
new MenuItemViewModel
{
Header = "Русский",
Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("ru-ru")
},
new MenuItemViewModel
{
Header = "繁體中文",
Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("zh-tw")
},
new MenuItemViewModel
{
Header = "Deutsch",
Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("de-de")
},
]
} }
]; ];
} }
[RelayCommand]
private void FollowSystemTheme()
{
Application.Current?.RegisterFollowSystemTheme();
}
[RelayCommand] [RelayCommand]
private void ToggleTheme() private void ToggleTheme()
{ {
@@ -71,16 +132,24 @@ public partial class MainViewModel : ObservableObject
if (app is null) return; if (app is null) return;
var theme = app.ActualThemeVariant; var theme = app.ActualThemeVariant;
app.RequestedThemeVariant = theme == ThemeVariant.Dark ? ThemeVariant.Light : ThemeVariant.Dark; app.RequestedThemeVariant = theme == ThemeVariant.Dark ? ThemeVariant.Light : ThemeVariant.Dark;
app.UnregisterFollowSystemTheme();
} }
[RelayCommand] [RelayCommand]
private void SelectTheme(object? obj) private void SelectTheme(object? obj)
{ {
var app = Application.Current; var app = Application.Current;
if (app is not null) if (app is null) return;
{ app.RequestedThemeVariant = obj as ThemeVariant;
app.RequestedThemeVariant = obj as ThemeVariant; app.UnregisterFollowSystemTheme();
} }
[RelayCommand]
private void SelectLocale(object? obj)
{
var app = Application.Current;
if (app is null) return;
SemiTheme.OverrideLocaleResources(app, obj as CultureInfo);
} }
[RelayCommand] [RelayCommand]

View File

@@ -8,7 +8,7 @@
Title="Semi.Avalonia.Demo" Title="Semi.Avalonia.Demo"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
Icon="/Assets/avalonia-logo.ico" Icon="/Assets/irihi.ico"
mc:Ignorable="d"> mc:Ignorable="d">
<views:MainView /> <views:MainView />
</Window> </Window>

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.4</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.4</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.4</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

View File

@@ -5,15 +5,14 @@
<Design.PreviewWith> <Design.PreviewWith>
<CaptionButtons /> <CaptionButtons />
</Design.PreviewWith> </Design.PreviewWith>
<ControlTheme x:Key="CaptionButton" TargetType="Button"> <ControlTheme x:Key="CaptionButton" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource CaptionButtonPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource CaptionButtonPressedBackground}" />
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" /> <Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" />
<Setter Property="CornerRadius" Value="6" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="Margin" Value="0, 4" /> <Setter Property="CornerRadius" Value="{StaticResource CaptionButtonCornerRadius}" />
<Setter Property="Padding" Value="4" /> <Setter Property="Padding" Value="{StaticResource CaptionButtonPadding}" />
<Setter Property="Height" Value="28" /> <Setter Property="Width" Value="{StaticResource CaptionButtonWidth}" />
<Setter Property="Width" Value="28" /> <Setter Property="Height" Value="{StaticResource CaptionButtonHeight}" />
<Setter Property="Cursor" Value="Hand" /> <Setter Property="Cursor" Value="Hand" />
<Setter Property="VerticalAlignment" Value="Stretch" /> <Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="Template"> <Setter Property="Template">
@@ -21,77 +20,76 @@
<ContentPresenter <ContentPresenter
Name="PART_ContentPresenter" Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}" Padding="{TemplateBinding Padding}"
Background="Transparent" Foreground="{TemplateBinding Foreground}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" /> CornerRadius="{TemplateBinding CornerRadius}" />
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^:pointerover /template/ ContentPresenter"> <Style Selector="^:pointerover">
<Setter Property="Background" Value="{TemplateBinding Background}" /> <Setter Property="Background" Value="{DynamicResource CaptionButtonPointeroverBackground}" />
</Style> </Style>
<Style Selector="^:pressed /template/ ContentPresenter"> <Style Selector="^:pressed">
<Setter Property="Background" Value="{TemplateBinding BorderBrush}" /> <Setter Property="Background" Value="{DynamicResource CaptionButtonPressedBackground}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="{x:Type CaptionButtons}" TargetType="CaptionButtons"> <ControlTheme x:Key="{x:Type CaptionButtons}" TargetType="CaptionButtons">
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" /> <Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" />
<Setter Property="Margin" Value="0 0 4 0" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="CaptionButtons"> <ControlTemplate TargetType="CaptionButtons">
<StackPanel <StackPanel Orientation="Horizontal">
VerticalAlignment="Stretch"
Orientation="Horizontal"
Spacing="2"
TextElement.FontSize="10">
<Button Name="PART_FullScreenButton" Theme="{StaticResource CaptionButton}"> <Button Name="PART_FullScreenButton" Theme="{StaticResource CaptionButton}">
<PathIcon <PathIcon
Name="PART_FullScreenButtonIcon" Name="PART_FullScreenButtonIcon"
Theme="{DynamicResource InnerPathIcon}" Theme="{StaticResource InnerPathIcon}"
Data="{DynamicResource WindowExpandGlyph}" Data="{StaticResource WindowExpandGlyph}"
Foreground="{Binding $parent[Button].Foreground}" /> Foreground="{Binding $parent[Button].Foreground}" />
</Button> </Button>
<Button Name="PART_MinimizeButton" Theme="{StaticResource CaptionButton}"> <Button Name="PART_MinimizeButton" Theme="{StaticResource CaptionButton}">
<PathIcon <PathIcon
Theme="{DynamicResource InnerPathIcon}" Name="PART_MinimizeButtonIcon"
Data="{DynamicResource WindowMinimizeGlyph}" Theme="{StaticResource InnerPathIcon}"
Data="{StaticResource WindowMinimizeGlyph}"
Foreground="{Binding $parent[Button].Foreground}" /> Foreground="{Binding $parent[Button].Foreground}" />
</Button> </Button>
<Button Name="PART_RestoreButton" Theme="{StaticResource CaptionButton}"> <Button Name="PART_RestoreButton" Theme="{StaticResource CaptionButton}">
<PathIcon <PathIcon
Name="PART_RestoreButtonIcon" Name="PART_RestoreButtonIcon"
Theme="{DynamicResource InnerPathIcon}" Theme="{StaticResource InnerPathIcon}"
Data="{DynamicResource WindowMaximizeGlyph}" Data="{StaticResource WindowMaximizeGlyph}"
Foreground="{Binding $parent[Button].Foreground}" /> Foreground="{Binding $parent[Button].Foreground}" />
</Button> </Button>
<Button <Button Name="PART_CloseButton" Theme="{StaticResource CaptionButton}">
Name="PART_CloseButton"
Background="{DynamicResource CaptionButtonClosePointeroverBackground}"
BorderBrush="{DynamicResource CaptionButtonClosePressedBackground}"
Theme="{StaticResource CaptionButton}">
<Button.Styles>
<Style Selector="Button:pointerover">
<Setter Property="Foreground" Value="White" />
</Style>
<Style Selector="Button:pressed">
<Setter Property="Foreground" Value="White" />
</Style>
</Button.Styles>
<PathIcon <PathIcon
Theme="{DynamicResource InnerPathIcon}" Name="PART_CloseButtonIcon"
Data="{DynamicResource WindowCloseIconGlyph}" Theme="{StaticResource InnerPathIcon}"
Data="{StaticResource WindowCloseIconGlyph}"
Foreground="{Binding $parent[Button].Foreground}" /> Foreground="{Binding $parent[Button].Foreground}" />
</Button> </Button>
</StackPanel> </StackPanel>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ Button#PART_CloseButton:pointerover">
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonCloseForeground}" />
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePointeroverBackground}" />
</Style>
<Style Selector="^ /template/ Button#PART_CloseButton:pressed">
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonCloseForeground}" />
<Setter Property="Background" Value="{DynamicResource CaptionButtonClosePressedBackground}" />
</Style>
<Style Selector="^:maximized /template/ PathIcon#PART_RestoreButtonIcon"> <Style Selector="^:maximized /template/ PathIcon#PART_RestoreButtonIcon">
<Setter Property="Data" Value="{DynamicResource WindowRestoreGlyph}" /> <Setter Property="Data" Value="{StaticResource WindowRestoreGlyph}" />
</Style> </Style>
<Style Selector="^:fullscreen /template/ PathIcon#PART_FullScreenButtonIcon"> <Style Selector="^:fullscreen /template/ PathIcon#PART_FullScreenButtonIcon">
<Setter Property="Data" Value="{DynamicResource WindowCollapseGlyph}" /> <Setter Property="Data" Value="{StaticResource WindowCollapseGlyph}" />
</Style> </Style>
<Style Selector="^:fullscreen /template/ Button#PART_RestoreButton"> <Style Selector="^:fullscreen /template/ Button#PART_RestoreButton">
<Setter Property="IsVisible" Value="False" /> <Setter Property="IsVisible" Value="False" />
@@ -100,4 +98,4 @@
<Setter Property="IsVisible" Value="False" /> <Setter Property="IsVisible" Value="False" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -169,7 +169,6 @@
<Grid <Grid
Name="PART_ButtonContentGrid" Name="PART_ButtonContentGrid"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center"
ColumnDefinitions="78*,Auto,132*,Auto,78*"> ColumnDefinitions="78*,Auto,132*,Auto,78*">
<TextBlock <TextBlock
Name="PART_DayTextBlock" Name="PART_DayTextBlock"
@@ -203,16 +202,12 @@
Name="PART_FirstSpacer" Name="PART_FirstSpacer"
Grid.Column="1" Grid.Column="1"
Width="1" Width="1"
Height="{TemplateBinding Height}"
MinHeight="{TemplateBinding MinHeight}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" /> Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
<Rectangle <Rectangle
Name="PART_SecondSpacer" Name="PART_SecondSpacer"
Grid.Column="3" Grid.Column="3"
Width="1" Width="1"
Height="{TemplateBinding Height}"
MinHeight="{TemplateBinding MinHeight}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" /> Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
</Grid> </Grid>

View File

@@ -23,21 +23,22 @@
BorderThickness="0" BorderThickness="0"
Command="{Binding LineUp, RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding LineUp, RelativeSource={RelativeSource TemplatedParent}}"
CornerRadius="0" CornerRadius="0"
MinHeight="0"
DockPanel.Dock="Top" DockPanel.Dock="Top"
RenderTransform="{x:Null}"> RenderTransform="{x:Null}">
<RepeatButton.IsVisible> <RepeatButton.IsVisible>
<MultiBinding <MultiBinding
Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}"
ConverterParameter="0"> ConverterParameter="0">
<Binding Path="VerticalScrollBarVisibility" <Binding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" /> <Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" /> <Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" /> <Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding> </MultiBinding>
</RepeatButton.IsVisible> </RepeatButton.IsVisible>
<PathIcon <PathIcon
Theme="{DynamicResource InnerPathIcon}" Width="8"
Height="8"
Data="{DynamicResource MenuScrollViewerUpButtonGlyph}" Data="{DynamicResource MenuScrollViewerUpButtonGlyph}"
Foreground="{DynamicResource MenuFlyoutScrollViewerIconForeground}" /> Foreground="{DynamicResource MenuFlyoutScrollViewerIconForeground}" />
</RepeatButton> </RepeatButton>
@@ -49,20 +50,21 @@
Command="{Binding LineDown, RelativeSource={RelativeSource TemplatedParent}}" Command="{Binding LineDown, RelativeSource={RelativeSource TemplatedParent}}"
CornerRadius="0" CornerRadius="0"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
MinHeight="0"
RenderTransform="{x:Null}"> RenderTransform="{x:Null}">
<RepeatButton.IsVisible> <RepeatButton.IsVisible>
<MultiBinding <MultiBinding
Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}"
ConverterParameter="100"> ConverterParameter="100">
<Binding Path="VerticalScrollBarVisibility" <Binding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" /> <Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" /> <Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" /> <Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding> </MultiBinding>
</RepeatButton.IsVisible> </RepeatButton.IsVisible>
<PathIcon <PathIcon
Theme="{DynamicResource InnerPathIcon}" Width="8"
Height="8"
Data="{DynamicResource MenuScrollViewerDownButtonGlyph}" Data="{DynamicResource MenuScrollViewerDownButtonGlyph}"
Foreground="{DynamicResource MenuFlyoutScrollViewerIconForeground}" /> Foreground="{DynamicResource MenuFlyoutScrollViewerIconForeground}" />
</RepeatButton> </RepeatButton>
@@ -287,7 +289,7 @@
<Setter Property="Content"> <Setter Property="Content">
<Template> <Template>
<Ellipse Fill="{Binding $parent[MenuItem].Foreground}" <Ellipse Fill="{Binding $parent[MenuItem].Foreground}"
Margin="4" Width="8" Height="8" /> Margin="4" Width="6" Height="6" />
</Template> </Template>
</Setter> </Setter>
</Style> </Style>
@@ -297,7 +299,7 @@
<Setter Property="Background" Value="{DynamicResource MenuItemBackground}" /> <Setter Property="Background" Value="{DynamicResource MenuItemBackground}" />
<Setter Property="Foreground" Value="{DynamicResource MenuItemForeground}" /> <Setter Property="Foreground" Value="{DynamicResource MenuItemForeground}" />
<Setter Property="Cursor" Value="Hand" /> <Setter Property="Cursor" Value="Hand" />
<Setter Property="CornerRadius" Value="{DynamicResource MenuItemCornerRadius}"/> <Setter Property="CornerRadius" Value="{DynamicResource MenuItemCornerRadius}" />
<!-- Narrow padding should be used for mouse input, when non-narrow one should be used for touch input in future. --> <!-- Narrow padding should be used for mouse input, when non-narrow one should be used for touch input in future. -->
<Setter Property="Padding" Value="{DynamicResource MenuItemPadding}" /> <Setter Property="Padding" Value="{DynamicResource MenuItemPadding}" />
<Setter Property="Template"> <Setter Property="Template">
@@ -396,4 +398,4 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -377,9 +377,10 @@
<Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" /> <Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="Background" Value="Transparent" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" /> <Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" /> <Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="Cursor" Value="Hand" /> <Setter Property="Cursor" Value="Hand" />
@@ -404,15 +405,18 @@
<ContentPresenter <ContentPresenter
Name="PART_OnContentPresenter" Name="PART_OnContentPresenter"
IsVisible="{TemplateBinding IsChecked}" IsVisible="{TemplateBinding IsChecked}"
Foreground="{TemplateBinding Foreground}"
Content="{TemplateBinding OnContent}" Content="{TemplateBinding OnContent}"
ContentTemplate="{TemplateBinding OnContentTemplate}" /> ContentTemplate="{TemplateBinding OnContentTemplate}" />
<ContentPresenter <ContentPresenter
Name="PART_OffContentPresenter" Name="PART_OffContentPresenter"
IsVisible="{TemplateBinding IsChecked, Converter={x:Static BoolConverters.Not}}" IsVisible="{TemplateBinding IsChecked, Converter={x:Static BoolConverters.Not}}"
Foreground="{TemplateBinding Foreground}"
Content="{TemplateBinding OffContent}" Content="{TemplateBinding OffContent}"
ContentTemplate="{TemplateBinding OffContentTemplate}" /> ContentTemplate="{TemplateBinding OffContentTemplate}" />
<ContentPresenter <ContentPresenter
Name="PART_ContentPresenter" Name="PART_ContentPresenter"
Foreground="{TemplateBinding Foreground}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"> ContentTemplate="{TemplateBinding ContentTemplate}">
<ContentPresenter.IsVisible> <ContentPresenter.IsVisible>
@@ -432,24 +436,20 @@
<Setter Property="RenderTransform" Value="scale(0.98)" /> <Setter Property="RenderTransform" Value="scale(0.98)" />
</Style> </Style>
<Style Selector="^ /template/ Border#Background"> <Style Selector="^:pointerover">
<Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" />
<Setter Property="Background" Value="{TemplateBinding Background}" />
</Style>
<Style Selector="^:pointerover /template/ Border#Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#Background"> <Style Selector="^:pressed">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style> </Style>
<Style Selector="^:disabled /template/ Border#Background"> <Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
<!-- <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" /> --> <Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
<Style Selector="^.Large"> <Style Selector="^.Large">
@@ -460,15 +460,5 @@
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" /> <Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
</Style> </Style>
<Style Selector="^ /template/ Border#Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
</Style>
<Style Selector="^:disabled /template/ Border#Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<!-- <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" /> -->
</Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -0,0 +1,59 @@
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Avalonia;
using Avalonia.Media;
using Avalonia.Platform;
using Avalonia.Styling;
namespace Semi.Avalonia;
public static class ApplicationExtension
{
private static Application _app = null!;
private static readonly Dictionary<Color, ThemeVariant> ColorThemeMap = new()
{
[Color.Parse("#8EE3F0")] = SemiTheme.Aquatic,
[Color.Parse("#903909")] = SemiTheme.Desert,
[Color.Parse("#A1BFDE")] = SemiTheme.Dusk,
[Color.Parse("#D6B4FD")] = SemiTheme.NightSky
};
public static void RegisterFollowSystemTheme(this Application app)
{
_app = app;
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return;
if (app.PlatformSettings is null) return;
app.PlatformSettings.ColorValuesChanged -= OnColorValuesChanged;
app.PlatformSettings.ColorValuesChanged += OnColorValuesChanged;
OnColorValuesChanged(null, app.PlatformSettings?.GetColorValues());
}
public static void UnregisterFollowSystemTheme(this Application app)
{
_app = app;
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return;
if (app.PlatformSettings is null) return;
app.PlatformSettings.ColorValuesChanged -= OnColorValuesChanged;
}
private static void OnColorValuesChanged(object? _, PlatformColorValues? args)
{
ThemeVariant result;
if (args?.ContrastPreference is ColorContrastPreference.High)
{
result = ColorThemeMap.TryGetValue(args.AccentColor1, out var theme) ? theme : ThemeVariant.Default;
}
else
{
result = args?.ThemeVariant switch
{
PlatformThemeVariant.Light => ThemeVariant.Light,
PlatformThemeVariant.Dark => ThemeVariant.Dark,
_ => ThemeVariant.Default
};
}
_app.RequestedThemeVariant = result;
}
}

View File

@@ -1,4 +1,5 @@
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" <Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:semi="https://irihi.tech/semi"> xmlns:semi="https://irihi.tech/semi">
<Styles.Resources> <Styles.Resources>
<ResourceDictionary> <ResourceDictionary>
@@ -12,8 +13,8 @@
</ResourceDictionary.ThemeDictionaries> </ResourceDictionary.ThemeDictionaries>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://Semi.Avalonia/Controls/_index.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/_index.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Base.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/_index.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/_index.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Tokens/Variables.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Locale/zh-cn.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Locale/zh-cn.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Icons/_index.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Icons/_index.axaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>

View File

@@ -0,0 +1,26 @@
<ResourceDictionary x:Class="Semi.Avalonia.Locale.de_de"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- DatePicker -->
<x:String x:Key="STRING_DATEPICKER_DAY_TEXT">Tag</x:String>
<x:String x:Key="STRING_DATEPICKER_MONTH_TEXT">Monat</x:String>
<x:String x:Key="STRING_DATEPICKER_YEAR_TEXT">Jahr</x:String>
<!-- TimePicker -->
<x:String x:Key="STRING_TIMEPICKER_HOUR_TEXT">Stunde</x:String>
<x:String x:Key="STRING_TIMEPICKER_MINUTE_TEXT">Minute</x:String>
<x:String x:Key="STRING_TIMEPICKER_SECOND_TEXT">Sekunde</x:String>
<!-- TextBox/SelectableTextBox flyout -->
<x:String x:Key="STRING_MENU_CUT">Ausschneiden</x:String>
<x:String x:Key="STRING_MENU_COPY">Kopieren</x:String>
<x:String x:Key="STRING_MENU_PASTE">Einfügen</x:String>
<!-- ManagedFileChooser -->
<x:String x:Key="STRING_CHOOSER_FILE_NAME">Dateiname</x:String>
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Ausgeblendete Elemente anzeigen</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_OK">OK</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">Abbrechen</x:String>
<x:String x:Key="STRING_CHOOSER_NAME_COLUMN">Name</x:String>
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">Änderungsdatum</x:String>
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">Typ</x:String>
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">Größe</x:String>
<x:String x:Key="STRING_CHOOSER_PROMPT_FILE_ALREADY_EXISTS">Die Datei {0} existiert bereits. Möchten Sie sie ersetzen?</x:String>
</ResourceDictionary>

View File

@@ -0,0 +1,8 @@
using Avalonia.Controls;
namespace Semi.Avalonia.Locale;
public class de_de : ResourceDictionary
{
}

View File

@@ -16,7 +16,7 @@
<x:String x:Key="STRING_MENU_PASTE">Paste</x:String> <x:String x:Key="STRING_MENU_PASTE">Paste</x:String>
<!-- ManagedFileChooser --> <!-- ManagedFileChooser -->
<x:String x:Key="STRING_CHOOSER_FILE_NAME">File name</x:String> <x:String x:Key="STRING_CHOOSER_FILE_NAME">File name</x:String>
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Show hidden flies</x:String> <x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Show hidden files</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_OK">OK</x:String> <x:String x:Key="STRING_CHOOSER_DIALOG_OK">OK</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">Cancel</x:String> <x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">Cancel</x:String>
<x:String x:Key="STRING_CHOOSER_NAME_COLUMN">Name</x:String> <x:String x:Key="STRING_CHOOSER_NAME_COLUMN">Name</x:String>

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.4</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

View File

@@ -1,4 +1,6 @@
<Styles x:Class="Semi.Avalonia.SemiTheme" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" <Styles x:Class="Semi.Avalonia.SemiTheme"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:semi="https://irihi.tech/semi"> xmlns:semi="https://irihi.tech/semi">
<Styles.Resources> <Styles.Resources>
<ResourceDictionary> <ResourceDictionary>
@@ -12,8 +14,8 @@
</ResourceDictionary.ThemeDictionaries> </ResourceDictionary.ThemeDictionaries>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://Semi.Avalonia/Controls/_index.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/_index.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Base.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/_index.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/_index.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Tokens/Variables.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Locale/zh-cn.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Locale/zh-cn.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Icons/_index.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Icons/_index.axaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Avalonia.Styling; using Avalonia.Styling;
@@ -10,11 +11,6 @@ namespace Semi.Avalonia;
public class SemiTheme : Styles public class SemiTheme : Styles
{ {
public static ThemeVariant Aquatic => new ThemeVariant(nameof(Aquatic), ThemeVariant.Dark);
public static ThemeVariant Desert => new ThemeVariant(nameof(Desert), ThemeVariant.Light);
public static ThemeVariant Dusk => new ThemeVariant(nameof(Dusk), ThemeVariant.Dark);
public static ThemeVariant NightSky => new ThemeVariant(nameof(NightSky), ThemeVariant.Dark);
private static readonly Dictionary<CultureInfo, ResourceDictionary> _localeToResource = new() private static readonly Dictionary<CultureInfo, ResourceDictionary> _localeToResource = new()
{ {
{ new CultureInfo("zh-cn"), new zh_cn() }, { new CultureInfo("zh-cn"), new zh_cn() },
@@ -23,41 +19,89 @@ public class SemiTheme : Styles
{ new CultureInfo("uk-ua"), new uk_ua() }, { new CultureInfo("uk-ua"), new uk_ua() },
{ new CultureInfo("ru-ru"), new ru_ru() }, { new CultureInfo("ru-ru"), new ru_ru() },
{ new CultureInfo("zh-tw"), new zh_tw() }, { new CultureInfo("zh-tw"), new zh_tw() },
{ new CultureInfo("de-de"), new de_de() },
}; };
private readonly IServiceProvider? sp; private static readonly ResourceDictionary _defaultResource = new zh_cn();
private CultureInfo? _locale;
public SemiTheme(IServiceProvider? provider = null) public SemiTheme(IServiceProvider? provider = null)
{ {
sp = provider;
AvaloniaXamlLoader.Load(provider, this); AvaloniaXamlLoader.Load(provider, this);
} }
private CultureInfo? _locale; public static ThemeVariant Aquatic => new(nameof(Aquatic), ThemeVariant.Dark);
public static ThemeVariant Desert => new(nameof(Desert), ThemeVariant.Light);
public static ThemeVariant Dusk => new(nameof(Dusk), ThemeVariant.Dark);
public static ThemeVariant NightSky => new(nameof(NightSky), ThemeVariant.Dark);
public CultureInfo? Locale public CultureInfo? Locale
{ {
get => _locale; get => _locale;
set set
{ {
_locale = value; try
var resource = TryGetLocaleResource(value);
if (resource is null) return;
foreach (var kv in resource)
{ {
this.Resources.Add(kv); if (TryGetLocaleResource(value, out var resource) && resource is not null)
{
_locale = value;
foreach (var kv in resource) Resources[kv.Key] = kv.Value;
}
else
{
_locale = new CultureInfo("zh-CN");
foreach (var kv in _defaultResource) Resources[kv.Key] = kv.Value;
}
}
catch
{
_locale = CultureInfo.InvariantCulture;
} }
} }
} }
private static ResourceDictionary? TryGetLocaleResource(CultureInfo? locale) private static bool TryGetLocaleResource(CultureInfo? locale, out ResourceDictionary? resourceDictionary)
{ {
if (Equals(locale, CultureInfo.InvariantCulture))
{
resourceDictionary = _defaultResource;
return true;
}
if (locale is null) if (locale is null)
{ {
return _localeToResource[new CultureInfo("zh-cn")]; resourceDictionary = _defaultResource;
return false;
} }
if (_localeToResource.TryGetValue(locale, out var resource)) if (_localeToResource.TryGetValue(locale, out var resource))
{ {
return resource; resourceDictionary = resource;
return true;
}
resourceDictionary = _defaultResource;
return false;
}
public static void OverrideLocaleResources(Application application, CultureInfo? culture)
{
if (culture is null) return;
if (!_localeToResource.TryGetValue(culture, out var resources)) return;
foreach (var kv in resources)
{
application.Resources[kv.Key] = kv.Value;
}
}
public static void OverrideLocaleResources(StyledElement element, CultureInfo? culture)
{
if (culture is null) return;
if (!_localeToResource.TryGetValue(culture, out var resources)) return;
foreach (var kv in resources)
{
element.Resources[kv.Key] = kv.Value;
} }
return _localeToResource[new CultureInfo("zh-cn")];
} }
} }

View File

@@ -1,13 +0,0 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<SolidColorBrush x:Key="DefaultForeground" Color="#1C1F23" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="DefaultForeground" Color="#F9F9F9" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<x:Double x:Key="DefaultFontSize">14</x:Double>
<FontFamily x:Key="DefaultFontFamily">Inter, -apple-system,BlinkMacSystemFont,PingFang SC, Microsoft YaHei, Segoe UI, Hiragino Sans GB, Helvetica Neue,Helvetica,Arial,sans-serif</FontFamily>
<FontFamily x:Key="CodeFontFamily">Cascadia Code, Consolas, Inconsolata, monospace</FontFamily>
</ResourceDictionary>

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StaticResource x:Key="CaptionButtonPointeroverBackground" ResourceKey="SemiColorFill1" /> <StaticResource x:Key="CaptionButtonPointeroverBackground" ResourceKey="SemiColorFill1" />
<StaticResource x:Key="CaptionButtonPressedBackground" ResourceKey="SemiColorFill2" /> <StaticResource x:Key="CaptionButtonPressedBackground" ResourceKey="SemiColorFill2" />
<StaticResource x:Key="CaptionButtonCloseForeground" ResourceKey="SemiColorWhite" />
<StaticResource x:Key="CaptionButtonClosePointeroverBackground" ResourceKey="SemiColorDangerPointerover" /> <StaticResource x:Key="CaptionButtonClosePointeroverBackground" ResourceKey="SemiColorDangerPointerover" />
<StaticResource x:Key="CaptionButtonClosePressedBackground" ResourceKey="SemiColorDangerActive" /> <StaticResource x:Key="CaptionButtonClosePressedBackground" ResourceKey="SemiColorDangerActive" />
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorText2" /> <StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorText2" />

View File

@@ -1,4 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StaticResource x:Key="WindowDefaultBackground" ResourceKey="SemiColorBackground0" /> <StaticResource x:Key="WindowDefaultBackground" ResourceKey="SemiColorBackground0" />
<StaticResource x:Key="WindowDefaultForeground" ResourceKey="SemiColorText0" /> <StaticResource x:Key="WindowDefaultForeground" ResourceKey="SemiColorText0" />
<StaticResource x:Key="DefaultForeground" ResourceKey="SemiColorText0" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="AdornerLayerBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="AdornerLayerBorderBrush" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="AdornerSolidLayerBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="AdornerSolidLayerBorderBrush" ResourceKey="SemiColorWindowText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="AutoCompleteBoxPopupBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="AutoCompleteBoxPopupBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="AutoCompleteBoxPopupBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="AutoCompleteBoxPopupBorderBrush" ResourceKey="SemiColorButtonText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="BorderCardBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="BorderCardBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="BorderCardBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="BorderCardBorderBrush" ResourceKey="SemiColorWindowText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,48 +1,39 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Light --> <!-- Light -->
<SolidColorBrush x:Key="ButtonDefaultPrimaryForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ButtonDefaultPrimaryForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ButtonDefaultDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ButtonDefaultDisabledForeground" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="ButtonDefaultBackground" ResourceKey="SemiColorButtonFace" />
<SolidColorBrush x:Key="ButtonDefaultBackground" Color="{StaticResource ButtonFaceColor}" /> <StaticResource x:Key="ButtonDefaultPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ButtonDefaultPointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ButtonDefaultPressedBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ButtonDefaultPressedBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ButtonDefaultBorderBrush" ResourceKey="SemiColorButtonText" />
<StaticResource x:Key="ButtonDefaultPointeroverBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ButtonDefaultBorderBrush" Color="{StaticResource ButtonTextColor}" />
<SolidColorBrush x:Key="ButtonDefaultPointeroverBorderBrush" Color="{StaticResource HighlightColor}" />
<SolidColorBrush x:Key="ButtonDefaultPressedBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="ButtonDefaultPressedBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="ButtonDefaultDisabledBorderBrush" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ButtonDefaultDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<!-- end Light --> <!-- end Light -->
<!-- Solid --> <!-- Solid -->
<SolidColorBrush x:Key="ButtonSolidForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ButtonSolidForeground" ResourceKey="SemiColorHighlightText" />
<StaticResource x:Key="ButtonSolidPrimaryBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ButtonSolidPrimaryBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ButtonSolidPrimaryPointeroverBackground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ButtonSolidPrimaryPointeroverBackground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ButtonSolidPrimaryPressedForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ButtonSolidPrimaryPressedForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ButtonSolidPrimaryPressedBackground" ResourceKey="SemiColorButtonFace" />
<SolidColorBrush x:Key="ButtonSolidPrimaryPressedBackground" Color="{StaticResource ButtonFaceColor}" /> <StaticResource x:Key="ButtonSolidPrimaryBorderBrush" ResourceKey="SemiColorHighlight" />
<StaticResource x:Key="ButtonSolidPrimaryPointeroverBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ButtonSolidPrimaryBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ButtonSolidPrimaryPressedBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ButtonSolidPrimaryPointeroverBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ButtonSolidDisabledBackground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="ButtonSolidPrimaryPressedBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ButtonSolidDisabledForeground" ResourceKey="SemiColorButtonFace" />
<SolidColorBrush x:Key="ButtonSolidDisabledBackground" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="ButtonSolidDisabledForeground" Color="{StaticResource ButtonFaceColor}" />
<SolidColorBrush x:Key="ButtonSolidDisabledBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="ButtonSolidDisabledBorderBrush" Color="Transparent" />
<!-- end Solid --> <!-- end Solid -->
<!-- Borderless --> <!-- Borderless -->
<SolidColorBrush x:Key="ButtonBorderlessBackground" Color="Transparent" /> <SolidColorBrush x:Key="ButtonBorderlessBackground" Color="Transparent" />
<SolidColorBrush x:Key="ButtonBorderlessBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="ButtonBorderlessBorderBrush" Color="Transparent" />
<!-- end Borderless --> <!-- end Borderless -->
<!-- Outline --> <!-- Outline -->
<SolidColorBrush x:Key="ButtonOutlineBackground" Color="Transparent" /> <SolidColorBrush x:Key="ButtonOutlineBackground" Color="Transparent" />
<SolidColorBrush x:Key="ButtonOutlineBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="ButtonOutlineBorderBrush" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="ButtonOutlinePointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ButtonOutlinePointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ButtonOutlinePressedBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ButtonOutlinePressedBackground" ResourceKey="SemiColorWindow" />
<!-- end Outline --> <!-- end Outline -->
<StaticResource x:Key="ButtonInputInnerForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ButtonInputInnerForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ButtonInputInnerPointeroverForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ButtonInputInnerPointeroverForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ButtonInputInnerPressedForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ButtonInputInnerPressedForeground" Color="{StaticResource HighlightColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,9 +1,9 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonBackground" Color="{StaticResource ButtonFaceColor}" /> <StaticResource x:Key="ButtonSpinnerRepeatButtonBackground" ResourceKey="SemiColorButtonFace" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonPointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ButtonSpinnerRepeatButtonPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonPointeroverBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ButtonSpinnerRepeatButtonPointeroverBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonPressedBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ButtonSpinnerRepeatButtonPressedBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonDisabledBackground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ButtonSpinnerRepeatButtonDisabledBackground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ButtonSpinnerRepeatButtonForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ButtonSpinnerRepeatButtonBorderBrush" ResourceKey="SemiColorButtonText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,35 +1,29 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="CalendarBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="CalendarBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="CalendarForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="CalendarForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="CalendarBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="CalendarBorderBrush" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="CalendarItemWeekDayNameForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="CalendarItemWeekDayNameForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="CalendarItemIconForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="CalendarItemIconForeground" ResourceKey="SemiColorWindowText" />
<StaticResource x:Key="CalendarItemCalendarButtonBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="CalendarItemCalendarButtonForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonForeground" Color="{StaticResource WindowTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="CalendarItemCalendarButtonBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonPointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CalendarItemCalendarButtonPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonPressedBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CalendarItemCalendarButtonPressedBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonSelectedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CalendarItemCalendarButtonSelectedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonSelectedForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CalendarItemCalendarButtonSelectedForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="CalendarItemCalendarButtonDisabledForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonBlackoutForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="CalendarItemCalendarButtonBlackoutForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonInactiveForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="CalendarItemCalendarButtonInactiveForeground" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="CalendarItemCalendarDayButtonForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="CalendarItemCalendarDayButtonBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonBackground" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="CalendarItemCalendarDayButtonBorderBrush" Color="Transparent" />
<StaticResource x:Key="CalendarItemCalendarDayButtonPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonPointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CalendarItemCalendarDayButtonPressedBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonPressedBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CalendarItemCalendarDayButtonSelectedBackground" ResourceKey="SemiColorHighlight" />
<StaticResource x:Key="CalendarItemCalendarDayButtonSelectedForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonSelectedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CalendarItemCalendarDayButtonTodayForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonSelectedForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CalendarItemCalendarDayButtonTodayBackground" ResourceKey="SemiColorHighlightText" />
<StaticResource x:Key="CalendarItemCalendarDayButtonDisabledForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonTodayForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CalendarItemCalendarDayButtonBlackoutForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonTodayBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CalendarItemCalendarDayButtonInactiveForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonDisabledForeground" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonBlackoutForeground" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonInactiveForeground" Color="{StaticResource GrayTextColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,12 +1,12 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="CalendarDatePickerIconForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="CalendarDatePickerIconForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="CalendarDatePickerForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="CalendarDatePickerForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="CalendarDatePickerIconPointeroverForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CalendarDatePickerIconPointeroverForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CalendarDatePickerBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="CalendarDatePickerBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="CalendarDatePickerPointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CalendarDatePickerPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="CalendarDatePickerPointeroverBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CalendarDatePickerPointeroverBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CalendarDatePickerFocusBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CalendarDatePickerFocusBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CalendarDatePickerDisabledBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="CalendarDatePickerDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="CalendarDatePickerDisabledIconForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="CalendarDatePickerDisabledIconForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="CalendarDatePickerBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="CalendarDatePickerBorderBrush" ResourceKey="SemiColorButtonText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,7 +1,8 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="CaptionButtonPointeroverBackground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="CaptionButtonPointeroverBackground" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="CaptionButtonPressedBackground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="CaptionButtonPressedBackground" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="CaptionButtonClosePointeroverBackground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="CaptionButtonCloseForeground" ResourceKey="SemiColorWhite" />
<SolidColorBrush x:Key="CaptionButtonClosePressedBackground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="CaptionButtonClosePointeroverBackground" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="CaptionButtonForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="CaptionButtonClosePressedBackground" ResourceKey="SemiColorHotlight" />
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorWindowText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,34 +1,29 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="CheckBoxForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="CheckBoxForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="CheckBoxDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="CheckBoxDisabledForeground" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="CheckBoxGlyphFill" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="CheckBoxGlyphFill" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CheckBoxGlyphDisabledFill" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="CheckBoxGlyphDisabledFill" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CheckBoxDefaultBackground" ResourceKey="SemiColorWindow" />
<StaticResource x:Key="CheckBoxDefaultBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="CheckBoxDefaultBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="CheckBoxPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="CheckBoxDefaultBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="CheckBoxPointeroverBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CheckBoxPointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CheckBoxPressedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CheckBoxPointeroverBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CheckBoxPressedBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CheckBoxPressedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CheckBoxCheckedDefaultBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CheckBoxPressedBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CheckBoxCheckedDefaultBorderBrush" ResourceKey="SemiColorHighlight" />
<StaticResource x:Key="CheckBoxCheckedPointeroverBackground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="CheckBoxCheckedDefaultBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CheckBoxCheckedPointeroverBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="CheckBoxCheckedDefaultBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CheckBoxCheckedPressedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CheckBoxCheckedPointeroverBackground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="CheckBoxCheckedPressedBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CheckBoxCheckedPointeroverBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="CheckBoxDefaultDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="CheckBoxCheckedPressedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CheckBoxDefaultDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="CheckBoxCheckedPressedBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CheckBoxCheckedDisabledBackground" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="CheckBoxCheckedDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="CheckBoxDefaultDisabledBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="CheckBoxCardCheckedBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="CheckBoxDefaultDisabledBorderBrush" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="CheckBoxCardCheckedBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CheckBoxCheckedDisabledBackground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="CheckBoxCardCheckedDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="CheckBoxCheckedDisabledBorderBrush" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="CheckBoxCardPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<StaticResource x:Key="CheckBoxCardPressedBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="CheckBoxCardCheckedBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="CheckBoxCardCheckedPointeroverBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="CheckBoxCardCheckedBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="CheckBoxCardCheckedPressedBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="CheckBoxCardCheckedDisabledBorderBrush" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="CheckBoxCardPointeroverBackground" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="CheckBoxCardPressedBackground" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="CheckBoxCardCheckedPointeroverBorderBrush" Color="{StaticResource ButtonTextColor}" />
<SolidColorBrush x:Key="CheckBoxCardCheckedPressedBorderBrush" Color="{StaticResource HighlightColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,39 +1,33 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ComboBoxSelectorBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ComboBoxSelectorBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ComboBoxSelectorPointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ComboBoxSelectorPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ComboBoxSelectorFocusBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ComboBoxSelectorFocusBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ComboBoxSelectorPressedBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ComboBoxSelectorPressedBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ComboBoxSelectorDisabledBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ComboBoxSelectorDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ComboBoxSelectorDisabledBorderBrush" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ComboBoxSelectorDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="ComboBoxSelectorBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ComboBoxSelectorBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ComboBoxSelectorPointeroverBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ComboBoxSelectorPointeroverBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ComboBoxSelectorFocusBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ComboBoxSelectorFocusBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ComboBoxSelectorPressedBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ComboBoxSelectorPressedBorderBrush" ResourceKey="SemiColorHighlight" />
<StaticResource x:Key="ComboBoxIconDefaultForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ComboBoxIconDefaultForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ComboBoxIconPointeroverForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ComboBoxIconPointeroverForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ComboBoxIconFocusForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ComboBoxIconFocusForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ComboBoxIconPressedForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ComboBoxIconPressedForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ComboBoxIconDisabledForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="ComboBoxIconDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ComboBoxDisabledForeground" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="ComboBoxPopupBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ComboBoxDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ComboBoxPopupBorderBrush" ResourceKey="SemiColorButtonText" />
<StaticResource x:Key="ComboBoxItemForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="ComboBoxPopupBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ComboBoxItemBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ComboBoxPopupBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ComboBoxItemPointeroverForeground" ResourceKey="SemiColorHighlightText" />
<StaticResource x:Key="ComboBoxItemPointeroverBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ComboBoxItemForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="ComboBoxItemFocusForeground" ResourceKey="SemiColorHighlightText" />
<StaticResource x:Key="ComboBoxItemFocusBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ComboBoxItemBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ComboBoxItemPressedForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ComboBoxItemPointeroverForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ComboBoxItemPressedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ComboBoxItemPointeroverBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ComboBoxItemSelectedForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ComboBoxItemFocusForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ComboBoxItemSelectedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ComboBoxItemFocusBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ComboBoxItemSelectedPointeroverBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ComboBoxItemPressedForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ComboBoxItemDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ComboBoxItemPressedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ComboBoxItemSelectedDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ComboBoxItemSelectedForeground" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="ComboBoxItemSelectedBackground" Color="{StaticResource HighlightColor}" />
<SolidColorBrush x:Key="ComboBoxItemSelectedPointeroverBackground" Color="{StaticResource HighlightColor}" />
<SolidColorBrush x:Key="ComboBoxItemDisabledBackground" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="ComboBoxItemSelectedDisabledBackground" Color="{StaticResource WindowColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,28 +1,22 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="DateTimePickerListItemBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="DateTimePickerListItemBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="DateTimePickerPopupBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="DateTimePickerPopupBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="DateTimePickerPopupBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="DateTimePickerPopupBorderBrush" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="DateTimePickerFlyoutButtonForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="DateTimePickerFlyoutButtonPointeroverForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="DateTimePickerFlyoutButtonPressedForeground" ResourceKey="SemiColorHighlight" />
<StaticResource x:Key="DateTimePickerFlyoutButtonBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="DateTimePickerFlyoutButtonPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="DateTimePickerFlyoutButtonPressedBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="DateTimePickerSeparatorBackground" ResourceKey="SemiColorWindowText" />
<StaticResource x:Key="DateTimePickerButtonBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="DateTimePickerSeparatorBackground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="DateTimePickerButtonBackground" ResourceKey="SemiColorWindow" />
<StaticResource x:Key="DateTimePickerButtonForeground" ResourceKey="SemiColorWindowText" />
<StaticResource x:Key="DateTimePickerIconForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="DateTimePickerButtonBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="DateTimePickerEmptyForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="DateTimePickerButtonBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="DateTimePickerButtonPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="DateTimePickerButtonForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="DateTimePickerButtonPointeroverBorderBrush" ResourceKey="SemiColorHighlight" />
<StaticResource x:Key="DateTimePickerButtonDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="DateTimePickerIconForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="DateTimePickerButtonDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="DateTimePickerEmptyForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="DateTimePickerButtonDisabledIconForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="DateTimePickerButtonPointeroverBackground" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="DateTimePickerButtonPointeroverBorderBrush" Color="{StaticResource HighlightColor}" />
<SolidColorBrush x:Key="DateTimePickerButtonDisabledBorderBrush" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="DateTimePickerButtonDisabledBackground" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="DateTimePickerButtonDisabledIconForeground" Color="{StaticResource GrayTextColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,9 +1,9 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ExpanderSeparatorBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ExpanderSeparatorBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ExpanderHeaderForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ExpanderHeaderForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ExpanderHeaderDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ExpanderHeaderDisabledForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="ExpanderHeaderDefaultBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ExpanderHeaderDefaultBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ExpanderHeaderHoverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ExpanderHeaderHoverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ExpanderHeaderPressedBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ExpanderHeaderPressedBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ExpanderContentForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="ExpanderContentForeground" ResourceKey="SemiColorWindowText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,5 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="FlyoutBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="FlyoutBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="FlyoutForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="FlyoutForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="FlyoutBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="FlyoutBorderBrush" ResourceKey="SemiColorWindowText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="GridSplitterBackground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="GridSplitterBackground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="GridSplitterPreviewBackground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="GridSplitterPreviewBackground" ResourceKey="SemiColorHotlight" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="HeaderedContentControlBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="HeaderedContentControlBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="HeaderedContentControlBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="HeaderedContentControlBorderBrush" ResourceKey="SemiColorWindowText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="HyperlinkButtonForeground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="HyperlinkButtonForeground" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="HyperlinkButtonPointeroverForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="HyperlinkButtonPointeroverForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="HyperlinkButtonPressedForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="HyperlinkButtonPressedForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="HyperlinkButtonDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="HyperlinkButtonDisabledForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="HyperlinkButtonVisitedForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="HyperlinkButtonVisitedForeground" ResourceKey="SemiColorHighlight" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,15 +1,14 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- ListBox --> <!-- ListBox -->
<SolidColorBrush x:Key="ListBoxItemDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ListBoxItemDisabledForeground" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="ListBoxItemDefaultBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ListBoxItemDefaultBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ListBoxItemPointeroverForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ListBoxItemPointeroverForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ListBoxItemPointeroverBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ListBoxItemPointeroverBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ListBoxItemPressedForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ListBoxItemPressedForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ListBoxItemPressedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ListBoxItemPressedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ListBoxItemSelectedForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ListBoxItemSelectedForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ListBoxItemSelectedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ListBoxItemSelectedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ListBoxItemSelectedPointeroverBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ListBoxItemSelectedPointeroverBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ListBoxItemDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ListBoxItemDisabledBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ListBoxItemSelectedDisabledBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ListBoxItemSelectedDisabledBackground" Color="{StaticResource HighlightTextColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ManagedFileChooserIconForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="ManagedFileChooserIconForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="ManagedFileChooserTextForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="ManagedFileChooserTextForeground" ResourceKey="SemiColorWindowText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,24 +1,19 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="MenuFlyoutScrollViewerIconForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="MenuFlyoutScrollViewerIconForeground" ResourceKey="SemiColorWindowText" />
<!-- MenuFlyout --> <!-- MenuFlyout -->
<SolidColorBrush x:Key="MenuFlyoutBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="MenuFlyoutBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="MenuFlyoutBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="MenuFlyoutBorderBrush" ResourceKey="SemiColorWindowText" />
<!-- MenuItem --> <!-- MenuItem -->
<SolidColorBrush x:Key="MenuItemBackground" Color="Transparent" /> <SolidColorBrush x:Key="MenuItemBackground" Color="Transparent" />
<SolidColorBrush x:Key="MenuItemForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="MenuItemForeground" ResourceKey="SemiColorWindowText" />
<StaticResource x:Key="MenuItemSeparatorBackground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="MenuItemSeparatorBackground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="MenuItemPointeroverForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="MenuItemPointeroverForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="MenuItemPointeroverBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="MenuItemPointeroverBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="MenuItemPressedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="MenuItemPressedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="MenuItemInputGestureTextForeground" ResourceKey="SemiColorWindowText" />
<StaticResource x:Key="MenuItemExpandIconForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="MenuItemInputGestureTextForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="MenuItemExpandIconOpenForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="MenuItemExpandIconForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="MenuItemDisabledForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="MenuItemExpandIconOpenForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="MenuItemDisabledInputGestureTextForeground" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="MenuItemDisabledExpandIconForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="MenuItemDisabledForeground" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="MenuItemDisabledInputGestureTextForeground" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="MenuItemDisabledExpandIconForeground" Color="{StaticResource GrayTextColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,8 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="NotificationCardBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="NotificationCardBorderBrush" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="NotificationCardBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="NotificationCardBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="NotificationCardTitleForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="NotificationCardTitleForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="NotificationCardMessageForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="NotificationCardMessageForeground" ResourceKey="SemiColorWindowText" />
<StaticResource x:Key="NotificationCardLightBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="NotificationCardLightBackground" Color="{StaticResource WindowColor}" /> </ResourceDictionary>
</ResourceDictionary>

View File

@@ -1,8 +1,8 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ProgressBarIndicatorBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ProgressBarBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ProgressBarTextForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="ProgressBarOuterTextForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="ProgressBarOuterTextForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="ProgressBarRootBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="ProgressBarRootBorderBrush" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="ProgressBarPrimaryForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorHighlight" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,49 +1,41 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- RadioButton --> <!-- RadioButton -->
<SolidColorBrush x:Key="RadioButtonDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="RadioButtonDisabledForeground" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="RadioButtonUncheckIconDefaultBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="RadioButtonUncheckIconDefaultBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="RadioButtonUncheckIconPointeroverBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="RadioButtonUncheckIconPointeroverBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="RadioButtonUncheckIconPressedBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="RadioButtonUncheckIconPressedBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="RadioButtonUncheckIconDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="RadioButtonUncheckIconDisabledBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="RadioButtonUncheckIconDefaultBorderBrush" ResourceKey="SemiColorButtonText" />
<StaticResource x:Key="RadioButtonUncheckIconPointeroverBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="RadioButtonUncheckIconDefaultBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="RadioButtonUncheckIconPressedBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="RadioButtonUncheckIconPointeroverBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="RadioButtonUncheckIconDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="RadioButtonUncheckIconPressedBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="RadioButtonCheckIconDefaultBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="RadioButtonUncheckIconDisabledBorderBrush" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="RadioButtonCheckIconPointeroverBackground" ResourceKey="SemiColorButtonText" />
<StaticResource x:Key="RadioButtonCheckIconPressedBackground" ResourceKey="SemiColorHighlight" />
<StaticResource x:Key="RadioButtonCheckIconDisabledBackground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="RadioButtonCheckIconDefaultBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="RadioButtonCheckIconDefaultBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="RadioButtonCheckIconPointeroverBackground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="RadioButtonCheckIconPointeroverBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="RadioButtonCheckIconPressedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="RadioButtonCheckIconPressedBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="RadioButtonCheckIconDisabledBackground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="RadioButtonCheckIconDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="RadioButtonCheckIconDefaultBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="RadioButtonCheckGlyphFill" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="RadioButtonCheckIconPointeroverBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="RadioButtonForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="RadioButtonCheckIconPressedBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="RadioButtonDefaultBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="RadioButtonCheckIconDisabledBorderBrush" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="RadioButtonDefaultBorderBrush" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="RadioButtonCheckGlyphFill" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="RadioButtonForeground" Color="{StaticResource WindowTextColor}" />
<SolidColorBrush x:Key="RadioButtonDefaultBackground" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="RadioButtonDefaultBorderBrush" Color="{StaticResource WindowTextColor}" />
<SolidColorBrush x:Key="RadioButtonGroupBackground" Opacity="0.12" Color="White" /> <SolidColorBrush x:Key="RadioButtonGroupBackground" Opacity="0.12" Color="White" />
<!-- ButtonRadioButton --> <!-- ButtonRadioButton -->
<SolidColorBrush x:Key="RadioButtonButtonUncheckedForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="RadioButtonButtonUncheckedForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="RadioButtonButtonUncheckedPointeroverBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="RadioButtonButtonUncheckedPointeroverBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="RadioButtonButtonUncheckedDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="RadioButtonButtonUncheckedDisabledForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="RadioButtonButtonCheckedBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="RadioButtonButtonCheckedBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="RadioButtonButtonCheckedForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="RadioButtonButtonCheckedForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="RadioButtonButtonCheckedDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="RadioButtonButtonCheckedDisabledForeground" ResourceKey="SemiColorGrayText" />
<!-- CardRadioButton --> <!-- CardRadioButton -->
<SolidColorBrush x:Key="RadioButtonCardDefaultBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="RadioButtonCardDefaultBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="RadioButtonCardDefaultBorderBrush" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="RadioButtonCardDefaultBorderBrush" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="RadioButtonCardCheckedBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="RadioButtonCardCheckedBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="RadioButtonCardCheckDefaultBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="RadioButtonCardCheckDefaultBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="RadioButtonCardCheckPointeroverBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="RadioButtonCardCheckPointeroverBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="RadioButtonCardCheckPressedBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="RadioButtonCardCheckPressedBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="RadioButtonCardUncheckPointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="RadioButtonCardUncheckPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="RadioButtonCardUncheckPressedBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="RadioButtonCardUncheckPressedBackground" ResourceKey="SemiColorWindow" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="RefreshVisualizerIconForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="RefreshVisualizerIconForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="RefreshVisualizerIconBackground" Color="Transparent" /> <SolidColorBrush x:Key="RefreshVisualizerIconBackground" Color="Transparent" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ScrollBarButtonDefaultForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ScrollBarButtonDefaultForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ScrollBarButtonPointeroverForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ScrollBarButtonPointeroverForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ScrollBarThumbForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ScrollBarThumbForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ScrollBarThumbPointeroverForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ScrollBarThumbPointeroverForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ScrollBarBackground" Color="Transparent" /> <SolidColorBrush x:Key="ScrollBarBackground" Color="Transparent" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,14 +1,12 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="SliderTrackForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="SliderTrackForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="SliderTrackBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="SliderTrackBackground" ResourceKey="SemiColorHighlightText" />
<StaticResource x:Key="SliderTickForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="SliderTickForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="SliderThumbBackground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="SliderThumbBackground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="SliderThumbBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="SliderThumbBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="SliderThumbPointeroverBorderBrush" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="SliderThumbPointeroverBorderBrush" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="SliderThumbPressedBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="SliderThumbPressedBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="SliderTrackDisabledForeground" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="SliderThumbDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="SliderTrackDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="SliderTrackDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="SliderThumbDisabledBorderBrush" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="SliderTrackDisabledBackground" Color="{StaticResource WindowColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,5 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="SplitViewSeparatorBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="SplitViewSeparatorBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="SplitViewMaskBrush" Color="Transparent" /> <SolidColorBrush x:Key="SplitViewMaskBrush" Color="Transparent" />
<SolidColorBrush x:Key="SplitViewPaneBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="SplitViewPaneBackground" ResourceKey="SemiColorWindow" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,11 +1,10 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Line --> <!-- Line -->
<SolidColorBrush x:Key="TabItemLinePipeBackground" Color="Transparent" /> <SolidColorBrush x:Key="TabItemLinePipeBackground" Color="Transparent" />
<SolidColorBrush x:Key="TabItemLinePipeSelectedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="TabItemLinePipeSelectedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="TabItemLinePipePointeroverBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="TabItemLinePipePointeroverBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="TabItemLinePipePressedBorderBrush" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="TabItemLinePipePressedBorderBrush" ResourceKey="SemiColorHotlight" />
<StaticResource x:Key="TabItemLineHeaderForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="TabItemLineHeaderForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="TabItemLineHeaderPointeroverForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="TabItemLineHeaderPointeroverForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="TabItemLineHeaderSelectedForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="TabItemLineHeaderSelectedForeground" Color="{StaticResource WindowTextColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,10 +1,9 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="TextBlockDefaultForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="TextBlockDefaultForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="TextBlockDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="TextBlockDisabledForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="TextBlockCodeForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="TextBlockCodeForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="TextBlockCodeBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="TextBlockCodeBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="TextBlockCodeBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="TextBlockCodeBorderBrush" ResourceKey="SemiColorWindowText" />
<StaticResource x:Key="TextBlockSelectionBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="TextBlockSelectionBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="TextBlockSelectionForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="TextBlockSelectionForeground" Color="{StaticResource HighlightTextColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,19 +1,16 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="TextBoxTextCaretBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="TextBoxTextCaretBrush" ResourceKey="SemiColorWindowText" />
<StaticResource x:Key="TextBoxDefaultBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="TextBoxDefaultBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="TextBoxDefaultBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="TextBoxDefaultBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="TextBoxPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="TextBoxPointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="TextBoxPointeroverBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="TextBoxPointeroverBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="TextBoxPressedBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="TextBoxPressedBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="TextBoxFocusBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="TextBoxFocusBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="TextBoxForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="TextBoxForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="TextBoxInnerForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="TextBoxInnerForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="TextBoxDisabledBackground" ResourceKey="SemiColorWindow" />
<StaticResource x:Key="TextBoxDisabledForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="TextBoxDisabledBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="TextBoxDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="TextBoxDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="TextBoxSelectionBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="TextBoxDisabledBorderBrush" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="TextBoxSelectionForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="TextBoxSelectionBackground" Color="{StaticResource HighlightColor}" />
<SolidColorBrush x:Key="TextBoxSelectionForeground" Color="{StaticResource HighlightTextColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,32 +1,30 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ToggleButtonDefaultBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ToggleButtonDefaultBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ToggleButtonDefaultPointeroverBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ToggleButtonDefaultPointeroverBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ToggleButtonDefaultPressedBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ToggleButtonDefaultPressedBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ToggleButtonDefaultDisabledBorderBrush" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ToggleButtonDefaultDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="ToggleButtonDefaultDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ToggleButtonDefaultDisabledForeground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="ToggleButtonCheckedDisabledForeground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ToggleButtonCheckedDisabledForeground" ResourceKey="SemiColorWindow" />
<StaticResource x:Key="ToggleButtonDefaultBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ToggleButtonDefaultBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ToggleButtonDefaultPrimaryForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ToggleButtonDefaultPrimaryForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ToggleButtonPrimaryCheckedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ToggleButtonPrimaryCheckedBackground" Color="{StaticResource HighlightColor}" />
<SolidColorBrush x:Key="ToggleButtonPrimaryCheckedBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="ToggleButtonPrimaryCheckedBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="ToggleButtonPrimaryCheckedPointeroverBackground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ToggleButtonPrimaryCheckedPointeroverBackground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ToggleButtonPrimaryCheckedPressedForeground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ToggleButtonPrimaryCheckedPressedForeground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ToggleButtonPrimaryCheckedPressedBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ToggleButtonPrimaryCheckedPressedBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ToggleButtonSecondaryCheckedPressedBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ToggleButtonSecondaryCheckedPressedBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ToggleButtonTertiaryCheckedPressedBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ToggleButtonTertiaryCheckedPressedBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ToggleButtonSuccessCheckedPressedBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ToggleButtonSuccessCheckedPressedBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ToggleButtonWarningCheckedPressedBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ToggleButtonWarningCheckedPressedBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ToggleButtonDangerCheckedPressedBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ToggleButtonDangerCheckedPressedBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ToggleButtonPrimaryCheckedPressedBorderBrush" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ToggleButtonPrimaryCheckedPressedBorderBrush" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ToggleButtonCheckedForeground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ToggleButtonCheckedForeground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ToggleButtonCheckedDisabledBackground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ToggleButtonCheckedDisabledBackground" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="ToggleButtonPrimaryIndeterminateBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ToggleButtonPrimaryIndeterminateBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ToggleButtonPrimaryIndeterminateBorderBrush" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="ToggleButtonPrimaryIndeterminateBorderBrush" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="ToggleButtonPrimaryIndeterminatePointeroverBorderBrush" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ToggleButtonPrimaryIndeterminatePointeroverBorderBrush" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ToggleButtonPrimaryIndeterminatePointeroverForeground" ResourceKey="SemiColorButtonText" />
<SolidColorBrush x:Key="ToggleButtonPrimaryIndeterminatePointeroverForeground" Color="{StaticResource ButtonTextColor}" /> <StaticResource x:Key="ToggleButtonPrimaryIndeterminatePressedBorderBrush" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="ToggleButtonPrimaryIndeterminatePressedBorderBrush" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="ToggleButtonPrimaryIndeterminatePressedForeground" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="ToggleButtonPrimaryIndeterminatePressedForeground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="ToggleButtonIndeterminateDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="ToggleButtonIndeterminateDisabledBorderBrush" Color="{StaticResource GrayTextColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,18 +1,14 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ToggleSwitchDefaultBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="ToggleSwitchDefaultBorderBrush" ResourceKey="SemiColorWindowText" />
<StaticResource x:Key="ToggleSwitchContainerUnCheckedDefaultBackground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ToggleSwitchContainerUnCheckedDefaultBackground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="ToggleSwitchContainerUnCheckedPointeroverBackground" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="ToggleSwitchContainerUnCheckedPointeroverBackground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="ToggleSwitchContainerUnCheckedPressedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ToggleSwitchContainerUnCheckedPressedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ToggleSwitchContainerUnCheckedDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ToggleSwitchContainerUnCheckedDisabledBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ToggleSwitchContainerUnCheckedDisabledBorderBrush" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="ToggleSwitchContainerCheckedDefaultBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ToggleSwitchContainerUnCheckedDisabledBorderBrush" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="ToggleSwitchContainerCheckedPointeroverBackground" ResourceKey="SemiColorHotlight" />
<StaticResource x:Key="ToggleSwitchContainerCheckedPressedBackground" ResourceKey="SemiColorHighlight" />
<SolidColorBrush x:Key="ToggleSwitchContainerCheckedDefaultBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="ToggleSwitchContainerCheckedDisabledBackground" ResourceKey="SemiColorGrayText" />
<SolidColorBrush x:Key="ToggleSwitchContainerCheckedPointeroverBackground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="SimpleToggleSwitchContainerUnCheckedForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="ToggleSwitchContainerCheckedPressedBackground" Color="{StaticResource HighlightColor}" /> <StaticResource x:Key="SimpleToggleSwitchContainerCheckedForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="ToggleSwitchContainerCheckedDisabledBackground" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="SimpleToggleSwitchContainerUnCheckedForeground" Color="{StaticResource WindowTextColor}" />
<SolidColorBrush x:Key="SimpleToggleSwitchContainerCheckedForeground" Color="{StaticResource HighlightTextColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,5 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ToolTipBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="ToolTipBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="ToolTipForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="ToolTipForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="ToolTipBorderBrush" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="ToolTipBorderBrush" ResourceKey="SemiColorWindowText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,15 +1,14 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="TreeViewItemDefaultForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="TreeViewItemDefaultForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="TreeViewItemIconDefaultForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="TreeViewItemIconDefaultForeground" ResourceKey="SemiColorWindowText" />
<SolidColorBrush x:Key="TreeViewItemIconHoverForeground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="TreeViewItemIconHoverForeground" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="TreeViewItemDisabledForeground" Color="{StaticResource GrayTextColor}" /> <StaticResource x:Key="TreeViewItemDisabledForeground" ResourceKey="SemiColorGrayText" />
<StaticResource x:Key="TreeViewItemDefaultBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="TreeViewItemDefaultBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="TreeViewItemPointeroverForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="TreeViewItemPointeroverForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="TreeViewItemPointeroverBackground" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="TreeViewItemPointeroverBackground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="TreeViewItemPressedBackground" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="TreeViewItemPressedBackground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="TreeViewItemSelectedForeground" ResourceKey="SemiColorHighlightText" />
<SolidColorBrush x:Key="TreeViewItemSelectedForeground" Color="{StaticResource HighlightTextColor}" /> <StaticResource x:Key="TreeViewItemSelectedBackground" ResourceKey="SemiColorHotlight" />
<SolidColorBrush x:Key="TreeViewItemSelectedBackground" Color="{StaticResource HotlightColor}" /> <StaticResource x:Key="TreeViewItemDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="TreeViewItemDisabledBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="TreeViewItemSelectedDisabledBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="TreeViewItemSelectedDisabledBackground" Color="{StaticResource WindowColor}" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="WindowDefaultBackground" Color="{StaticResource WindowColor}" /> <StaticResource x:Key="WindowDefaultBackground" ResourceKey="SemiColorWindow" />
<SolidColorBrush x:Key="WindowDefaultForeground" Color="{StaticResource WindowTextColor}" /> <StaticResource x:Key="WindowDefaultForeground" ResourceKey="SemiColorWindowText" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StaticResource x:Key="CaptionButtonPointeroverBackground" ResourceKey="SemiColorFill1" /> <StaticResource x:Key="CaptionButtonPointeroverBackground" ResourceKey="SemiColorFill1" />
<StaticResource x:Key="CaptionButtonPressedBackground" ResourceKey="SemiColorFill2" /> <StaticResource x:Key="CaptionButtonPressedBackground" ResourceKey="SemiColorFill2" />
<StaticResource x:Key="CaptionButtonCloseForeground" ResourceKey="SemiColorWhite" />
<StaticResource x:Key="CaptionButtonClosePointeroverBackground" ResourceKey="SemiColorDangerPointerover" /> <StaticResource x:Key="CaptionButtonClosePointeroverBackground" ResourceKey="SemiColorDangerPointerover" />
<StaticResource x:Key="CaptionButtonClosePressedBackground" ResourceKey="SemiColorDangerActive" /> <StaticResource x:Key="CaptionButtonClosePressedBackground" ResourceKey="SemiColorDangerActive" />
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorText2" /> <StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorText2" />

View File

@@ -1,4 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StaticResource x:Key="WindowDefaultBackground" ResourceKey="SemiColorBackground0" /> <StaticResource x:Key="WindowDefaultBackground" ResourceKey="SemiColorBackground0" />
<StaticResource x:Key="WindowDefaultForeground" ResourceKey="SemiColorText0" /> <StaticResource x:Key="WindowDefaultForeground" ResourceKey="SemiColorText0" />
<StaticResource x:Key="DefaultForeground" ResourceKey="SemiColorText0" />
</ResourceDictionary> </ResourceDictionary>

Some files were not shown because too many files have changed in this diff Show More