Skip to content

Commit c0134d5

Browse files
committed
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.
1 parent 916b4ff commit c0134d5

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,6 @@ public bool ChangeTheme(string theme = null)
418418
if (string.IsNullOrEmpty(path))
419419
throw new DirectoryNotFoundException($"Theme path can't be found <{path}>");
420420

421-
// Retrieve theme resource – always use the resource with font settings applied.
422-
var resourceDict = GetResourceDictionary(theme);
423-
424-
UpdateResourceDictionary(resourceDict);
425-
426421
_settings.Theme = theme;
427422

428423
// 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)
432427
}
433428

434429
// Check if blur is enabled
435-
BlurEnabled = Win32Helper.IsBackdropSupported() && IsThemeBlurEnabled(resourceDict);
430+
var dict = GetThemeResourceDictionary(theme);
431+
BlurEnabled = Win32Helper.IsBackdropSupported() && IsThemeBlurEnabled(dict);
436432

437433
// Apply blur and drop shadow effect so that we do not need to call it again
438434
_ = RefreshFrameAsync();

0 commit comments

Comments
 (0)