Fixed: mismatched icons on treeview update
This commit is contained in:
parent
60f199b0f2
commit
f7d6b1c6a6
@ -817,6 +817,10 @@ namespace RyzStudio.Windows.Forms
|
|||||||
if (string.IsNullOrWhiteSpace(item.SiteAddress)) return (int)IconSet.Default;
|
if (string.IsNullOrWhiteSpace(item.SiteAddress)) return (int)IconSet.Default;
|
||||||
|
|
||||||
string iconID = item?.ToHash();
|
string iconID = item?.ToHash();
|
||||||
|
if (this.ImageList.Images.ContainsKey(iconID))
|
||||||
|
{
|
||||||
|
return this.ImageList.Images.IndexOfKey(iconID);
|
||||||
|
}
|
||||||
|
|
||||||
Image image = this.IconDatabase.FindIcon(iconID);
|
Image image = this.IconDatabase.FindIcon(iconID);
|
||||||
if (image == null)
|
if (image == null)
|
||||||
@ -824,11 +828,6 @@ namespace RyzStudio.Windows.Forms
|
|||||||
return (int)IconSet.Default;
|
return (int)IconSet.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.ImageList.Images.ContainsKey(iconID))
|
|
||||||
{
|
|
||||||
this.ImageList.Images.RemoveByKey(iconID);
|
|
||||||
}
|
|
||||||
|
|
||||||
ThreadControl.Add(this, this.ImageList, iconID, image);
|
ThreadControl.Add(this, this.ImageList, iconID, image);
|
||||||
|
|
||||||
return this.ImageList.Images.IndexOfKey(iconID);
|
return this.ImageList.Images.IndexOfKey(iconID);
|
||||||
|
Loading…
Reference in New Issue
Block a user