mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
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:
@@ -38,7 +38,7 @@ namespace Wox.Infrastructure.Image
|
|||||||
foreach (var key in _data.Keys)
|
foreach (var key in _data.Keys)
|
||||||
{
|
{
|
||||||
int dictValue;
|
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;
|
ImageSource imgSource;
|
||||||
_data.TryRemove(key, out imgSource);
|
_data.TryRemove(key, out imgSource);
|
||||||
|
|||||||
@@ -39,8 +39,7 @@ namespace Wox.Infrastructure.Image
|
|||||||
_hashGenerator = new ImageHashGenerator();
|
_hashGenerator = new ImageHashGenerator();
|
||||||
ImageCache.SetUsageAsDictionary(_storage.TryLoad(new Dictionary<string, int>()));
|
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, Constant.LightThemedDefaultIcon, Constant.LightThemedErrorIcon })
|
||||||
foreach (var icon in new[] { Constant.DefaultIcon, Constant.ErrorIcon })
|
|
||||||
{
|
{
|
||||||
ImageSource img = new BitmapImage(new Uri(icon));
|
ImageSource img = new BitmapImage(new Uri(icon));
|
||||||
img.Freeze();
|
img.Freeze();
|
||||||
|
|||||||
Reference in New Issue
Block a user