Merge branch 'feature/mismatched-icon' into 'release/0.4.1.006'

Fixed: mismatched icons on treeview update

See merge request SympatheticFire/bookmark-manager-r4!3
This commit is contained in:
Ray 2021-10-12 19:08:24 +00:00
commit 1d333057d8
1 changed files with 4 additions and 5 deletions

View File

@ -817,6 +817,10 @@ namespace RyzStudio.Windows.Forms
if (string.IsNullOrWhiteSpace(item.SiteAddress)) return (int)IconSet.Default;
string iconID = item?.ToHash();
if (this.ImageList.Images.ContainsKey(iconID))
{
return this.ImageList.Images.IndexOfKey(iconID);
}
Image image = this.IconDatabase.FindIcon(iconID);
if (image == null)
@ -824,11 +828,6 @@ namespace RyzStudio.Windows.Forms
return (int)IconSet.Default;
}
if (this.ImageList.Images.ContainsKey(iconID))
{
this.ImageList.Images.RemoveByKey(iconID);
}
ThreadControl.Add(this, this.ImageList, iconID, image);
return this.ImageList.Images.IndexOfKey(iconID);