[orca] Do not filter out egg-list-box labels based on STATE_SHOWING



commit 5a6ce1444a53dfca59274eab291f29a1588fb60f
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Feb 6 09:42:58 2013 -0500

    Do not filter out egg-list-box labels based on STATE_SHOWING
    
    This addresses the problem of Orca not presenting on-screen labels
    associated with the current item for items which had previously been
    scrolled off screen.

 src/orca/script_utilities.py |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index f6f9349..aff2c56 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -608,7 +608,7 @@ class Utilities:
 
         # egg-list-box, e.g. privacy panel in gnome-control-center
         if not displayedText and role == pyatspi.ROLE_FILLER:
-            labels = self.unrelatedLabels(obj)
+            labels = self.unrelatedLabels(obj, onlyShowing=False)
             displayedText = " ".join(map(self.displayedText, labels))
 
         # [[[WDW - HACK because push buttons can have labels as their
@@ -1540,23 +1540,25 @@ class Utilities:
 
         return rv
 
-    def unrelatedLabels(self, root):
+    def unrelatedLabels(self, root, onlyShowing=True):
         """Returns a list containing all the unrelated (i.e., have no
         relations to anything and are not a fundamental element of a
         more atomic component like a combo box) labels under the given
         root.  Note that the labels must also be showing on the display.
 
         Arguments:
-        - root the Accessible object to traverse
+        - root: the Accessible object to traverse
+        - onlyShowing: if True, only return labels with STATE_SHOWING
 
         Returns a list of unrelated labels under the given root.
         """
 
-        allLabels = self.descendantsWithRole(root, pyatspi.ROLE_LABEL)
+        allLabels = self.descendantsWithRole(root, pyatspi.ROLE_LABEL, onlyShowing)
         try:
             labels = [x for x in allLabels if not x.getRelationSet()]
             labels = [x for x in labels if x.parent and x.name != x.parent.name]
-            labels = [x for x in labels if x.getState().contains(pyatspi.STATE_SHOWING)]
+            if onlyShowing:
+                labels = [x for x in labels if x.getState().contains(pyatspi.STATE_SHOWING)]
         except:
             return []
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]