[orca/gnome-42] Announce row and column headers for interactable cell descendants



commit 2dbd4d90f09edcec35ced1f6e3617d7ebb8f5972
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Jun 30 15:28:36 2022 +0200

    Announce row and column headers for interactable cell descendants
    
    This commit causes us to present the row and/or column header when
    the user moves focus to a descendant of a cell in a different row
    and/or column.
    
    See issue #253.

 src/orca/formatting.py                   | 1 +
 src/orca/generator.py                    | 3 ++-
 src/orca/scripts/web/speech_generator.py | 3 ++-
 src/orca/speech_generator.py             | 9 ++++++---
 4 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/orca/formatting.py b/src/orca/formatting.py
index a269e97b9..a2f85de65 100644
--- a/src/orca/formatting.py
+++ b/src/orca/formatting.py
@@ -481,6 +481,7 @@ formatting = {
             'basicWhereAmI': 'labelAndName + pause + table'
             },
         pyatspi.ROLE_TABLE_CELL: {
+            'ancestor': 'newRowHeader + newColumnHeader',
             'focused': '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState) + pause + 
(expandableState and (expandableState + pause + numberOfChildren + pause))',
             'unfocused': 'tableCellRow + pause',
             'basicWhereAmI': 'parentRoleName + pause + columnHeader + pause + rowHeader + pause + roleName + 
pause + cellCheckedState + pause + (realActiveDescendantDisplayedText or imageDescription + image) + pause + 
columnAndRow + pause + expandableState + pause + nodeLevel + pause',
diff --git a/src/orca/generator.py b/src/orca/generator.py
index 63f5e12a8..0395b87ba 100644
--- a/src/orca/generator.py
+++ b/src/orca/generator.py
@@ -238,7 +238,8 @@ class Generator:
             else:
                 firstTimeCalled = False
 
-            msg = '%s GENERATOR: Starting generation for %s' % (self._mode.upper(), obj)
+            msg = '%s GENERATOR: Starting %s generation for %s (%s)' % \
+                (self._mode.upper(), args.get('formatType'), obj, args.get('role'))
             debug.println(debug.LEVEL_INFO, msg, True)
 
             # Reset 'usedDescriptionForName' if a previous generator used it.
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index 4c8b0e745..661cac349 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -833,7 +833,8 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
 
         if not result:
             if self._script.inSayAll(treatInterruptedAsIn=False) \
-               or not _settingsManager.getSetting('speakBlankLines'):
+               or not _settingsManager.getSetting('speakBlankLines') \
+               or args.get('formatType') == 'ancestor':
                 string = ""
             else:
                 string = messages.BLANK
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 9622e131a..8e2fa8d02 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1032,7 +1032,8 @@ class SpeechGenerator(generator.Generator):
         self._restoreRole(oldRole, args)
         if not (result and result[0]) \
            and _settingsManager.getSetting('speakBlankLines') \
-           and not args.get('readingRow', False):
+           and not args.get('readingRow', False) \
+           and args.get('formatType') != 'ancestor':
             result.append(messages.BLANK)
             if result:
                 result.extend(self.voice(DEFAULT, obj=obj, **args))
@@ -1230,7 +1231,8 @@ class SpeechGenerator(generator.Generator):
 
         [text, caretOffset, startOffset] = self._script.getTextLineAtCaret(obj)
         if text == '\n' and _settingsManager.getSetting('speakBlankLines') \
-           and not self._script.inSayAll() and args.get('total', 1) == 1:
+           and not self._script.inSayAll() and args.get('total', 1) == 1 \
+           and args.get('formatType') != 'ancestor':
             result = [messages.BLANK]
             result.extend(self.voice(string=text, obj=obj, **args))
             return result
@@ -1507,7 +1509,8 @@ class SpeechGenerator(generator.Generator):
 
         result.extend(self.voice(DEFAULT, obj=obj, **args))
         if result[0] in ['\n', ''] and _settingsManager.getSetting('speakBlankLines') \
-           and not self._script.inSayAll() and args.get('total', 1) == 1:
+           and not self._script.inSayAll() and args.get('total', 1) == 1 \
+           and args.get('formatType') != 'ancestor':
             result[0] = messages.BLANK
 
         if self._script.utilities.shouldVerbalizeAllPunctuation(obj):


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