From 375e200ab535d77a04a6a07f7cf33793653afe98 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Tue, 31 Oct 2017 13:53:27 -0700 Subject: [PATCH] Add base type to Inspector results --- Submodules/agg-sharp | 2 +- Utilities/InspectForm.cs | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 1eac03fda..d61e235bb 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 1eac03fda480f38e14f642a95ac0778831ed0882 +Subproject commit d61e235bb8ab05e9980c0f18c51be28d08d7f45d diff --git a/Utilities/InspectForm.cs b/Utilities/InspectForm.cs index aaa92fa5d..6abf293c5 100644 --- a/Utilities/InspectForm.cs +++ b/Utilities/InspectForm.cs @@ -296,17 +296,11 @@ namespace MatterHackers.MatterControl private string BuildDefaultName(GuiWidget widget) { - string nameToWrite = ""; - if (!string.IsNullOrEmpty(widget.Name)) - { - nameToWrite += $"{widget.GetType().Name} - {widget.Name}"; - } - else - { - nameToWrite += $"{widget.GetType().Name}"; - } + var type = widget.GetType(); + string baseType = type == typeof(GuiWidget) || type.BaseType == typeof(GuiWidget) ? "" : $":{type.BaseType.Name}"; + string controlName = string.IsNullOrEmpty(widget.Name) ? "" : $" - '{widget.Name}'"; - return nameToWrite; + return $"{type.Name}{baseType}{controlName}"; } private string BuildDefaultName(IObject3D item)