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();
}
private void AnimationPanel_Load(object sender, EventArgs e)
{
Viewport viewport = LibraryGUI.Instance.GetActiveViewport();

View file

@ -584,7 +584,7 @@ namespace Toolbox
}
else if (ActiveMdiChild is ImageEditorForm)
{
return ((ImageEditorForm)ActiveMdiChild).GetActiveFile();
return ((ImageEditorForm)ActiveMdiChild).GetActiveFile();
}
else if (ActiveMdiChild is AudioPlayer)
{
@ -715,7 +715,7 @@ namespace Toolbox
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void MainForm_DragEnter(object sender, DragEventArgs e)
@ -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)
{
if (this.ActiveMdiChild == null)
@ -775,6 +783,8 @@ namespace Toolbox
// If no any child form, hide tabControl
else
{
ResetAnimPanel();
// If child form is new and no has tabPage,
// create new tabPage
if (this.ActiveMdiChild.Tag == null)