[PTRun]Add setting to disable thumbnails (#24600)

This commit is contained in:
Jaime Bernardo
2023-03-06 22:57:52 +00:00
committed by GitHub
parent 07029ff4c0
commit 65378200c6
12 changed files with 80 additions and 22 deletions

View File

@@ -10,6 +10,7 @@ using System.Windows.Media;
using PowerLauncher.Helper;
using PowerLauncher.Plugin;
using Wox.Infrastructure.Image;
using Wox.Infrastructure.UserSettings;
using Wox.Plugin;
using Wox.Plugin.Logger;
@@ -23,6 +24,8 @@ namespace PowerLauncher.ViewModel
Hover,
}
private readonly PowerToysRunSettings _settings;
public ObservableCollection<ContextMenuItemViewModel> ContextMenuItems { get; } = new ObservableCollection<ContextMenuItemViewModel>();
public ICommand ActivateContextButtonsHoverCommand { get; }
@@ -65,13 +68,15 @@ namespace PowerLauncher.ViewModel
public const int NoSelectionIndex = -1;
public ResultViewModel(Result result, IMainViewModel mainViewModel)
public ResultViewModel(Result result, IMainViewModel mainViewModel, PowerToysRunSettings settings)
{
if (result != null)
{
Result = result;
}
_settings = settings;
ContextMenuSelectedIndex = NoSelectionIndex;
LoadContextMenu();
@@ -201,7 +206,7 @@ namespace PowerLauncher.ViewModel
}
// will get here either when icoPath has value\icon delegate is null\when had exception in delegate
return ImageLoader.Load(imagePath);
return ImageLoader.Load(imagePath, _settings.GenerateThumbnailsFromFiles);
}
}