dispose of event subs
This commit is contained in:
@@ -12,7 +12,6 @@ public partial class SharpIdeCodeEdit
|
|||||||
private void CloseSymbolHoverWindow()
|
private void CloseSymbolHoverWindow()
|
||||||
{
|
{
|
||||||
_symbolHoverTimer?.EmitSignal(Timer.SignalName.Timeout);
|
_symbolHoverTimer?.EmitSignal(Timer.SignalName.Timeout);
|
||||||
_symbolHoverTimer = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method is a bit of a disaster - we create an additional invisible Window, so that the tooltip window doesn't disappear while the mouse is over the hovered symbol
|
// This method is a bit of a disaster - we create an additional invisible Window, so that the tooltip window doesn't disappear while the mouse is over the hovered symbol
|
||||||
@@ -82,13 +81,20 @@ public partial class SharpIdeCodeEdit
|
|||||||
{
|
{
|
||||||
tooltipWindow.QueueFree();
|
tooltipWindow.QueueFree();
|
||||||
symbolNameHoverWindow.QueueFree();
|
symbolNameHoverWindow.QueueFree();
|
||||||
|
tooltipWindow.MouseExited -= StartTimer;
|
||||||
|
tooltipWindow.MouseEntered -= StopTimer;
|
||||||
|
symbolNameHoverWindow.MouseExited -= StartTimer;
|
||||||
|
symbolNameHoverWindow.MouseEntered -= StopTimer;
|
||||||
|
_symbolHoverTimer = null;
|
||||||
};
|
};
|
||||||
_symbolHoverTimer = timer;
|
_symbolHoverTimer = timer;
|
||||||
|
|
||||||
tooltipWindow.MouseExited += () => timer.Start();
|
void StartTimer() => timer.Start();
|
||||||
tooltipWindow.MouseEntered += () => timer.Stop();
|
void StopTimer() => timer.Stop();
|
||||||
symbolNameHoverWindow.MouseExited += () => timer.Start();
|
tooltipWindow.MouseExited += StartTimer;
|
||||||
symbolNameHoverWindow.MouseEntered += () => timer.Stop();
|
tooltipWindow.MouseEntered += StopTimer;
|
||||||
|
symbolNameHoverWindow.MouseExited += StartTimer;
|
||||||
|
symbolNameHoverWindow.MouseEntered += StopTimer;
|
||||||
|
|
||||||
var styleBox = new StyleBoxFlat
|
var styleBox = new StyleBoxFlat
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user