mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-14 05:12:09 +08:00
1.1.3 -> 1.1.4 第38次更新
This commit is contained in:
parent
5e94c1e81b
commit
73f411aca3
@ -17,25 +17,31 @@ public partial class App : Application
|
|||||||
{
|
{
|
||||||
_ = new SettingsPres();
|
_ = new SettingsPres();
|
||||||
|
|
||||||
|
#region Primary Color
|
||||||
PaletteHelper paletteHelper = new();
|
PaletteHelper paletteHelper = new();
|
||||||
Theme newTheme = paletteHelper.GetTheme();
|
Theme newTheme = paletteHelper.GetTheme();
|
||||||
System.Drawing.Color newColor = Settings.Default.PrimaryColor;
|
System.Drawing.Color newColor = Settings.Default.PrimaryColor;
|
||||||
|
|
||||||
newTheme.SetPrimaryColor(Color.FromRgb(newColor.R, newColor.G, newColor.B));
|
newTheme.SetPrimaryColor(Color.FromRgb(newColor.R, newColor.G, newColor.B));
|
||||||
paletteHelper.SetTheme(newTheme);
|
paletteHelper.SetTheme(newTheme);
|
||||||
|
#endregion Primary Color
|
||||||
|
|
||||||
|
#region Background Color
|
||||||
if (Environment.OSVersion.Version.Build < 22000)
|
if (Environment.OSVersion.Version.Build < 22000)
|
||||||
{
|
{
|
||||||
Style newWindowStyle = new(typeof(Window), Current.Resources["CommonWindow"] as Style);
|
Style newWindowStyle = new(typeof(Window), Current.Resources["CommonWindow"] as Style);
|
||||||
newWindowStyle.Setters.Add(new Setter(Window.BackgroundProperty, new DynamicResourceExtension("MaterialDesignBackground")));
|
newWindowStyle.Setters.Add(new Setter(Window.BackgroundProperty, new DynamicResourceExtension("MaterialDesignBackground")));
|
||||||
Current.Resources["CommonWindow"] = newWindowStyle;
|
Current.Resources["CommonWindow"] = newWindowStyle;
|
||||||
}
|
}
|
||||||
|
#endregion Background Color
|
||||||
|
|
||||||
|
#region Foreground Color
|
||||||
Color? foregroundColor = ForegroundGenerator.GetForeground(newColor.R, newColor.G, newColor.B);
|
Color? foregroundColor = ForegroundGenerator.GetForeground(newColor.R, newColor.G, newColor.B);
|
||||||
|
|
||||||
Style newButtonStyle = new(typeof(Button), Current.Resources[typeof(Button)] as Style);
|
Style newButtonStyle = new(typeof(Button), Current.Resources[typeof(Button)] as Style);
|
||||||
newButtonStyle.Setters.Add(new Setter(Button.ForegroundProperty, foregroundColor.HasValue ? new SolidColorBrush(foregroundColor.Value) : new DynamicResourceExtension("MaterialDesignBackground")));
|
newButtonStyle.Setters.Add(new Setter(Button.ForegroundProperty, foregroundColor.HasValue ? new SolidColorBrush(foregroundColor.Value) : new DynamicResourceExtension("MaterialDesignBackground")));
|
||||||
Current.Resources[typeof(Button)] = newButtonStyle;
|
Current.Resources[typeof(Button)] = newButtonStyle;
|
||||||
|
#endregion Foreground Color
|
||||||
|
|
||||||
new MainWin(e.Args).Show();
|
new MainWin(e.Args).Show();
|
||||||
}
|
}
|
||||||
|
@ -39,4 +39,4 @@ namespace Sheas_Cealer.Utils
|
|||||||
IsCleaning = false;
|
IsCleaning = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user