Skip to content

Commit ed85bb2

Browse files
authored
Merge pull request #4331 from Flow-Launcher/UpdateResourceDictionary
Refactor theme resource dictionary retrieval logic
2 parents f8cf6b0 + c0134d5 commit ed85bb2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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)