mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use loading.png for loading time image placeholder
This commit is contained in:
parent
45335f269f
commit
ca6c6cb62a
5 changed files with 8 additions and 6 deletions
|
|
@ -29,6 +29,7 @@ namespace Flow.Launcher.Infrastructure
|
|||
public static readonly string DefaultIcon = Path.Combine(ImagesDirectory, "app.png");
|
||||
public static readonly string ErrorIcon = Path.Combine(ImagesDirectory, "app_error.png");
|
||||
public static readonly string MissingImgIcon = Path.Combine(ImagesDirectory, "app_missing_img.png");
|
||||
public static readonly string LoadingImgIcon = Path.Combine(ImagesDirectory, "loading.png");
|
||||
|
||||
public static string PythonPath;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
private static readonly ConcurrentDictionary<string, string> GuidToKey = new();
|
||||
private static IImageHashGenerator _hashGenerator;
|
||||
private static readonly bool EnableImageHash = true;
|
||||
public static ImageSource DefaultImage { get; } = new BitmapImage(new Uri(Constant.MissingImgIcon));
|
||||
public static ImageSource MissingImage { get; } = new BitmapImage(new Uri(Constant.MissingImgIcon));
|
||||
public static ImageSource LoadingImage { get; } = new BitmapImage(new Uri(Constant.LoadingImgIcon));
|
||||
public const int SmallIconSize = 32;
|
||||
|
||||
|
||||
|
|
@ -111,7 +112,7 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return new ImageResult(DefaultImage, ImageType.Error);
|
||||
return new ImageResult(MissingImage, ImageType.Error);
|
||||
}
|
||||
|
||||
if (ImageCache.ContainsKey(path, loadFullImage))
|
||||
|
|
|
|||
BIN
Flow.Launcher/Images/loading.png
Normal file
BIN
Flow.Launcher/Images/loading.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 164 B |
|
|
@ -35,7 +35,7 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
get
|
||||
{
|
||||
if (_image == ImageLoader.DefaultImage)
|
||||
if (_image == ImageLoader.MissingImage)
|
||||
LoadIconAsync();
|
||||
|
||||
return _image;
|
||||
|
|
@ -67,7 +67,7 @@ namespace Flow.Launcher.ViewModel
|
|||
? new Control()
|
||||
: settingProvider.CreateSettingPanel()
|
||||
: null;
|
||||
private ImageSource _image = ImageLoader.DefaultImage;
|
||||
private ImageSource _image = ImageLoader.MissingImage;
|
||||
|
||||
public Visibility ActionKeywordsVisibility => PluginPair.Metadata.ActionKeywords.Count == 1 ? Visibility.Visible : Visibility.Collapsed;
|
||||
public string InitilizaTime => PluginPair.Metadata.InitTime + "ms";
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
private volatile bool ImageLoaded;
|
||||
|
||||
private ImageSource image = ImageLoader.DefaultImage;
|
||||
private ImageSource image = ImageLoader.LoadingImage;
|
||||
|
||||
public ImageSource Image
|
||||
{
|
||||
|
|
@ -168,7 +168,7 @@ namespace Flow.Launcher.ViewModel
|
|||
if (ImageLoader.CacheContainImage(imagePath))
|
||||
{
|
||||
// will get here either when icoPath has value\icon delegate is null\when had exception in delegate
|
||||
image = await ImageLoader.LoadAsync(imagePath, loadFullImage);
|
||||
image = await ImageLoader.LoadAsync(imagePath, loadFullImage).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue