mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[PTRun]Add setting to disable thumbnails (#24600)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user