mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use api functions in plugin projects
This commit is contained in:
parent
f76110856f
commit
4572068e76
2 changed files with 5 additions and 7 deletions
|
|
@ -7,7 +7,6 @@ using System.Windows;
|
|||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Flow.Launcher.Infrastructure.Image;
|
||||
using Flow.Launcher.Plugin.Explorer.Search;
|
||||
|
||||
namespace Flow.Launcher.Plugin.Explorer.Views;
|
||||
|
|
@ -89,7 +88,7 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged
|
|||
|
||||
private async Task LoadImageAsync()
|
||||
{
|
||||
PreviewImage = await ImageLoader.LoadAsync(FilePath, true).ConfigureAwait(false);
|
||||
PreviewImage = await Main.Context.API.LoadImageAsync(FilePath, true).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using Flow.Launcher.Infrastructure.Image;
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
#pragma warning disable IDE0005
|
||||
|
|
@ -41,8 +40,8 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
#if DEBUG
|
||||
throw;
|
||||
#else
|
||||
Main._context.API.ShowMsgBox(string.Format("Copying the selected image file to {0} has failed, changes will now be reverted", destinationFileNameFullPath));
|
||||
UpdateIconAttributes(selectedSearchSource, fullPathToOriginalImage);
|
||||
Main._context.API.ShowMsgBox(string.Format("Copying the selected image file to {0} has failed, changes will now be reverted", destinationFileNameFullPath));
|
||||
UpdateIconAttributes(selectedSearchSource, fullPathToOriginalImage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -61,7 +60,7 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
|
||||
internal async ValueTask<ImageSource> LoadPreviewIconAsync(string pathToPreviewIconImage)
|
||||
{
|
||||
return await ImageLoader.LoadAsync(pathToPreviewIconImage);
|
||||
return await Main._context.API.LoadImageAsync(pathToPreviewIconImage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue