Remove RefreshFrameAsync since ChangeTheme calls this function

This commit is contained in:
Jack251970 2025-04-08 16:41:06 +08:00
parent bac14fa7ff
commit dd210ad419
3 changed files with 6 additions and 7 deletions

View file

@ -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;

View file

@ -367,8 +367,10 @@ namespace Flow.Launcher.Plugin
/// Set the current theme
/// </summary>
/// <param name="theme"></param>
/// <returns></returns>
public void SetCurrentTheme(ThemeData theme);
/// <returns>
/// True if the theme is set successfully, false otherwise.
/// </returns>
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.

View file

@ -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<ImageSource> LoadImageAsync(string path, bool loadFullImage = false, bool cacheImage = true) =>
ImageLoader.LoadAsync(path, loadFullImage, cacheImage);