Merge pull request #1283 from nachmore/dev

Force reload theme resources when changing fonts etc in settings
This commit is contained in:
Jeremy Wu 2022-07-28 20:29:35 +10:00 committed by GitHub
commit 85061c4422
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,10 +85,13 @@ namespace Flow.Launcher.Core.Resource
Settings.Theme = theme;
// reload all resources even if the theme itself hasn't changed in order to pickup changes
// to things like fonts
UpdateResourceDictionary(GetResourceDictionary());
//always allow re-loading default theme, in case of failure of switching to a new theme from default theme
if (_oldTheme != theme || theme == defaultTheme)
{
UpdateResourceDictionary(GetResourceDictionary());
_oldTheme = Path.GetFileNameWithoutExtension(_oldResource.Source.AbsolutePath);
}