Skip to content

Commit b62161a

Browse files
authored
Merge ebd5d46 into 376edfc
2 parents 376edfc + ebd5d46 commit b62161a

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

source/NVDAObjects/UIA/VisualStudio.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
available in Visual Studio and SQL Server Management Studio.
88
"""
99

10-
from . import UIA
10+
from . import UIA, ToolTip
1111
import speech
1212
import braille
1313
import api
14+
import time
1415

1516

1617
class IntelliSenseItem(UIA):
@@ -53,6 +54,22 @@ class IntelliSenseLiveRegion(UIA):
5354
}
5455

5556

57+
class CompletionToolTip(ToolTip):
58+
""" A tool tip for which duplicate open events can be fired.
59+
"""
60+
61+
_lastToolTipOpenedInfo=(None,None) #: Keeps track of the last ToolTipOpened event (text, time)
62+
63+
def event_UIA_toolTipOpened(self):
64+
oldText, oldTime = self._lastToolTipOpenedInfo
65+
newText = self.name
66+
newTime = time.time()
67+
self.__class__._lastToolTipOpenedInfo = (newText, newTime)
68+
if newText == oldText and oldTime is not None and (newTime - oldTime) < 0.2:
69+
return
70+
super().event_UIA_toolTipOpened()
71+
72+
5673
def findExtraOverlayClasses(obj, clsList):
5774
if obj.UIAAutomationId in _INTELLISENSE_LIST_AUTOMATION_IDS:
5875
clsList.insert(0, IntelliSenseList)
@@ -64,3 +81,5 @@ def findExtraOverlayClasses(obj, clsList):
6481
and isinstance(obj.previous.previous, IntelliSenseList)
6582
):
6683
clsList.insert(0, IntelliSenseLiveRegion)
84+
elif obj.UIAAutomationId == "completion tooltip":
85+
clsList.insert(0, CompletionToolTip)

0 commit comments

Comments
 (0)