mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
@@ -22,10 +22,12 @@ namespace Wox.Core.Resource
|
|||||||
private const string Folder = "Themes";
|
private const string Folder = "Themes";
|
||||||
private const string Extension = ".xaml";
|
private const string Extension = ".xaml";
|
||||||
private string DirectoryPath => Path.Combine(Constant.ProgramDirectory, Folder);
|
private string DirectoryPath => Path.Combine(Constant.ProgramDirectory, Folder);
|
||||||
|
private string UserDirectoryPath => Path.Combine(Constant.DataDirectory, Folder);
|
||||||
|
|
||||||
public Theme()
|
public Theme()
|
||||||
{
|
{
|
||||||
_themeDirectories.Add(DirectoryPath);
|
_themeDirectories.Add(DirectoryPath);
|
||||||
|
_themeDirectories.Add(UserDirectoryPath);
|
||||||
MakesureThemeDirectoriesExist();
|
MakesureThemeDirectoriesExist();
|
||||||
|
|
||||||
var dicts = Application.Current.Resources.MergedDictionaries;
|
var dicts = Application.Current.Resources.MergedDictionaries;
|
||||||
@@ -94,6 +96,7 @@ namespace Wox.Core.Resource
|
|||||||
if (_oldTheme != theme)
|
if (_oldTheme != theme)
|
||||||
{
|
{
|
||||||
dicts.Remove(_oldResource);
|
dicts.Remove(_oldResource);
|
||||||
|
//fixme if something goes wrong here
|
||||||
var newResource = GetResourceDictionary();
|
var newResource = GetResourceDictionary();
|
||||||
dicts.Add(newResource);
|
dicts.Add(newResource);
|
||||||
_oldResource = newResource;
|
_oldResource = newResource;
|
||||||
|
|||||||
Reference in New Issue
Block a user