Rebuilding parrent collections layout
This commit is contained in:
@@ -229,6 +229,24 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Rebuilds the parent layout if its collection.
|
||||||
|
/// </summary>
|
||||||
|
public void RebuildParentCollection()
|
||||||
|
{
|
||||||
|
if (ParentEditor is DictionaryEditor dictionaryEditor)
|
||||||
|
{
|
||||||
|
dictionaryEditor.RebuildParentCollection();
|
||||||
|
dictionaryEditor.RebuildLayout();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ParentEditor is CollectionEditor collectionEditor)
|
||||||
|
{
|
||||||
|
collectionEditor.RebuildParentCollection();
|
||||||
|
collectionEditor.RebuildLayout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnSizeChanged()
|
private void OnSizeChanged()
|
||||||
{
|
{
|
||||||
if (IsSetBlocked)
|
if (IsSetBlocked)
|
||||||
@@ -312,6 +330,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
if (Count != _elementsCount)
|
if (Count != _elementsCount)
|
||||||
{
|
{
|
||||||
RebuildLayout();
|
RebuildLayout();
|
||||||
|
RebuildParentCollection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using FlaxEditor.CustomEditors.Elements;
|
using FlaxEditor.CustomEditors.Elements;
|
||||||
using FlaxEditor.CustomEditors.GUI;
|
using FlaxEditor.CustomEditors.GUI;
|
||||||
using FlaxEditor.GUI;
|
using FlaxEditor.GUI;
|
||||||
@@ -12,6 +8,10 @@ using FlaxEditor.Scripting;
|
|||||||
using FlaxEngine;
|
using FlaxEngine;
|
||||||
using FlaxEngine.GUI;
|
using FlaxEngine.GUI;
|
||||||
using FlaxEngine.Json;
|
using FlaxEngine.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace FlaxEditor.CustomEditors.Editors
|
namespace FlaxEditor.CustomEditors.Editors
|
||||||
{
|
{
|
||||||
@@ -279,6 +279,24 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Rebuilds the parent layout if its collection.
|
||||||
|
/// </summary>
|
||||||
|
public void RebuildParentCollection()
|
||||||
|
{
|
||||||
|
if (ParentEditor is DictionaryEditor dictionaryEditor)
|
||||||
|
{
|
||||||
|
dictionaryEditor.RebuildParentCollection();
|
||||||
|
dictionaryEditor.RebuildLayout();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ParentEditor is CollectionEditor collectionEditor)
|
||||||
|
{
|
||||||
|
collectionEditor.RebuildParentCollection();
|
||||||
|
collectionEditor.RebuildLayout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnSizeChanged()
|
private void OnSizeChanged()
|
||||||
{
|
{
|
||||||
if (IsSetBlocked)
|
if (IsSetBlocked)
|
||||||
@@ -454,6 +472,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
if (Count != _elementsCount)
|
if (Count != _elementsCount)
|
||||||
{
|
{
|
||||||
RebuildLayout();
|
RebuildLayout();
|
||||||
|
RebuildParentCollection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user