Skip to content

Commit

Permalink
Update default loaf wallpaper image
Browse files Browse the repository at this point in the history
Update default Loaf wallpaper image, use Windows 11 default wallpaper
  • Loading branch information
Gaoyifei1011 committed Sep 30, 2024
1 parent 50d29f8 commit d8a8f1b
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 33 deletions.
Binary file added WindowsTools/Assets/Images/LoafDarkWallpaper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WindowsTools/Assets/Images/LoafLightWallpaper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed WindowsTools/Assets/Images/LoafWallpaper.jpg
Binary file not shown.
6 changes: 3 additions & 3 deletions WindowsTools/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[assembly: AssemblyCompany("高怡飞")]
[assembly: AssemblyCopyright("Copyright ©2024 高怡飞, All Rights Reserved.")]
[assembly: AssemblyDescription("Windows 工具箱")]
[assembly: AssemblyFileVersion("3.0.925.0")]
[assembly: AssemblyInformationalVersion("3.0.925.0")]
[assembly: AssemblyFileVersion("3.0.930.0")]
[assembly: AssemblyInformationalVersion("3.0.930.0")]
[assembly: AssemblyProduct("Windows 工具箱")]
[assembly: AssemblyTitle("Windows 工具箱")]
[assembly: AssemblyVersion("3.0.925.0")]
[assembly: AssemblyVersion("3.0.930.0")]
2 changes: 2 additions & 0 deletions WindowsTools/Views/Pages/LoafPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
xmlns:service="using:WindowsTools.Services.Controls.Settings"
xmlns:string="using:WindowsTools.Strings"
xmlns:sys="using:System"
Loaded="{x:Bind OnLoaded}"
NavigationCacheMode="Enabled"
Unloaded="{x:Bind OnUnLoaded}"
mc:Ignorable="d">

<Grid Padding="0">
Expand Down
37 changes: 34 additions & 3 deletions WindowsTools/Views/Pages/LoafPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace WindowsTools.Views.Pages
/// </summary>
public sealed partial class LoafPage : Page, INotifyPropertyChanged
{
private bool isLoadWallpaperFailed;
private readonly SynchronizationContext synchronizationContext = SynchronizationContext.Current;

private bool _loadImageCompleted = false;
Expand Down Expand Up @@ -183,7 +184,8 @@ public LoafPage()
}
catch (Exception e)
{
LoafImage = new(new Uri("ms-appx:///Assets/Images/LoafWallpaper.jpg"));
isLoadWallpaperFailed = true;
LoafImage = ActualTheme is ElementTheme.Light ? new(new Uri("ms-appx:///Assets/Images/LoafLightWallpaper.jpg")) : new(new Uri("ms-appx:///Assets/Images/LoafDarkWallpaper.jpg"));
LoadImageCompleted = true;
LogService.WriteLog(EventLevel.Error, "Load bing wallpaper image failed", e);
}
Expand All @@ -193,17 +195,19 @@ public LoafPage()
{
synchronizationContext.Post(_ =>
{
LoafImage = new(new Uri("ms-appx:///Assets/Images/LoafWallpaper.jpg"));
isLoadWallpaperFailed = true;
LoafImage = ActualTheme is ElementTheme.Light ? new(new Uri("ms-appx:///Assets/Images/LoafLightWallpaper.jpg")) : new(new Uri("ms-appx:///Assets/Images/LoafDarkWallpaper.jpg"));
LoadImageCompleted = true;
}, null);
}
}
catch (Exception e)
{
isLoadWallpaperFailed = true;
LogService.WriteLog(EventLevel.Error, "Load bing wallpaper image failed", e);
synchronizationContext.Post(_ =>
{
LoafImage = new(new Uri("ms-appx:///Assets/Images/LoafWallpaper.jpg"));
LoafImage = ActualTheme is ElementTheme.Light ? new(new Uri("ms-appx:///Assets/Images/LoafLightWallpaper.jpg")) : new(new Uri("ms-appx:///Assets/Images/LoafDarkWallpaper.jpg"));
LoadImageCompleted = true;
}, null);
}
Expand All @@ -212,6 +216,33 @@ public LoafPage()

#region 第一部分:摸鱼页面——挂载的事件

