mirror of
https://github.com/AnnulusGames/Alchemy.git
synced 2025-01-22 00:08:53 -05:00
Add: Support list view label modification
This commit is contained in:
parent
bcaeef5ea9
commit
c1e345b85f
@ -82,6 +82,7 @@ namespace Alchemy.Editor.Elements
|
||||
PropertyField propertyField => propertyField.label,
|
||||
SerializeReferenceField serializeReferenceField => serializeReferenceField.foldout.text,
|
||||
InlineEditorObjectField inlineEditorObjectField => inlineEditorObjectField.Label,
|
||||
PropertyListView propertyListView => propertyListView.Label,
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
@ -101,6 +102,9 @@ namespace Alchemy.Editor.Elements
|
||||
case InlineEditorObjectField inlineEditorObjectField:
|
||||
inlineEditorObjectField.Label = value;
|
||||
break;
|
||||
case PropertyListView propertyListView:
|
||||
propertyListView.Label = value;
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace Alchemy.Editor.Elements
|
||||
var parentObj = property.GetDeclaredObject();
|
||||
var events = property.GetAttribute<OnListViewChangedAttribute>(true);
|
||||
|
||||
var listView = GUIHelper.CreateListViewFromFieldInfo(parentObj, property.GetFieldInfo());
|
||||
listView = GUIHelper.CreateListViewFromFieldInfo(parentObj, property.GetFieldInfo());
|
||||
listView.headerTitle = ObjectNames.NicifyVariableName(property.displayName);
|
||||
listView.bindItem = (element, index) =>
|
||||
{
|
||||
@ -48,5 +48,13 @@ namespace Alchemy.Editor.Elements
|
||||
listView.BindProperty(property);
|
||||
Add(listView);
|
||||
}
|
||||
|
||||
readonly ListView listView;
|
||||
|
||||
public string Label
|
||||
{
|
||||
get => listView.headerTitle;
|
||||
set => listView.headerTitle = value;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user