From 5cb263e2778bba9b226007a747c3d98b8aceaf41 Mon Sep 17 00:00:00 2001 From: VladV Date: Sun, 30 Jul 2023 21:23:17 +0400 Subject: [PATCH] BoxGroup spacing improvements --- Editor/Editors/TriEditor.cs | 2 ++ Editor/Elements/TriBoxGroupElement.cs | 1 - Editor/Elements/TriHeaderGroupBaseElement.cs | 2 +- Editor/Elements/TriListElement.cs | 1 - 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Editor/Editors/TriEditor.cs b/Editor/Editors/TriEditor.cs index 5b747a8..50c13a5 100644 --- a/Editor/Editors/TriEditor.cs +++ b/Editor/Editors/TriEditor.cs @@ -112,6 +112,8 @@ namespace TriInspector.Editors inspector.Update(); inspector.RunValidationIfRequired(); + EditorGUIUtility.hierarchyMode = false; + using (TriGuiHelper.PushEditorTarget(serializedObject.targetObject)) { inspector.Draw(); diff --git a/Editor/Elements/TriBoxGroupElement.cs b/Editor/Elements/TriBoxGroupElement.cs index 537352a..9952856 100644 --- a/Editor/Elements/TriBoxGroupElement.cs +++ b/Editor/Elements/TriBoxGroupElement.cs @@ -109,7 +109,6 @@ namespace TriInspector.Elements switch (_props.titleMode) { case TitleMode.Foldout: - headerLabelRect.x += 10; _expanded = EditorGUI.Foldout(headerLabelRect, _expanded, headerContent, true); break; case TitleMode.Toggle: diff --git a/Editor/Elements/TriHeaderGroupBaseElement.cs b/Editor/Elements/TriHeaderGroupBaseElement.cs index bc6ed18..0122b80 100644 --- a/Editor/Elements/TriHeaderGroupBaseElement.cs +++ b/Editor/Elements/TriHeaderGroupBaseElement.cs @@ -12,7 +12,7 @@ namespace TriInspector.Elements private readonly Props _props; private const float InsetTop = 4; private const float InsetBottom = 4; - private const float InsetLeft = 18; + private const float InsetLeft = 4; private const float InsetRight = 4; private readonly List _properties = new List(); diff --git a/Editor/Elements/TriListElement.cs b/Editor/Elements/TriListElement.cs index 16d8c27..ac0a979 100644 --- a/Editor/Elements/TriListElement.cs +++ b/Editor/Elements/TriListElement.cs @@ -303,7 +303,6 @@ namespace TriInspector.Elements } else { - labelRect.x += 10; TriEditorGUI.Foldout(labelRect, _property); }