From c0134d56921f994f3578edaf03dfc10c9437d47a Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 9 Mar 2026 18:35:35 +0800 Subject: [PATCH] Refactor theme resource dictionary retrieval logic Replaced separate calls to GetResourceDictionary and UpdateResourceDictionary with a single GetThemeResourceDictionary call in Theme.cs. Updated blur enablement check to use the new dictionary variable, simplifying theme resource management. --- Flow.Launcher.Core/Resource/Theme.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher.Core/Resource/Theme.cs b/Flow.Launcher.Core/Resource/Theme.cs index fb463b4d4c0..dd5762a08fe 100644 --- a/Flow.Launcher.Core/Resource/Theme.cs +++ b/Flow.Launcher.Core/Resource/Theme.cs @@ -418,11 +418,6 @@ public bool ChangeTheme(string theme = null) if (string.IsNullOrEmpty(path)) throw new DirectoryNotFoundException($"Theme path can't be found <{path}>"); - // Retrieve theme resource – always use the resource with font settings applied. - var resourceDict = GetResourceDictionary(theme); - - UpdateResourceDictionary(resourceDict); - _settings.Theme = theme; // Always allow re-loading default theme, in case of failure of switching to a new theme from default theme @@ -432,7 +427,8 @@ public bool ChangeTheme(string theme = null) } // Check if blur is enabled - BlurEnabled = Win32Helper.IsBackdropSupported() && IsThemeBlurEnabled(resourceDict); + var dict = GetThemeResourceDictionary(theme); + BlurEnabled = Win32Helper.IsBackdropSupported() && IsThemeBlurEnabled(dict); // Apply blur and drop shadow effect so that we do not need to call it again _ = RefreshFrameAsync();