From 5b1fb6e1dd0159ee2fc82f945ed222f6349a8562 Mon Sep 17 00:00:00 2001 From: DismissedLight <1686188646@qq.com> Date: Tue, 10 Oct 2023 22:27:53 +0800 Subject: [PATCH] move resources --- src/Snap.Hutao/Snap.Hutao/App.xaml | 191 +----------------- .../Snap.Hutao/Control/Image/CachedImage.xaml | 82 ++++++++ .../Snap.Hutao/Control/Theme/Converter.xaml | 35 ++++ .../Snap.Hutao/Control/Theme/FontStyle.xaml | 5 +- .../Snap.Hutao/Control/Theme/Glyph.xaml | 10 + .../Control/Theme/ItemsPanelTemplate.xaml | 23 +++ .../Control/Theme/SettingsStyle.xaml | 10 + .../Snap.Hutao/Control/Theme/Uri.xaml | 34 ++++ .../Core/Windowing/WindowController.cs | 6 +- src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj | 35 ++++ 10 files changed, 241 insertions(+), 190 deletions(-) create mode 100644 src/Snap.Hutao/Snap.Hutao/Control/Image/CachedImage.xaml create mode 100644 src/Snap.Hutao/Snap.Hutao/Control/Theme/Converter.xaml create mode 100644 src/Snap.Hutao/Snap.Hutao/Control/Theme/Glyph.xaml create mode 100644 src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml create mode 100644 src/Snap.Hutao/Snap.Hutao/Control/Theme/Uri.xaml diff --git a/src/Snap.Hutao/Snap.Hutao/App.xaml b/src/Snap.Hutao/Snap.Hutao/App.xaml index 2f382bce..7ea2e5c4 100644 --- a/src/Snap.Hutao/Snap.Hutao/App.xaml +++ b/src/Snap.Hutao/Snap.Hutao/App.xaml @@ -2,24 +2,24 @@ x:Class="Snap.Hutao.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:cwcont="using:CommunityToolkit.WinUI.Controls" - xmlns:cwconv="using:CommunityToolkit.WinUI.Converters" - xmlns:cwm="using:CommunityToolkit.WinUI.Media" - xmlns:shci="using:Snap.Hutao.Control.Image" - xmlns:shmmc="using:Snap.Hutao.Model.Metadata.Converter" - xmlns:shvc="using:Snap.Hutao.View.Converter"> + xmlns:cwm="using:CommunityToolkit.WinUI.Media"> + + + + + + - @@ -38,11 +38,6 @@ 4,4,0,0 0,0,4,4 - 6 - 6,6,0,0 - 0,6,6,0 - 0,0,6,6 - 2 288 212 @@ -61,70 +56,6 @@ - - https://hut.ao/features/mhy-account-switch.html - https://hut.ao/statements/bug-report.html - https://translate.hut.ao - https://hut.ao - https://github.com/HolographicHat/GetToken/releases/latest - https://afdian.net/a/DismissedLight - - - https://static.snapgenshin.com/Bg/UI_ItemIcon_None.png - https://static.snapgenshin.com/Bg/UI_MarkTower.png - https://static.snapgenshin.com/Bg/UI_Icon_Intee_Explore_1.png - https://static.snapgenshin.com/Bg/UI_MarkQuest_Events_Proce.png - https://static.snapgenshin.com/ItemIcon/UI_ItemIcon_201.png - https://static.snapgenshin.com/ItemIcon/UI_ItemIcon_204.png - https://static.snapgenshin.com/ItemIcon/UI_ItemIcon_210.png - https://static.snapgenshin.com/ItemIcon/UI_ItemIcon_220021.png - https://static.snapgenshin.com/Bg/UI_ImgSign_ItemIcon.png - https://static.snapgenshin.com/AvatarCard/UI_AvatarIcon_Costume_Card.png - https://static.snapgenshin.com/EmotionIcon/UI_EmotionIcon25.png - https://static.snapgenshin.com/EmotionIcon/UI_EmotionIcon71.png - https://static.snapgenshin.com/EmotionIcon/UI_EmotionIcon250.png - https://static.snapgenshin.com/EmotionIcon/UI_EmotionIcon272.png - https://static.snapgenshin.com/EmotionIcon/UI_EmotionIcon293.png - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Theme/Converter.xaml b/src/Snap.Hutao/Snap.Hutao/Control/Theme/Converter.xaml new file mode 100644 index 00000000..beef99ac --- /dev/null +++ b/src/Snap.Hutao/Snap.Hutao/Control/Theme/Converter.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Theme/FontStyle.xaml b/src/Snap.Hutao/Snap.Hutao/Control/Theme/FontStyle.xaml index 18fd7359..3d7f052c 100644 --- a/src/Snap.Hutao/Snap.Hutao/Control/Theme/FontStyle.xaml +++ b/src/Snap.Hutao/Snap.Hutao/Control/Theme/FontStyle.xaml @@ -1,7 +1,4 @@ - + ms-appx:///Resource/Font/MiSans-Regular.ttf#MiSans ms-appx:///Resource/Font/CascadiaMono.ttf#Cascadia Mono, ms-appx:///Resource/Font/MiSans-Regular.ttf#MiSans diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Theme/Glyph.xaml b/src/Snap.Hutao/Snap.Hutao/Control/Theme/Glyph.xaml new file mode 100644 index 00000000..8e5db5ad --- /dev/null +++ b/src/Snap.Hutao/Snap.Hutao/Control/Theme/Glyph.xaml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml b/src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml new file mode 100644 index 00000000..46d10041 --- /dev/null +++ b/src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Theme/SettingsStyle.xaml b/src/Snap.Hutao/Snap.Hutao/Control/Theme/SettingsStyle.xaml index 144c250c..f0182d63 100644 --- a/src/Snap.Hutao/Snap.Hutao/Control/Theme/SettingsStyle.xaml +++ b/src/Snap.Hutao/Snap.Hutao/Control/Theme/SettingsStyle.xaml @@ -18,4 +18,14 @@ TargetType="ComboBox"> + diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Theme/Uri.xaml b/src/Snap.Hutao/Snap.Hutao/Control/Theme/Uri.xaml new file mode 100644 index 00000000..3e50461f --- /dev/null +++ b/src/Snap.Hutao/Snap.Hutao/Control/Theme/Uri.xaml @@ -0,0 +1,34 @@ + + + https://hut.ao/statements/bug-report.html + https://hut.ao + https://hut.ao/features/mhy-account-switch.html + https://translate.hut.ao + + + https://github.com/HolographicHat/GetToken/releases/latest + https://afdian.net/a/DismissedLight + + + https://static.snapgenshin.com/AvatarCard/UI_AvatarIcon_Costume_Card.png + + + https://static.snapgenshin.com/Bg/UI_Icon_Intee_Explore_1.png + https://static.snapgenshin.com/Bg/UI_ImgSign_ItemIcon.png + https://static.snapgenshin.com/Bg/UI_ItemIcon_None.png + https://static.snapgenshin.com/Bg/UI_MarkQuest_Events_Proce.png + https://static.snapgenshin.com/Bg/UI_MarkTower.png + + + https://static.snapgenshin.com/ItemIcon/UI_ItemIcon_201.png + https://static.snapgenshin.com/ItemIcon/UI_ItemIcon_204.png + https://static.snapgenshin.com/ItemIcon/UI_ItemIcon_210.png + https://static.snapgenshin.com/ItemIcon/UI_ItemIcon_220021.png + + + https://static.snapgenshin.com/EmotionIcon/UI_EmotionIcon25.png + https://static.snapgenshin.com/EmotionIcon/UI_EmotionIcon71.png + https://static.snapgenshin.com/EmotionIcon/UI_EmotionIcon250.png + https://static.snapgenshin.com/EmotionIcon/UI_EmotionIcon272.png + https://static.snapgenshin.com/EmotionIcon/UI_EmotionIcon293.png + diff --git a/src/Snap.Hutao/Snap.Hutao/Core/Windowing/WindowController.cs b/src/Snap.Hutao/Snap.Hutao/Core/Windowing/WindowController.cs index a8d085e1..946fc5bc 100644 --- a/src/Snap.Hutao/Snap.Hutao/Core/Windowing/WindowController.cs +++ b/src/Snap.Hutao/Snap.Hutao/Core/Windowing/WindowController.cs @@ -114,8 +114,10 @@ internal sealed class WindowController { if (e.PropertyName == nameof(AppOptions.BackdropType)) { - ArgumentNullException.ThrowIfNull(sender); - UpdateSystemBackdrop(((AppOptions)sender).BackdropType); + if (sender is AppOptions options) + { + UpdateSystemBackdrop(options.BackdropType); + } } } diff --git a/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj b/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj index 67d6b18a..96fc52e9 100644 --- a/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj +++ b/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj @@ -72,14 +72,19 @@ + + + + + @@ -303,6 +308,36 @@ + + + MSBuild:Compile + + + + + + MSBuild:Compile + + + + + + MSBuild:Compile + + + + + + MSBuild:Compile + + + + + + MSBuild:Compile + + + MSBuild:Compile