Skip to content

Commit

Permalink
fix(device:icon): Force max size of 32px instead of what's available …
Browse files Browse the repository at this point in the history
…as large
  • Loading branch information
Belphemur committed Apr 7, 2024
1 parent 886bd81 commit c389f27
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static System.Drawing.Icon ExtractIconFromPath(string path, DataFlow data
var iconInfo = path.Split(',');
var dllPath = iconInfo[0];
var iconIndex = int.Parse(iconInfo[1]);
return System.Drawing.Icon.ExtractIcon(dllPath, iconIndex, !largeIcon);
return System.Drawing.Icon.ExtractIcon(dllPath, iconIndex, largeIcon ? 32 : 16);
}

var key = $"{path}-${largeIcon}";
Expand All @@ -70,9 +70,10 @@ public static System.Drawing.Icon ExtractIconFromPath(string path, DataFlow data
{
throw new ArgumentException("Can't find icon");
}

using var entry = IconCache.CreateEntry(key);
entry.SetValue(icon)
.SetSize(largeIcon? 2 : 1)
.SetSize(largeIcon ? 2 : 1)
.SetSlidingExpiration(TimeSpan.FromMinutes(30))
.SetPriority(largeIcon ? CacheItemPriority.High : CacheItemPriority.Low)
.RegisterPostEvictionCallback((o, value, reason, state) =>
Expand Down

0 comments on commit c389f27

Please sign in to comment.