Add WindowsAPICodePack for HighResThumb

This commit is contained in:
DB p 2022-09-16 15:04:18 +09:00
parent 733ebb8ac1
commit ea728ccc7d
3 changed files with 5 additions and 5 deletions

View file

@ -97,6 +97,7 @@
</PackageReference> </PackageReference>
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" /> <PackageReference Include="PropertyChanged.Fody" Version="3.4.0" />
<PackageReference Include="SharpVectors" Version="1.7.6" /> <PackageReference Include="SharpVectors" Version="1.7.6" />
<PackageReference Include="WindowsAPICodePack-Shell" Version="1.1.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -562,13 +562,11 @@ namespace Flow.Launcher
if (Preview.Visibility == Visibility.Collapsed) if (Preview.Visibility == Visibility.Collapsed)
{ {
ResultArea.SetValue(Grid.ColumnSpanProperty, 1); ResultArea.SetValue(Grid.ColumnSpanProperty, 1);
//HotkeyArea.SetValue(Visibility, Visibility.Collapsed);
Preview.Visibility = Visibility.Visible; Preview.Visibility = Visibility.Visible;
} }
else else
{ {
ResultArea.SetValue(Grid.ColumnSpanProperty, 2); ResultArea.SetValue(Grid.ColumnSpanProperty, 2);
//HotkeyArea.SetValue(Visibility, Visibility.Visible);
Preview.Visibility = Visibility.Collapsed; Preview.Visibility = Visibility.Collapsed;
} }
} }

View file

@ -9,6 +9,8 @@ using Flow.Launcher.Plugin;
using System.IO; using System.IO;
using System.Drawing.Text; using System.Drawing.Text;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.WindowsAPICodePack.Shell;
using System.Drawing;
namespace Flow.Launcher.ViewModel namespace Flow.Launcher.ViewModel
{ {
@ -186,10 +188,9 @@ namespace Flow.Launcher.ViewModel
private async ValueTask LoadPreviewImageAsync() private async ValueTask LoadPreviewImageAsync()
{ {
var imagePath = Result.PreviewImage ?? Result.IcoPath; var imagePath = Result.PreviewImage ?? Result.IcoPath;
// We need to modify the property not field here to trigger the OnPropertyChanged event // 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; } public Result Result { get; }