diff --git a/Flow.Launcher.Core/Resource/Theme.cs b/Flow.Launcher.Core/Resource/Theme.cs index d7c619330..59e76e2d2 100644 --- a/Flow.Launcher.Core/Resource/Theme.cs +++ b/Flow.Launcher.Core/Resource/Theme.cs @@ -433,7 +433,7 @@ namespace Flow.Launcher.Core.Resource BlurEnabled = IsBlurTheme(); - // Can only apply blur but here also apply drop shadow effect to avoid possible drop shadow effect issues + // Apply blur and drop shadow effect so that we do not need to call it again _ = RefreshFrameAsync(); return true; diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index 056c4a437..7701fcdd0 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -367,8 +367,10 @@ namespace Flow.Launcher.Plugin /// Set the current theme /// /// - /// - public void SetCurrentTheme(ThemeData theme); + /// + /// True if the theme is set successfully, false otherwise. + /// + public bool SetCurrentTheme(ThemeData theme); /// Load image from path. Support local, remote and data:image url. /// If image path is missing, it will return a missing icon. diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index b19b21db1..8cce460d7 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -377,11 +377,8 @@ namespace Flow.Launcher public ThemeData GetCurrentTheme() => Theme.GetCurrentTheme(); - public void SetCurrentTheme(ThemeData theme) - { + public bool SetCurrentTheme(ThemeData theme) => Theme.ChangeTheme(theme.FileNameWithoutExtension); - _ = _theme.RefreshFrameAsync(); - } public ValueTask LoadImageAsync(string path, bool loadFullImage = false, bool cacheImage = true) => ImageLoader.LoadAsync(path, loadFullImage, cacheImage);