From 7cb4faa596ce31f5dbc885e412381a69dd3dcc7e Mon Sep 17 00:00:00 2001 From: Sinai Date: Fri, 16 Apr 2021 23:59:54 +1000 Subject: [PATCH] Adjust panel size/pos --- src/UI/Panels/GameObjectInspector.cs | 14 +++++++------- src/UI/Panels/SceneExplorer.cs | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/UI/Panels/GameObjectInspector.cs b/src/UI/Panels/GameObjectInspector.cs index 9b9cc6a..23e7a2f 100644 --- a/src/UI/Panels/GameObjectInspector.cs +++ b/src/UI/Panels/GameObjectInspector.cs @@ -56,7 +56,7 @@ namespace UnityExplorer.UI.Panels cell.buttonText.text = ToStringUtility.GetDefaultLabel(comp, ReflectionProvider.Instance.GetActualType(comp), true, false); } - public bool ShouldFilter(Component comp, string filter) + public bool ShouldDisplay(Component comp, string filter) { return comp.name.ToLower().Contains(filter); } @@ -96,12 +96,12 @@ namespace UnityExplorer.UI.Panels public override void SetDefaultPosAndAnchors() { mainPanelRect.localPosition = Vector2.zero; - mainPanelRect.anchorMin = new Vector2(0.6f, 0.3f); - mainPanelRect.anchorMax = new Vector2(0.95f, 0.9f); + mainPanelRect.anchorMin = new Vector2(1, 0); + mainPanelRect.anchorMax = new Vector2(1, 1); mainPanelRect.sizeDelta = new Vector2(-300f, mainPanelRect.sizeDelta.y); - mainPanelRect.anchoredPosition = new Vector2(-160, 0); - mainPanelRect.offsetMin = new Vector2(mainPanelRect.offsetMin.x, 10); // bottom - mainPanelRect.offsetMax = new Vector2(mainPanelRect.offsetMax.x, -10); // top + mainPanelRect.anchoredPosition = new Vector2(-200, 0); + mainPanelRect.offsetMin = new Vector2(mainPanelRect.offsetMin.x, 100); // bottom + mainPanelRect.offsetMax = new Vector2(mainPanelRect.offsetMax.x, -50); // top mainPanelRect.pivot = new Vector2(0.5f, 0.5f); } @@ -114,7 +114,7 @@ namespace UnityExplorer.UI.Panels UIFactory.SetLayoutElement(scrollObj, flexibleHeight: 9999); UIFactory.SetLayoutElement(scrollContent, flexibleHeight: 9999); - ComponentList = new SimpleListSource(infiniteScroll, GetEntries, CreateCell, SetCell, ShouldFilter); + ComponentList = new SimpleListSource(infiniteScroll, GetEntries, CreateCell, SetCell, ShouldDisplay); ComponentList.Init(); // Prototype tree cell diff --git a/src/UI/Panels/SceneExplorer.cs b/src/UI/Panels/SceneExplorer.cs index cb6578c..65b594e 100644 --- a/src/UI/Panels/SceneExplorer.cs +++ b/src/UI/Panels/SceneExplorer.cs @@ -165,9 +165,9 @@ namespace UnityExplorer.UI.Panels mainPanelRect.anchorMin = Vector3.zero; mainPanelRect.anchorMax = new Vector2(0, 1); mainPanelRect.sizeDelta = new Vector2(300f, mainPanelRect.sizeDelta.y); - mainPanelRect.anchoredPosition = new Vector2(160, 0); - mainPanelRect.offsetMin = new Vector2(mainPanelRect.offsetMin.x, 10); // bottom - mainPanelRect.offsetMax = new Vector2(mainPanelRect.offsetMax.x, -10); // top + mainPanelRect.anchoredPosition = new Vector2(200, 0); + mainPanelRect.offsetMin = new Vector2(mainPanelRect.offsetMin.x, 100); // bottom + mainPanelRect.offsetMax = new Vector2(mainPanelRect.offsetMax.x, -50); // top mainPanelRect.pivot = new Vector2(0.5f, 0.5f); }