mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add preview delegate
This commit is contained in:
parent
5970b1c68e
commit
95aaa9f085
2 changed files with 3 additions and 1 deletions
|
|
@ -246,12 +246,14 @@ namespace Flow.Launcher.Plugin
|
|||
/// </summary>
|
||||
public bool IsMedia { get; set; }
|
||||
public string Description { get; set; }
|
||||
public IconDelegate PreviewDelegate { get; set; }
|
||||
|
||||
public static PreviewInfo Default { get; } = new()
|
||||
{
|
||||
PreviewImagePath = null,
|
||||
Description = null,
|
||||
IsMedia = false,
|
||||
PreviewDelegate = null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ namespace Flow.Launcher.ViewModel
|
|||
private async Task LoadPreviewImageAsync()
|
||||
{
|
||||
var imagePath = string.IsNullOrEmpty(Result.Preview.PreviewImagePath) ? Result.IcoPath : Result.Preview.PreviewImagePath;
|
||||
var iconDelegate = Result.Icon;
|
||||
var iconDelegate = Result.Icon ?? Result.Preview.PreviewDelegate;
|
||||
if (ImageLoader.CacheContainImage(imagePath, true))
|
||||
{
|
||||
previewImage = await LoadImageInternalAsync(imagePath, iconDelegate, true).ConfigureAwait(false);
|
||||
|
|
|
|||
Loading…
Reference in a new issue