Skip to content

Commit dd210ad

Browse files
committed
Remove RefreshFrameAsync since ChangeTheme calls this function
1 parent bac14fa commit dd210ad

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ public bool ChangeTheme(string theme = null)
433433

434434
BlurEnabled = IsBlurTheme();
435435

436-
// Can only apply blur but here also apply drop shadow effect to avoid possible drop shadow effect issues
436+
// Apply blur and drop shadow effect so that we do not need to call it again
437437
_ = RefreshFrameAsync();
438438

439439
return true;

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,10 @@ public interface IPublicAPI
367367
/// Set the current theme
368368
/// </summary>
369369
/// <param name="theme"></param>
370-
/// <returns></returns>
371-
public void SetCurrentTheme(ThemeData theme);
370+
/// <returns>
371+
/// True if the theme is set successfully, false otherwise.
372+
/// </returns>
373+
public bool SetCurrentTheme(ThemeData theme);
372374

373375
/// Load image from path. Support local, remote and data:image url.
374376
/// If image path is missing, it will return a missing icon.

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,8 @@ public Task ShowProgressBoxAsync(string caption, Func<Action<double>, Task> repo
377377

378378
public ThemeData GetCurrentTheme() => Theme.GetCurrentTheme();
379379

380-
public void SetCurrentTheme(ThemeData theme)
381-
{
380+
public bool SetCurrentTheme(ThemeData theme) =>
382381
Theme.ChangeTheme(theme.FileNameWithoutExtension);
383-
_ = _theme.RefreshFrameAsync();
384-
}
385382

386383
public ValueTask<ImageSource> LoadImageAsync(string path, bool loadFullImage = false, bool cacheImage = true) =>
387384
ImageLoader.LoadAsync(path, loadFullImage, cacheImage);

0 commit comments

Comments
 (0)