Fix multiple layout tabs not finding the viewport as active content
This commit is contained in:
parent
0808bd0347
commit
5655b8c3f4
@ -16,6 +16,11 @@ namespace LayoutBXLYT
|
|||||||
|
|
||||||
public List<string> Textures = new List<string>();
|
public List<string> Textures = new List<string>();
|
||||||
|
|
||||||
|
public void UpdateLayout(BxlytHeader heeader)
|
||||||
|
{
|
||||||
|
parentLayout = heeader;
|
||||||
|
}
|
||||||
|
|
||||||
public override void Reset()
|
public override void Reset()
|
||||||
{
|
{
|
||||||
if (parentLayout == null) return;
|
if (parentLayout == null) return;
|
||||||
|
@ -816,6 +816,8 @@ namespace LayoutBXLYT
|
|||||||
{
|
{
|
||||||
if (animation == null)
|
if (animation == null)
|
||||||
animation = new LytAnimation(this, parentLayout);
|
animation = new LytAnimation(this, parentLayout);
|
||||||
|
else
|
||||||
|
animation.UpdateLayout(parentLayout);
|
||||||
return animation;
|
return animation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -455,14 +455,23 @@ namespace LayoutBXLYT
|
|||||||
|
|
||||||
private void dockPanel1_ActiveDocumentChanged(object sender, EventArgs e)
|
private void dockPanel1_ActiveDocumentChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var dockContent = dockPanel1.ActiveDocument as LayoutViewer;
|
var dockContent = dockPanel1.ActiveDocument as DockContent;
|
||||||
if (dockContent != null)
|
if (dockContent == null) return;
|
||||||
{
|
|
||||||
var file = (dockContent).LayoutFile;
|
|
||||||
ReloadEditors(file);
|
|
||||||
ActiveViewport = dockContent;
|
|
||||||
|
|
||||||
dockContent.UpdateViewport();
|
LayoutViewer viewer = null;
|
||||||
|
foreach (var control in dockContent.Controls)
|
||||||
|
if (control is LayoutViewer)
|
||||||
|
viewer = control as LayoutViewer;
|
||||||
|
|
||||||
|
if (viewer != null)
|
||||||
|
{
|
||||||
|
var file = viewer.LayoutFile;
|
||||||
|
ActiveLayout = file;
|
||||||
|
ReloadEditors(file);
|
||||||
|
ActiveViewport = viewer;
|
||||||
|
viewer.UpdateViewport();
|
||||||
|
|
||||||
|
Console.WriteLine("changed " + ActiveLayout.FileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user