From a2c65cfbff378017dc208ce6dbc71140f36fed4a Mon Sep 17 00:00:00 2001 From: John Lewin Date: Tue, 26 Jun 2018 08:40:28 -0700 Subject: [PATCH] Use theme aware 'rebuilding' icon - Issue MatterHackers/MCCentral#3759 rebuilding icon should be theme aware --- ApplicationView/ThemeConfig.cs | 4 ++++ Library/Widgets/ListView/ListViewItemBase.cs | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ApplicationView/ThemeConfig.cs b/ApplicationView/ThemeConfig.cs index 16a73b843..76172c756 100644 --- a/ApplicationView/ThemeConfig.cs +++ b/ApplicationView/ThemeConfig.cs @@ -174,6 +174,8 @@ namespace MatterHackers.MatterControl public Color AccentMimimalOverlay { get; set; } public BorderDouble SeparatorMargin { get; } + public ImageBuffer GeneratingThumbnailIcon { get; private set; } + public GuiWidget CreateSearchButton() { return new IconButton(AggContext.StaticData.LoadIcon("icon_search_24x24.png", 16, 16, this.InvertIcons), this) @@ -206,6 +208,8 @@ namespace MatterHackers.MatterControl this.Colors = colors; + this.GeneratingThumbnailIcon = AggContext.StaticData.LoadIcon("building_thumbnail_40x40.png", 40, 40, this.InvertIcons); + DefaultThumbView.ThumbColor = new Color(colors.PrimaryTextColor, 30); var commonOptions = new ButtonFactoryOptions(); diff --git a/Library/Widgets/ListView/ListViewItemBase.cs b/Library/Widgets/ListView/ListViewItemBase.cs index 2f0da91e0..598d5eae3 100644 --- a/Library/Widgets/ListView/ListViewItemBase.cs +++ b/Library/Widgets/ListView/ListViewItemBase.cs @@ -44,7 +44,6 @@ namespace MatterHackers.MatterControl.CustomWidgets { private static ImageBuffer defaultFolderIcon = AggContext.StaticData.LoadIcon(Path.Combine("FileDialog", "folder.png")).SetPreMultiply(); private static ImageBuffer defaultItemIcon = AggContext.StaticData.LoadIcon(Path.Combine("FileDialog", "file.png")); - private static ImageBuffer generatingThumbnailIcon = AggContext.StaticData.LoadIcon(Path.Combine("building_thumbnail_40x40.png")); protected ThemeConfig theme; protected ListViewItem listViewItem; @@ -110,7 +109,7 @@ namespace MatterHackers.MatterControl.CustomWidgets else { // Show processing image - this.SetItemThumbnail(generatingThumbnailIcon); + this.SetItemThumbnail(theme.GeneratingThumbnailIcon); // Ask the provider for a content specific thumbnail thumbnail = await contentProvider.GetThumbnail(libraryItem, thumbWidth, thumbHeight); @@ -150,7 +149,7 @@ namespace MatterHackers.MatterControl.CustomWidgets requeueRaytraceOnDraw = false; // Show processing image - this.SetItemThumbnail(generatingThumbnailIcon); + this.SetItemThumbnail(theme.GeneratingThumbnailIcon); // Ask the MeshContentProvider to RayTrace the image var thumbnail = await meshContentProvider.GetThumbnail(listViewItem.Model, thumbWidth, thumbHeight);