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 void UpdateLayout(BxlytHeader heeader)
|
||||
{
|
||||
parentLayout = heeader;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
if (parentLayout == null) return;
|
||||
|
@ -816,6 +816,8 @@ namespace LayoutBXLYT
|
||||
{
|
||||
if (animation == null)
|
||||
animation = new LytAnimation(this, parentLayout);
|
||||
else
|
||||
animation.UpdateLayout(parentLayout);
|
||||
return animation;
|
||||
}
|
||||
}
|
||||
|
@ -455,14 +455,23 @@ namespace LayoutBXLYT
|
||||
|
||||
private void dockPanel1_ActiveDocumentChanged(object sender, EventArgs e)
|
||||
{
|
||||
var dockContent = dockPanel1.ActiveDocument as LayoutViewer;
|
||||
if (dockContent != null)
|
||||
{
|
||||
var file = (dockContent).LayoutFile;
|
||||
ReloadEditors(file);
|
||||
ActiveViewport = dockContent;
|
||||
var dockContent = dockPanel1.ActiveDocument as DockContent;
|
||||
if (dockContent == null) return;
|
||||
|
||||
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