Make sure tooltips close when button become disabled

This commit is contained in:
Jaex 2016-10-02 21:58:37 +03:00
parent 0a6cdb3f27
commit d71c2c62e5

View file

@ -34,7 +34,7 @@ namespace ShareX.ScreenCaptureLib
{ {
internal partial class ShapeManager internal partial class ShapeManager
{ {
internal TextAnimation MenuTextAnimation = new TextAnimation(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(0.5)); internal TextAnimation MenuTextAnimation = new TextAnimation(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(0.5));
private Form menuForm; private Form menuForm;
private ToolStripEx tsMain; private ToolStripEx tsMain;
@ -634,6 +634,8 @@ private void CreateMenu()
menuForm.Location = rectActiveScreen.Location; menuForm.Location = rectActiveScreen.Location;
} }
tsMain.MouseLeave += (sender, e) => MenuTextAnimation.Stop();
foreach (ToolStripItem tsi in tsMain.Items.OfType<ToolStripItem>()) foreach (ToolStripItem tsi in tsMain.Items.OfType<ToolStripItem>())
{ {
if (!string.IsNullOrEmpty(tsi.Text)) if (!string.IsNullOrEmpty(tsi.Text))