From 272197788b694890a37a88290e21b4a6d1f5b2ef Mon Sep 17 00:00:00 2001 From: Oren Nachman Date: Tue, 19 Jul 2022 10:48:13 -0700 Subject: [PATCH] Force reload theme resources when changing fonts etc in settings (#625, #637) This will mean that changing some settings will be a bit slower than before, especially when enabling blur which will reload resources twice but this is negligible and only hits in settings. --- Flow.Launcher.Core/Resource/Theme.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Resource/Theme.cs b/Flow.Launcher.Core/Resource/Theme.cs index 6561419a1..4c1a88e23 100644 --- a/Flow.Launcher.Core/Resource/Theme.cs +++ b/Flow.Launcher.Core/Resource/Theme.cs @@ -85,10 +85,13 @@ namespace Flow.Launcher.Core.Resource Settings.Theme = theme; + // #625, #637 - 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); }