feat: redesign schemes.

This commit is contained in:
Zhang Dian
2024-12-26 01:42:18 +08:00
parent 67cbcfe313
commit 0eb138d73c
14 changed files with 29 additions and 32 deletions

View File

@@ -5,6 +5,7 @@ using Avalonia.Controls;
using Avalonia.Media;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Messaging;
using Semi.Avalonia.Tokens.Palette;
namespace Semi.Avalonia.Demo.ViewModels;
@@ -51,8 +52,8 @@ public class PaletteDemoViewModel : ObservableObject
public PaletteDemoViewModel()
{
_lightResourceDictionary = new Light.Palette();
_darkResourceDictionary = new Dark.Palette();
_lightResourceDictionary = new Light();
_darkResourceDictionary = new Dark();
WeakReferenceMessenger.Default.Register<PaletteDemoViewModel, ColorItemViewModel>(this, OnClickColorItem);
}

View File

@@ -1,9 +0,0 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Dark;
public class Palette: ResourceDictionary
{
}

View File

@@ -1,7 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Palette.axaml" />
<!-- Controls -->
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/AdornerLayer.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Border.axaml" />

View File

@@ -1,9 +0,0 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Light;
public class Palette: ResourceDictionary
{
}

View File

@@ -1,7 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Palette.axaml" />
<!-- Controls -->
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/AdornerLayer.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/AutoCompleteBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Border.axaml" />

View File

@@ -0,0 +1,6 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://Semi.Avalonia/Tokens/Palette/Dark.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/_index.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@@ -0,0 +1,6 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://Semi.Avalonia/Tokens/Palette/Light.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/_index.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@@ -3,8 +3,8 @@
<Styles.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceInclude x:Key="Default" Source="avares://Semi.Avalonia/Themes/Light/_index.axaml" />
<ResourceInclude x:Key="Dark" Source="avares://Semi.Avalonia/Themes/Dark/_index.axaml" />
<ResourceInclude x:Key="Default" Source="avares://Semi.Avalonia/Themes/Schemes/LightTheme.axaml" />
<ResourceInclude x:Key="Dark" Source="avares://Semi.Avalonia/Themes/Schemes/DarkTheme.axaml" />
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Aquatic}" Source="avares://Semi.Avalonia/Themes/Schemes/AquaticTheme.axaml" />
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Desert}" Source="avares://Semi.Avalonia/Themes/Schemes/DesertTheme.axaml" />
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Dusk}" Source="avares://Semi.Avalonia/Themes/Schemes/DuskTheme.axaml" />

View File

@@ -1,2 +0,0 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</ResourceDictionary>

View File

@@ -1,7 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/Palette.axaml" />
<!-- Controls -->
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/AdornerLayer.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/AutoCompleteBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/Border.axaml" />

View File

@@ -1,4 +1,4 @@
<ResourceDictionary x:Class="Semi.Avalonia.Dark.Palette" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary x:Class="Semi.Avalonia.Tokens.Palette.Dark" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Color Resources -->
<Color x:Key="SemiRed0Color">#6C090B</Color>
<Color x:Key="SemiRed1Color">#901110</Color>

View File

@@ -0,0 +1,5 @@
using Avalonia.Controls;
namespace Semi.Avalonia.Tokens.Palette;
public class Dark : ResourceDictionary;

View File

@@ -1,4 +1,4 @@
<ResourceDictionary x:Class="Semi.Avalonia.Light.Palette" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary x:Class="Semi.Avalonia.Tokens.Palette.Light" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Color Resources -->
<Color x:Key="SemiRed0Color">#FEF2ED</Color>
<Color x:Key="SemiRed1Color">#FEDDD2</Color>

View File

@@ -0,0 +1,5 @@
using Avalonia.Controls;
namespace Semi.Avalonia.Tokens.Palette;
public class Light : ResourceDictionary;