mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Show tooltip for all ToolStripItems which have text
This commit is contained in:
parent
e9f5ea2694
commit
0a6cdb3f27
1 changed files with 11 additions and 8 deletions
|
@ -634,17 +634,20 @@ private void CreateMenu()
|
|||
menuForm.Location = rectActiveScreen.Location;
|
||||
}
|
||||
|
||||
foreach (ToolStripButton tsb in tsMain.Items.OfType<ToolStripButton>())
|
||||
foreach (ToolStripItem tsi in tsMain.Items.OfType<ToolStripItem>())
|
||||
{
|
||||
tsb.MouseEnter += (sender, e) =>
|
||||
if (!string.IsNullOrEmpty(tsi.Text))
|
||||
{
|
||||
Point pos = CaptureHelpers.ScreenToClient(menuForm.PointToScreen(tsb.Bounds.Location));
|
||||
pos.Y += tsb.Height + 8;
|
||||
MenuTextAnimation.Position = pos;
|
||||
MenuTextAnimation.Start(tsb.ToolTipText);
|
||||
};
|
||||
tsi.MouseEnter += (sender, e) =>
|
||||
{
|
||||
Point pos = CaptureHelpers.ScreenToClient(menuForm.PointToScreen(tsi.Bounds.Location));
|
||||
pos.Y += tsi.Height + 8;
|
||||
MenuTextAnimation.Position = pos;
|
||||
MenuTextAnimation.Start(tsi.Text);
|
||||
};
|
||||
|
||||
tsb.MouseLeave += (sender, e) => MenuTextAnimation.Stop();
|
||||
tsi.MouseLeave += (sender, e) => MenuTextAnimation.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
form.Activate();
|
||||
|
|
Loading…
Reference in a new issue