Add property type tooltip to Visject properties

This commit is contained in:
Wojtek Figat
2022-06-13 00:41:06 +02:00
parent a881c90b2e
commit bc65057eb7

View File

@@ -433,10 +433,13 @@ namespace FlaxEditor.Surface
};
if (!p.IsPublic)
propertyLabel.TextColor = propertyLabel.TextColor.RGBMultiplied(0.7f);
var tooltipText = "Type: " + window.VisjectSurface.GetTypeName(p.Type);
var tooltip = (TooltipAttribute)attributes.FirstOrDefault(x => x is TooltipAttribute);
if (tooltip != null)
tooltipText += '\n' + tooltip.Text;
propertyLabel.MouseLeftDoubleClick += (label, location) => StartParameterRenaming(pIndex, label);
propertyLabel.SetupContextMenu += OnPropertyLabelSetupContextMenu;
var property = itemLayout.AddPropertyItem(propertyLabel, tooltip?.Text);
var property = itemLayout.AddPropertyItem(propertyLabel, tooltipText);
property.Object(propertyValue);
}