mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-06-28 02:50:28 +12:00
Default to Windows' theme
This commit is contained in:
parent
b367c412a0
commit
87f540853c
|
@ -45,7 +45,7 @@
|
|||
<value />
|
||||
</setting>
|
||||
<setting name="SelectedTheme" serializeAs="String">
|
||||
<value>Light</value>
|
||||
<value />
|
||||
</setting>
|
||||
</ModAssistant.Properties.Settings>
|
||||
<ModAssistant.Settings1>
|
||||
|
|
|
@ -60,6 +60,28 @@ namespace ModAssistant
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs once at the start of the program, performs settings checking.
|
||||
/// </summary>
|
||||
/// <param name="savedTheme">Theme name retrieved from the settings file.</param>
|
||||
public static void FirstLoad(string savedTheme)
|
||||
{
|
||||
if (savedTheme == "")
|
||||
{
|
||||
Themes.ApplyWindowsTheme();
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
Themes.ApplyTheme(savedTheme, false);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
Themes.ApplyWindowsTheme();
|
||||
MainWindow.Instance.MainText = "Theme not found, reverting to default theme...";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies a loaded theme to ModAssistant.
|
||||
/// </summary>
|
||||
|
@ -76,7 +98,7 @@ namespace ModAssistant
|
|||
Properties.Settings.Default.Save();
|
||||
if (sendMessage)
|
||||
{
|
||||
MainWindow.Instance.MainText = $"Theme changed to {theme}.";
|
||||
MainWindow.Instance.MainText = $"Theme set to {theme}.";
|
||||
}
|
||||
ReloadIcons();
|
||||
}
|
||||
|
|
|
@ -61,22 +61,7 @@ namespace ModAssistant
|
|||
}
|
||||
|
||||
Themes.LoadThemes();
|
||||
try
|
||||
{
|
||||
if (Properties.Settings.Default.SelectedTheme != null)
|
||||
{
|
||||
Themes.ApplyTheme(Properties.Settings.Default.SelectedTheme, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Themes.ApplyWindowsTheme();
|
||||
}
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
Themes.ApplyTheme("Light", false);
|
||||
MainText = "Theme not found, reverting to Light theme...";
|
||||
}
|
||||
Themes.FirstLoad(Properties.Settings.Default.SelectedTheme);
|
||||
|
||||
List<string> versions;
|
||||
string json = string.Empty;
|
||||
|
|
|
@ -251,9 +251,13 @@ namespace ModAssistant.Pages
|
|||
{
|
||||
if ((sender as ComboBox).SelectedItem == null)
|
||||
{
|
||||
Themes.ApplyTheme("Light");
|
||||
MainWindow.Instance.MainText = "Current theme has been removed, reverting to Light...";
|
||||
}else Themes.ApplyTheme((sender as ComboBox).SelectedItem.ToString());
|
||||
Themes.ApplyWindowsTheme();
|
||||
MainWindow.Instance.MainText = "Current theme has been removed, reverting to default...";
|
||||
}
|
||||
else
|
||||
{
|
||||
Themes.ApplyTheme((sender as ComboBox).SelectedItem.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplicationThemeExportTemplate_Click(object sender, RoutedEventArgs e)
|
||||
|
@ -265,10 +269,12 @@ namespace ModAssistant.Pages
|
|||
{
|
||||
if (Directory.Exists(Themes.ThemeDirectory))
|
||||
{
|
||||
//Code yeeted from ChroMapper
|
||||
string winPath = Themes.ThemeDirectory.Replace("/", "\\").Replace("\\\\", "\\");
|
||||
System.Diagnostics.Process.Start("explorer.exe", winPath);
|
||||
}else MessageBox.Show("Themes folder not found! Try exporting the template...");
|
||||
System.Diagnostics.Process.Start(Themes.ThemeDirectory);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Themes folder not found! Try exporting the template...");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue