Skip to content

Commit bc7000b

Browse files
author
Antoine Aflalo
committed
Fix Tooltip not showing after opening contextMenu
See #88
1 parent 426e2d4 commit bc7000b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

SoundSwitch/Framework/TooltipInfoManager/TooltipInfoManager.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class TooltipInfoManager
1010
{
1111
private readonly NotifyIcon _icon;
1212
private readonly TooltipInfoFactory _tooltipInfoFactory;
13-
private bool _isBallontipVisible;
13+
public bool IsBallontipVisible { get; set; }
1414

1515
public TooltipInfoManager(NotifyIcon icon)
1616
{
@@ -32,12 +32,12 @@ public ToolTipInfoTypeEnum CurrentTooltipInfo
3232

3333
private void IconOnBalloonTipClosed(object sender, EventArgs eventArgs)
3434
{
35-
_isBallontipVisible = false;
35+
IsBallontipVisible = false;
3636
}
3737

3838
private void IconOnBalloonTipShown(object sender, EventArgs eventArgs)
3939
{
40-
_isBallontipVisible = true;
40+
IsBallontipVisible = true;
4141
}
4242

4343

@@ -46,7 +46,7 @@ private void IconOnBalloonTipShown(object sender, EventArgs eventArgs)
4646
/// </summary>
4747
public void ShowTooltipInfo()
4848
{
49-
if (_isBallontipVisible)
49+
if (IsBallontipVisible)
5050
return;
5151

5252
var tooltipInfo = _tooltipInfoFactory.Get(CurrentTooltipInfo);

SoundSwitch/Util/TrayIcon.cs

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ public TrayIcon()
8686
return;
8787
_tooltipInfoManager.ShowTooltipInfo();
8888
};
89+
_selectionMenu.Closed += (sender, args) => _tooltipInfoManager.IsBallontipVisible = false;
90+
_settingsMenu.Closed += (sender, args) => _tooltipInfoManager.IsBallontipVisible = false;
8991
SetEventHandlers();
9092
}
9193

0 commit comments

Comments
 (0)