Skip to content

Commit

Permalink
Address review actions.
Browse files Browse the repository at this point in the history
rename to isChildOfRow
  • Loading branch information
derek riemer committed Apr 13, 2018
1 parent ed8fd53 commit 9d4b98d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions source/appModules/taskmgr.py
Expand Up @@ -8,14 +8,18 @@
from NVDAObjects import NVDAObject
from NVDAObjects.UIA import UIA

def appropriateDescendant(obj):
def isChildOfRow(obj):
"""
calculates obj's ancestors , discovering if this is a child of a row.
If obj is a child of a row, this returns true.
"""
while obj.parent and obj.parent.presentationType != obj.presType_content:
if isinstance(obj.parent, UIA) and obj.parent.UIAElement.CachedAutomationID == u"TmViewRow":
return True
obj = obj.parent
return False

class BrokenUIAChild(NVDAObject):
class BrokenUIAChild(UIA):
#This is A child which is layout, but should be content.
presentationType = NVDAObject.presType_content

Expand All @@ -24,5 +28,5 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList):
if isinstance(obj, UIA) and obj.UIAElement.CachedAutomationID == u"TmRowIcon":
#This is an icon and really is layout. Don't show it.
return
if obj.presentationType == obj.presType_layout and appropriateDescendant(obj):
clsList.insert(0, BrokenUIAChild)
if obj.presentationType == obj.presType_layout and isChildOfRow(obj):
clsList.insert(0, BrokenUIAChild)

0 comments on commit 9d4b98d

Please sign in to comment.