Add theme aware default icons to usage dictionary (#5223)

* Added theme aware default icons to usage dictionary

* they should not be removed while resizing
This commit is contained in:
Alekhya 2020-07-24 18:23:33 -07:00 committed by GitHub
parent 025f2507f4
commit d7721065dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -38,7 +38,7 @@ namespace Wox.Infrastructure.Image
foreach (var key in _data.Keys)
{
int dictValue;
if (!Usage.TryGetValue(key, out dictValue) && !(key.Equals(Constant.ErrorIcon) || key.Equals(Constant.DefaultIcon)))
if (!Usage.TryGetValue(key, out dictValue) && !(key.Equals(Constant.ErrorIcon) || key.Equals(Constant.DefaultIcon) || key.Equals(Constant.LightThemedErrorIcon) || key.Equals(Constant.LightThemedDefaultIcon)))
{
ImageSource imgSource;
_data.TryRemove(key, out imgSource);

View File

@ -39,8 +39,7 @@ namespace Wox.Infrastructure.Image
_hashGenerator = new ImageHashGenerator();
ImageCache.SetUsageAsDictionary(_storage.TryLoad(new Dictionary<string, int>()));
// Todo : Add error and default icon specific to each theme
foreach (var icon in new[] { Constant.DefaultIcon, Constant.ErrorIcon })
foreach (var icon in new[] { Constant.DefaultIcon, Constant.ErrorIcon, Constant.LightThemedDefaultIcon, Constant.LightThemedErrorIcon })
{
ImageSource img = new BitmapImage(new Uri(icon));
img.Freeze();