From f7d6b1c6a6315a8231b92feeb3b37f234cf8b44d Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 12 Oct 2021 19:20:17 +0100 Subject: [PATCH] Fixed: mismatched icons on treeview update --- Windows/Forms/BookmarkTreeView.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Windows/Forms/BookmarkTreeView.cs b/Windows/Forms/BookmarkTreeView.cs index fd0e9f5..f320eaf 100644 --- a/Windows/Forms/BookmarkTreeView.cs +++ b/Windows/Forms/BookmarkTreeView.cs @@ -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);