mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-09-29 16:51:09 +13:00
Add setting for theme, they now persistent through instances
This commit is contained in:
parent
4e0e7c1900
commit
bd222a5f17
5 changed files with 23 additions and 2 deletions
|
@ -44,6 +44,9 @@
|
|||
<setting name="LastTab" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="SelectedTheme" serializeAs="String">
|
||||
<value>Light</value>
|
||||
</setting>
|
||||
</ModAssistant.Properties.Settings>
|
||||
<ModAssistant.Settings1>
|
||||
<setting name="InstallFolder" serializeAs="String">
|
||||
|
|
|
@ -71,6 +71,9 @@ namespace ModAssistant
|
|||
Application.Current.Resources.MergedDictionaries.RemoveAt(0);
|
||||
LoadedTheme = theme;
|
||||
Application.Current.Resources.MergedDictionaries.Insert(0, newTheme);
|
||||
Properties.Settings.Default.SelectedTheme = theme;
|
||||
Properties.Settings.Default.Save();
|
||||
MainWindow.Instance.MainText = $"Theme changed to {theme}.";
|
||||
ReloadIcons();
|
||||
}
|
||||
else throw new ArgumentException($"{theme} does not exist.");
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace ModAssistant
|
|||
Themes.LoadThemes();
|
||||
try
|
||||
{
|
||||
Themes.ApplyTheme("Light");
|
||||
Themes.ApplyTheme(Properties.Settings.Default.SelectedTheme);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
|
|
14
ModAssistant/Properties/Settings.Designer.cs
generated
14
ModAssistant/Properties/Settings.Designer.cs
generated
|
@ -12,7 +12,7 @@ namespace ModAssistant.Properties {
|
|||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.1.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.2.0.0")]
|
||||
public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
@ -154,5 +154,17 @@ namespace ModAssistant.Properties {
|
|||
this["LastTab"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Light")]
|
||||
public string SelectedTheme {
|
||||
get {
|
||||
return ((string)(this["SelectedTheme"]));
|
||||
}
|
||||
set {
|
||||
this["SelectedTheme"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,5 +35,8 @@
|
|||
<Setting Name="LastTab" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="SelectedTheme" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">Light</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
Loading…
Reference in a new issue