Fixed ToolTip in Viewer
authorLaurent Bessard
Thu, 06 Jun 2013 00:16:03 +0200
changeset 1228 b1be490594af
parent 1227 01e86190f8c7
child 1229 137fd7e7b102
Fixed ToolTip in Viewer
editors/Viewer.py
--- a/editors/Viewer.py	Wed Jun 05 23:34:41 2013 +0200
+++ b/editors/Viewer.py	Thu Jun 06 00:16:03 2013 +0200
@@ -1659,9 +1659,9 @@
 
     def OnViewerMouseEvent(self, event):
         self.ResetBuffer()
-        if self.ToolTipElement is not None:
+        if event.Leaving() and self.ToolTipElement is not None:
             self.ToolTipElement.DestroyToolTip()
-        if (not event.Entering() and
+        elif (not event.Entering() and
             gettime() - self.LastToolTipCheckTime > REFRESH_PERIOD):
             self.LastToolTipCheckTime = gettime()
             element = None
@@ -1671,6 +1671,8 @@
                 element = self.FindBlockConnector(pos)
                 if element is None or len(element.GetWires()) > 0:
                     element = self.FindElement(event, True, False)
+            if self.ToolTipElement is not None:
+                self.ToolTipElement.DestroyToolTip()
             self.ToolTipElement = element
             if self.ToolTipElement is not None:
                 tooltip_pos = self.Editor.ClientToScreen(event.GetPosition())