1
0
mirror of synced 2025-02-28 15:40:56 +01:00

Prevent animations from playing while switching tabs

This commit is contained in:
KillzXGaming 2019-03-24 13:14:53 -04:00
parent 8a352111de
commit b30072d100
3 changed files with 14 additions and 2 deletions

Binary file not shown.

View File

@ -366,6 +366,8 @@ namespace Switch_Toolbox.Library
Dispose(); Dispose();
} }
private void AnimationPanel_Load(object sender, EventArgs e) private void AnimationPanel_Load(object sender, EventArgs e)
{ {
Viewport viewport = LibraryGUI.Instance.GetActiveViewport(); Viewport viewport = LibraryGUI.Instance.GetActiveViewport();

View File

@ -765,6 +765,14 @@ namespace Toolbox
} }
} }
private void ResetAnimPanel()
{
if (LibraryGUI.Instance.GetAnimationPanel() != null)
{
LibraryGUI.Instance.GetAnimationPanel().CurrentAnimation = null;
}
}
private void MainForm_MdiChildActivate(object sender, EventArgs e) private void MainForm_MdiChildActivate(object sender, EventArgs e)
{ {
if (this.ActiveMdiChild == null) if (this.ActiveMdiChild == null)
@ -775,6 +783,8 @@ namespace Toolbox
// If no any child form, hide tabControl // If no any child form, hide tabControl
else else
{ {
ResetAnimPanel();
// If child form is new and no has tabPage, // If child form is new and no has tabPage,
// create new tabPage // create new tabPage
if (this.ActiveMdiChild.Tag == null) if (this.ActiveMdiChild.Tag == null)