From 98ab46aad0d9a8dfd79501a78dd9532a5e02ebed Mon Sep 17 00:00:00 2001 From: uurha Date: Sun, 11 Aug 2024 04:11:41 +0000 Subject: [PATCH] Merge pull request #44 from techno-dwarf-works/feature/refactoring Version 0.0.41 --- Editor/Drawers/BasePropertyDrawer.cs | 5 +++-- Editor/Drawers/Container/ElementsContainer.cs | 16 ++++++++++++---- Editor/Helpers/LabelContainer.cs | 13 ++++++++++++- package.json | 2 +- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Editor/Drawers/BasePropertyDrawer.cs b/Editor/Drawers/BasePropertyDrawer.cs index e2caad6..0edc0ea 100644 --- a/Editor/Drawers/BasePropertyDrawer.cs +++ b/Editor/Drawers/BasePropertyDrawer.cs @@ -80,9 +80,10 @@ public sealed override VisualElement CreatePropertyGUI(SerializedProperty proper TypeHandlersBinder = HandlerBinderRegistry.GetMap(); PopulateContainer(container); - container.Use(); - + + var subState = StyleDefinition.CombineSubState(typeof(TAttribute).Name, GetType().Name); + container.RootElement.AddToClassList(subState); return container.RootElement; } diff --git a/Editor/Drawers/Container/ElementsContainer.cs b/Editor/Drawers/Container/ElementsContainer.cs index cdcac6f..07be352 100644 --- a/Editor/Drawers/Container/ElementsContainer.cs +++ b/Editor/Drawers/Container/ElementsContainer.cs @@ -113,19 +113,27 @@ private void ScheduleUpdateGeometry(GeometryChangedEvent changedEvent) { if (changedEvent.target is not PropertyField element) return; - element.schedule.Execute(OnGeometryChanged); + element.schedule.Execute(() => OnGeometryChanged(element)); } - private void OnGeometryChanged() + private void OnGeometryChanged(VisualElement element) { - var label = RootElement.Query