mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-13 21:02:08 +08:00
1.1.3 -> 1.1.4 第10次更新
This commit is contained in:
parent
fe44a5231e
commit
5bd9ef3e58
18
Preses/AppPres.cs
Normal file
18
Preses/AppPres.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using MaterialDesignThemes.Wpf;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Preses;
|
||||||
|
|
||||||
|
internal partial class AppPres : ObservableObject
|
||||||
|
{
|
||||||
|
[ObservableProperty]
|
||||||
|
private bool? isLightTheme = null;
|
||||||
|
partial void OnIsLightThemeChanged(bool? value)
|
||||||
|
{
|
||||||
|
PaletteHelper paletteHelper = new();
|
||||||
|
Theme newTheme = paletteHelper.GetTheme();
|
||||||
|
|
||||||
|
newTheme.SetBaseTheme(value.HasValue ? value.GetValueOrDefault() ? BaseTheme.Light : BaseTheme.Dark : BaseTheme.Inherit);
|
||||||
|
paletteHelper.SetTheme(newTheme);
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,7 @@ using File = System.IO.File;
|
|||||||
|
|
||||||
namespace Sheas_Cealer.Preses;
|
namespace Sheas_Cealer.Preses;
|
||||||
|
|
||||||
internal partial class MainPres : ObservableObject
|
internal partial class MainPres : AppPres
|
||||||
{
|
{
|
||||||
internal MainPres(string[] args)
|
internal MainPres(string[] args)
|
||||||
{
|
{
|
||||||
@ -70,17 +70,6 @@ internal partial class MainPres : ObservableObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
private bool? isLightTheme = null;
|
|
||||||
partial void OnIsLightThemeChanged(bool? value)
|
|
||||||
{
|
|
||||||
PaletteHelper paletteHelper = new();
|
|
||||||
Theme newTheme = paletteHelper.GetTheme();
|
|
||||||
|
|
||||||
newTheme.SetBaseTheme(value.HasValue ? value.GetValueOrDefault() ? BaseTheme.Light : BaseTheme.Dark : BaseTheme.Inherit);
|
|
||||||
paletteHelper.SetTheme(newTheme);
|
|
||||||
}
|
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool isNginxExist = File.Exists(MainConst.NginxPath);
|
private bool isNginxExist = File.Exists(MainConst.NginxPath);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user