Skip to content

Commit 95aaa9f

Browse files
Add preview delegate
1 parent 5970b1c commit 95aaa9f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Flow.Launcher.Plugin/Result.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,14 @@ public record PreviewInfo
246246
/// </summary>
247247
public bool IsMedia { get; set; }
248248
public string Description { get; set; }
249+
public IconDelegate PreviewDelegate { get; set; }
249250

250251
public static PreviewInfo Default { get; } = new()
251252
{
252253
PreviewImagePath = null,
253254
Description = null,
254255
IsMedia = false,
256+
PreviewDelegate = null,
255257
};
256258
}
257259
}

Flow.Launcher/ViewModel/ResultViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ private async Task LoadImageAsync()
202202
private async Task LoadPreviewImageAsync()
203203
{
204204
var imagePath = string.IsNullOrEmpty(Result.Preview.PreviewImagePath) ? Result.IcoPath : Result.Preview.PreviewImagePath;
205-
var iconDelegate = Result.Icon;
205+
var iconDelegate = Result.Icon ?? Result.Preview.PreviewDelegate;
206206
if (ImageLoader.CacheContainImage(imagePath, true))
207207
{
208208
previewImage = await LoadImageInternalAsync(imagePath, iconDelegate, true).ConfigureAwait(false);

0 commit comments

Comments
 (0)