From 84673f26f344fd6145a6a6529f2b6b94e4c8a32f Mon Sep 17 00:00:00 2001 From: jhdxr Date: Sun, 23 Dec 2018 00:30:31 +0800 Subject: [PATCH] support user defined theme files in %appdata% (close #1267, #662) --- Wox.Core/Resource/Theme.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Wox.Core/Resource/Theme.cs b/Wox.Core/Resource/Theme.cs index 99e5d89e2c..7343a7b908 100644 --- a/Wox.Core/Resource/Theme.cs +++ b/Wox.Core/Resource/Theme.cs @@ -22,10 +22,12 @@ namespace Wox.Core.Resource private const string Folder = "Themes"; private const string Extension = ".xaml"; private string DirectoryPath => Path.Combine(Constant.ProgramDirectory, Folder); + private string UserDirectoryPath => Path.Combine(Constant.DataDirectory, Folder); public Theme() { _themeDirectories.Add(DirectoryPath); + _themeDirectories.Add(UserDirectoryPath); MakesureThemeDirectoriesExist(); var dicts = Application.Current.Resources.MergedDictionaries; @@ -94,6 +96,7 @@ namespace Wox.Core.Resource if (_oldTheme != theme) { dicts.Remove(_oldResource); + //fixme if something goes wrong here var newResource = GetResourceDictionary(); dicts.Add(newResource); _oldResource = newResource;