From 9cdbb3ada1d7c13c4799c37925a6f4511c8f3a75 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sat, 26 Nov 2022 14:51:11 +0800 Subject: [PATCH] fix uwp preview image --- Flow.Launcher/ViewModel/ResultViewModel.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 9e2774951..d58ecdfc3 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -33,7 +33,6 @@ namespace Flow.Launcher.ViewModel { PreviewExtension = PreviewExtension.ToLowerInvariant(); } - else if () if (Result.Glyph is { FontFamily: not null } glyph) { @@ -222,7 +221,16 @@ namespace Flow.Launcher.ViewModel private async Task LoadPreviewImageAsync() { var imagePath = Result.PreviewImage ?? Result.IcoPath; - PreviewImage = await ImageLoader.LoadAsync(imagePath, true).ConfigureAwait(false); + if (imagePath == null && Result.Icon != null) + { + // For UWP programs from program plugin + // TODO: Consider https://github.com/Flow-Launcher/Flow.Launcher/pull/1492#issuecomment-1304829947 + PreviewImage = Result.Icon(); + } + else + { + PreviewImage = await ImageLoader.LoadAsync(imagePath, true).ConfigureAwait(false); + } } public Result Result { get; }