diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index 66cc911ee..52267e16c 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -97,6 +97,7 @@ + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 266a0b17e..a9cd2eff0 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -562,13 +562,11 @@ namespace Flow.Launcher if (Preview.Visibility == Visibility.Collapsed) { ResultArea.SetValue(Grid.ColumnSpanProperty, 1); - //HotkeyArea.SetValue(Visibility, Visibility.Collapsed); Preview.Visibility = Visibility.Visible; } else { ResultArea.SetValue(Grid.ColumnSpanProperty, 2); - //HotkeyArea.SetValue(Visibility, Visibility.Visible); Preview.Visibility = Visibility.Collapsed; } } diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 372fb40e5..6feb9d501 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -9,6 +9,8 @@ using Flow.Launcher.Plugin; using System.IO; using System.Drawing.Text; using System.Collections.Generic; +using Microsoft.WindowsAPICodePack.Shell; +using System.Drawing; namespace Flow.Launcher.ViewModel { @@ -186,10 +188,9 @@ namespace Flow.Launcher.ViewModel private async ValueTask LoadPreviewImageAsync() { var imagePath = Result.PreviewImage ?? Result.IcoPath; - - // We need to modify the property not field here to trigger the OnPropertyChanged event - PreviewImage = await Task.Run(() => ImageLoader.Load(imagePath, true)).ConfigureAwait(false); + //PreviewImage = await Task.Run(() => ImageLoader.Load(imagePath, true)).ConfigureAwait(false); + PreviewImage = ShellFile.FromFilePath(imagePath).Thumbnail.LargeBitmapSource; } public Result Result { get; }