[GUI] Clean up theme management

This commit is contained in:
Alexey Golub
2020-10-05 17:10:00 +03:00
parent 19f678ca01
commit 239c47c06e
7 changed files with 62 additions and 56 deletions

View File

@@ -1,5 +1,7 @@
using System;
using System.Reflection;
using DiscordChatExporter.Gui.Internal;
using MaterialDesignThemes.Wpf;
namespace DiscordChatExporter.Gui
{
@@ -13,4 +15,31 @@ namespace DiscordChatExporter.Gui
public static string VersionString => Version.ToString(3);
}
public partial class App
{
private static Theme LightTheme { get; } = Theme.Create(
new MaterialDesignLightTheme(),
MediaColor.FromHex("#343838"),
MediaColor.FromHex("#F9A825")
);
private static Theme DarkTheme { get; } = Theme.Create(
new MaterialDesignDarkTheme(),
MediaColor.FromHex("#E8E8E8"),
MediaColor.FromHex("#F9A825")
);
public static void SetLightTheme()
{
var paletteHelper = new PaletteHelper();
paletteHelper.SetTheme(LightTheme);
}
public static void SetDarkTheme()
{
var paletteHelper = new PaletteHelper();
paletteHelper.SetTheme(DarkTheme);
}
}
}