/// <summary>
/// 在已构造 FrameworkElement 并将其添加到对象树中并准备好交互时发生的事件
/// </summary>
private void OnLoaded(object sender, RoutedEventArgs args)
{
ActualThemeChanged += OnActualThemeChanged;
}

/// <summary>
/// 当此对象不再连接到主对象树时发生的事件
/// </summary>
private void OnUnLoaded(object sender, RoutedEventArgs args)
{
ActualThemeChanged -= OnActualThemeChanged;
}

/// <summary>
/// 当前应用主题发生变化时对应的事件
/// </summary>
private void OnActualThemeChanged(FrameworkElement sender, object args)
{
if (isLoadWallpaperFailed)
{
LoafImage = ActualTheme is ElementTheme.Light ? new(new Uri("ms-appx:///Assets/Images/LoafLightWallpaper.jpg")) : new(new Uri("ms-appx:///Assets/Images/LoafDarkWallpaper.jpg"));
}
}

/// <summary>
/// 开始摸鱼
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion WindowsTools/Views/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,6 @@

<!-- 文件右键菜单设置 -->
<Grid
x:Name="FileMenuSettings"
Height="61"
Padding="16,12"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
Expand Down
35 changes: 19 additions & 16 deletions WindowsTools/WindowsTools.csproj
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AnalysisLevel>latest</AnalysisLevel>
<ApplicationIcon>Assets\WindowsTools.ico</ApplicationIcon>
<ApplicationManifest>App.manifest</ApplicationManifest>
<AssemblyName>WindowsTools</AssemblyName>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<DebuggerSupport>false</DebuggerSupport>
<DebugType>none</DebugType>
<Deterministic>true</Deterministic>
<DisableXbfLineInfo>False</DisableXbfLineInfo>
<FileAlignment>512</FileAlignment>
<DesktopCompatible>true</DesktopCompatible>
<DisableXbfLineInfo>false</DisableXbfLineInfo>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<IncludeSymbols>false</IncludeSymbols>
<LangVersion>latest</LangVersion>
<MileXamlNoSunValleyXamlStyle>true</MileXamlNoSunValleyXamlStyle>
<Optimize>False</Optimize>
<Optimize>false</Optimize>
<OutputType>WinExe</OutputType>
<Platforms>x86;x64;ARM64</Platforms>
<RootNamespace>WindowsTools</RootNamespace>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<StartupObject>WindowsTools.Program</StartupObject>
<TargetFramework>net481</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<TargetPlatformVersion>10.0.22621.0</TargetPlatformVersion>
<UseUwpTools>false</UseUwpTools>
<TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<WebView2EnableCsWinRTProjection>false</WebView2EnableCsWinRTProjection>
<WebView2NeverCopyLoaderDllToOutputDirectory>true</WebView2NeverCopyLoaderDllToOutputDirectory>
<WebView2UseWinRT>False</WebView2UseWinRT>
<WindowsAppSDKVerifyWinrtRuntimeVersion>false</WindowsAppSDKVerifyWinrtRuntimeVersion>
<WindowsKitsPath></WindowsKitsPath>
</PropertyGroup>
Expand Down Expand Up @@ -302,7 +305,8 @@
<Content Include="Assets\StoreLogo.scale-150.png" CopyToOutputDirectory="Always" />
<Content Include="Assets\StoreLogo.scale-200.png" CopyToOutputDirectory="Always" />
<Content Include="Assets\StoreLogo.scale-400.png" CopyToOutputDirectory="Always" />
<Content Include="Assets\Images\LoafWallpaper.jpg" CopyToOutputDirectory="Always" />
<Content Include="Assets\Images\LoafDarkWallpaper.jpg" CopyToOutputDirectory="Always" />
<Content Include="Assets\Images\LoafLightWallpaper.jpg" CopyToOutputDirectory="Always" />
<Content Include="Assets\Images\NoiseAsset_256x256_PNG.png" CopyToOutputDirectory="Always" />
<Content Include="Assets\Wide310x150Logo.scale-100.png" CopyToOutputDirectory="Always" />
<Content Include="Assets\Wide310x150Logo.scale-125.png" CopyToOutputDirectory="Always" />
Expand Down Expand Up @@ -358,13 +362,13 @@
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
<PackageReference Include="ZXing.Net" Version="0.16.9" />

<Page Update="Styles\WinUI\AppBarButton.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\WinUI\DateTimePicker.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\WinUI\HyperlinkButton.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\WinUI\InfoBar.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\WinUI\MenuFlyout.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\WinUI\TeachingTip.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\WinUI\TimePicker.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\AppBarButton.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\DateTimePicker.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\HyperlinkButton.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\InfoBar.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\MenuFlyout.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\TeachingTip.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="Styles\TimePicker.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="UI\TeachingTips\AppInformationDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="UI\TeachingTips\FileCheckDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
<Page Update="UI\TeachingTips\LicenseDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
Expand Down Expand Up @@ -400,7 +404,6 @@
<Reference Include="Microsoft.UI.Xaml" HintPath="$(PkgMicrosoft_UI_Xaml)\lib\uap10.0\Microsoft.UI.Xaml.winmd" IsWinMDFile="true" />
<Reference Include="Microsoft.UI.Windowing" HintPath="$(PkgMicrosoft_WindowsAppSDK)\lib\uap10.0.18362\Microsoft.UI.winmd" IsWinMDFile="true" Private="false" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.IO.Log" />
<Reference Include="System.Management" />
<Reference Include="System.Net.Http" />

Expand Down
2 changes: 1 addition & 1 deletion WindowsToolsPackage/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Identity
Name="Gaoyifei1011.WindowsTools"
Publisher="CN=高怡飞"
Version="3.0.925.0" />
Version="3.0.930.0" />

<Properties>
<DisplayName>ms-resource:PackageDisplayName</DisplayName>
Expand Down
6 changes: 3 additions & 3 deletions WindowsToolsShellExtension/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
[assembly: AssemblyCompany("高怡飞")]
[assembly: AssemblyCopyright("Copyright ©2024 高怡飞, All Rights Reserved.")]
[assembly: AssemblyDescription("Windows 工具箱 右键菜单扩展")]
[assembly: AssemblyFileVersion("3.0.925.0")]
[assembly: AssemblyInformationalVersion("3.0.925.0")]
[assembly: AssemblyFileVersion("3.0.930.0")]
[assembly: AssemblyInformationalVersion("3.0.930.0")]
[assembly: AssemblyProduct("Windows 工具箱 右键菜单扩展")]
[assembly: AssemblyTitle("Windows 工具箱 右键菜单扩展")]
[assembly: AssemblyVersion("3.0.925.0")]
[assembly: AssemblyVersion("3.0.930.0")]

// 应用程序默认区域性的资源控制器设置
[assembly: NeutralResourcesLanguage("en-us")]
Expand Down
16 changes: 10 additions & 6 deletions WindowsToolsShellExtension/WindowsToolsShellExtension.csproj
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AnalysisLevel>latest</AnalysisLevel>
<AssemblyName>WindowsToolsShellExtension</AssemblyName>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<CsWinRTEnableDynamicObjectsSupport>false</CsWinRTEnableDynamicObjectsSupport>
<DebuggerSupport>false</DebuggerSupport>
<DebugType>none</DebugType>
<Deterministic>true</Deterministic>
<DisableXbfLineInfo>False</DisableXbfLineInfo>
<FileAlignment>512</FileAlignment>
<ForceAotCompile>true</ForceAotCompile>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
<ImplicitUsings>disable</ImplicitUsings>
<IncludeAllContentForSelfExtract>false</IncludeAllContentForSelfExtract>
<IncludeSymbols>false</IncludeSymbols>
<IsAotCompatible>true</IsAotCompatible>
<LangVersion>latest</LangVersion>
<MetadataUpdaterSupport>false</MetadataUpdaterSupport>
<MetricsSupport>false</MetricsSupport>
<Optimize>False</Optimize>
<OptimizationPreference>Size</OptimizationPreference>
<Optimize>false</Optimize>
<OutputType>Library</OutputType>
<Platforms>x86;x64;ARM64</Platforms>
<PublishAot>True</PublishAot>
<PublishTrimmed>True</PublishTrimmed>
<RootNamespace>WindowsToolsShellExtension</RootNamespace>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<TargetPlatformVersion>10.0.26100.0</TargetPlatformVersion>
<TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>
<XmlResolverIsNetworkingEnabledByDefault>false</XmlResolverIsNetworkingEnabledByDefault>
</PropertyGroup>

Expand Down

0 comments on commit d8a8f1b

Please sign in to comment.