mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-13 21:02:08 +08:00
1.1.3 -> 1.1.4 第36次更新
This commit is contained in:
parent
688412f2b5
commit
dda0c2efee
18
App.xaml.cs
18
App.xaml.cs
@ -1,4 +1,6 @@
|
||||
using System.Windows;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
@ -22,12 +24,18 @@ public partial class App : Application
|
||||
newTheme.SetPrimaryColor(Color.FromRgb(newColor.R, newColor.G, newColor.B));
|
||||
paletteHelper.SetTheme(newTheme);
|
||||
|
||||
if (Environment.OSVersion.Version.Major == 10 && Environment.OSVersion.Version.Build < 22000)
|
||||
{
|
||||
Style newWindowStyle = new(typeof(Window), Current.Resources["CommonWindow"] as Style);
|
||||
newWindowStyle.Setters.Add(new Setter(Window.BackgroundProperty, new DynamicResourceExtension("MaterialDesignBackground")));
|
||||
Current.Resources["CommonWindow"] = newWindowStyle;
|
||||
}
|
||||
|
||||
Color? foregroundColor = ForegroundGenerator.GetForeground(newColor.R, newColor.G, newColor.B);
|
||||
|
||||
if (foregroundColor.HasValue)
|
||||
Current.Resources["MaterialDesignBackground"] = new SolidColorBrush(foregroundColor.Value);
|
||||
else
|
||||
Current.Resources.Remove("MaterialDesignBackground");
|
||||
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")));
|
||||
Current.Resources[typeof(Button)] = newButtonStyle;
|
||||
|
||||
new MainWin(e.Args).Show();
|
||||
}
|
||||
|
@ -51,13 +51,13 @@ internal partial class SettingsPres : GlobalPres
|
||||
{
|
||||
FontWeight newWeight = value.HasValue ? value.Value ? FontWeights.Light : FontWeights.Bold : FontWeights.Regular;
|
||||
|
||||
Style newStyle = new(typeof(Window), Application.Current.Resources["CommonWindow"] as Style);
|
||||
newStyle.Setters.Add(new Setter(Window.FontWeightProperty, newWeight));
|
||||
Application.Current.Resources["CommonWindow"] = newStyle;
|
||||
Style newWindowStyle = new(typeof(Window), Application.Current.Resources["CommonWindow"] as Style);
|
||||
newWindowStyle.Setters.Add(new Setter(Window.FontWeightProperty, newWeight));
|
||||
Application.Current.Resources["CommonWindow"] = newWindowStyle;
|
||||
|
||||
newStyle = new(typeof(Button), Application.Current.Resources[typeof(Button)] as Style);
|
||||
newStyle.Setters.Add(new Setter(Button.FontWeightProperty, newWeight));
|
||||
Application.Current.Resources[typeof(Button)] = newStyle;
|
||||
Style newButtonStyle = new(typeof(Button), Application.Current.Resources[typeof(Button)] as Style);
|
||||
newButtonStyle.Setters.Add(new Setter(Button.FontWeightProperty, newWeight));
|
||||
Application.Current.Resources[typeof(Button)] = newButtonStyle;
|
||||
|
||||
Settings.Default.IsLightWeight = (sbyte)(value.HasValue ? value.Value ? 1 : 0 : -1);
|
||||
Settings.Default.Save();
|
||||
|
@ -470,10 +470,9 @@ public partial class MainWin : Window
|
||||
|
||||
Color? foregroundColor = ForegroundGenerator.GetForeground(newColor.R, newColor.G, newColor.B);
|
||||
|
||||
if (foregroundColor.HasValue)
|
||||
Application.Current.Resources["MaterialDesignBackground"] = new SolidColorBrush(foregroundColor.Value);
|
||||
else
|
||||
Application.Current.Resources.Remove("MaterialDesignBackground");
|
||||
Style newButtonStyle = new(typeof(Button), Application.Current.Resources[typeof(Button)] as Style);
|
||||
newButtonStyle.Setters.Add(new Setter(Button.ForegroundProperty, foregroundColor.HasValue ? new SolidColorBrush(foregroundColor.Value) : new DynamicResourceExtension("MaterialDesignBackground")));
|
||||
Application.Current.Resources[typeof(Button)] = newButtonStyle;
|
||||
|
||||
if (GameFlashInterval > 100)
|
||||
GameFlashInterval += random.Next(1, 4);
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
@ -46,10 +47,9 @@ public partial class SettingsWin : Window
|
||||
|
||||
Color? foregroundColor = ForegroundGenerator.GetForeground(newColor.R, newColor.G, newColor.B);
|
||||
|
||||
if (foregroundColor.HasValue)
|
||||
Application.Current.Resources["MaterialDesignBackground"] = new SolidColorBrush(foregroundColor.Value);
|
||||
else
|
||||
Application.Current.Resources.Remove("MaterialDesignBackground");
|
||||
Style newButtonStyle = new(typeof(Button), Application.Current.Resources[typeof(Button)] as Style);
|
||||
newButtonStyle.Setters.Add(new Setter(Button.ForegroundProperty, foregroundColor.HasValue ? new SolidColorBrush(foregroundColor.Value) : new DynamicResourceExtension("MaterialDesignBackground")));
|
||||
Application.Current.Resources[typeof(Button)] = newButtonStyle;
|
||||
|
||||
Settings.Default.PrimaryColor = System.Drawing.Color.FromArgb(newColor.A, newColor.R, newColor.G, newColor.B);
|
||||
Settings.Default.Save();
|
||||
|
Loading…
Reference in New Issue
Block a user