[orca] Prefer the name of focusable list items over its displayed text



commit d1bb1c01192e7577ed4458b13fb5bc44960c6436
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Nov 19 16:17:05 2015 -0500

    Prefer the name of focusable list items over its displayed text

 src/orca/formatting.py                   |    2 +-
 src/orca/scripts/web/speech_generator.py |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/formatting.py b/src/orca/formatting.py
index c6284a6..d63bcc9 100644
--- a/src/orca/formatting.py
+++ b/src/orca/formatting.py
@@ -225,7 +225,7 @@ formatting = {
             },
         pyatspi.ROLE_LIST_ITEM: {
             'focused': 'expandableState',
-            'unfocused': 'label + displayedText + allTextSelection + pause + expandableState + pause + 
positionInList + pause + listBoxItemWidgets',
+            'unfocused': '(labelOrName or (displayedText + allTextSelection)) + pause + expandableState + 
pause + positionInList + pause + listBoxItemWidgets',
             'basicWhereAmI': 'label + roleName + pause + name + pause + positionInList + pause + 
expandableState + (nodeLevel or nestingLevel) + pause'
             },
         pyatspi.ROLE_MATH: {
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index 14a3b92..77a2f23 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -152,6 +152,12 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
 
         return super()._generateLabelOrName(obj, **args)
 
+    def _generateName(self, obj, **args):
+        if self._script.utilities.isTextBlockElement(obj):
+            return []
+
+        return super()._generateName(obj, **args)
+
     def _generateLabel(self, obj, **args):
         if self._script.utilities.isTextBlockElement(obj):
             return []


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