Misc cleanups and adjustments

This commit is contained in:
Sinai
2021-05-16 21:46:38 +10:00
parent ca65affb5c
commit fb6e413153
16 changed files with 68 additions and 55 deletions

View File

@ -31,7 +31,7 @@ namespace UnityExplorer.UI.Widgets.AutoComplete
public static ISuggestionProvider CurrentHandler { get; private set; }
public static ButtonListSource<Suggestion> dataHandler;
public static ButtonListHandler<Suggestion, ButtonCell> dataHandler;
public static ScrollPool<ButtonCell> scrollPool;
private static GameObject navigationTipRow;
@ -299,9 +299,10 @@ namespace UnityExplorer.UI.Widgets.AutoComplete
public override void ConstructPanelContent()
{
dataHandler = new ButtonListSource<Suggestion>(scrollPool, GetEntries, SetCell, ShouldDisplay, OnCellClicked);
dataHandler = new ButtonListHandler<Suggestion, ButtonCell>(scrollPool, GetEntries, SetCell, ShouldDisplay, OnCellClicked);
scrollPool = UIFactory.CreateScrollPool<ButtonCell>(this.content, "AutoCompleter", out GameObject scrollObj, out GameObject scrollContent);
scrollPool = UIFactory.CreateScrollPool<ButtonCell>(this.content, "AutoCompleter", out GameObject scrollObj,
out GameObject scrollContent);
scrollPool.Initialize(dataHandler);
UIFactory.SetLayoutElement(scrollObj, flexibleHeight: 9999);
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(scrollContent, true, false, true, false);

View File

@ -39,9 +39,9 @@ namespace UnityExplorer.UI.Widgets
#endregion
public GameObject CreateContent(GameObject parent)
public virtual GameObject CreateContent(GameObject parent)
{
UIRoot = UIFactory.CreateHorizontalGroup(parent, "ButtonCell", true, true, true, true, 2, default,
UIRoot = UIFactory.CreateHorizontalGroup(parent, "ButtonCell", true, false, true, true, 2, default,
new Color(0.11f, 0.11f, 0.11f), TextAnchor.MiddleCenter);
Rect = UIRoot.GetComponent<RectTransform>();
Rect.anchorMin = new Vector2(0, 1);