mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-05 16:56:34 +08:00
feat: redesign schemes.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Dark;
|
||||
|
||||
public class Palette: ResourceDictionary
|
||||
{
|
||||
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Light;
|
||||
|
||||
public class Palette: ResourceDictionary
|
||||
{
|
||||
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
6
src/Semi.Avalonia/Themes/Schemes/DarkTheme.axaml
Normal file
6
src/Semi.Avalonia/Themes/Schemes/DarkTheme.axaml
Normal 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>
|
||||
6
src/Semi.Avalonia/Themes/Schemes/LightTheme.axaml
Normal file
6
src/Semi.Avalonia/Themes/Schemes/LightTheme.axaml
Normal 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>
|
||||
@@ -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" />
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
</ResourceDictionary>
|
||||
@@ -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" />
|
||||
|
||||
@@ -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>
|
||||
5
src/Semi.Avalonia/Tokens/Palette/Dark.axaml.cs
Normal file
5
src/Semi.Avalonia/Tokens/Palette/Dark.axaml.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Tokens.Palette;
|
||||
|
||||
public class Dark : ResourceDictionary;
|
||||
@@ -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>
|
||||
5
src/Semi.Avalonia/Tokens/Palette/Light.axaml.cs
Normal file
5
src/Semi.Avalonia/Tokens/Palette/Light.axaml.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Tokens.Palette;
|
||||
|
||||
public class Light : ResourceDictionary;
|
||||
Reference in New Issue
Block a user