Commit 6b42da7b authored by Joanmarie Diggs's avatar Joanmarie Diggs

Announce "non selected" when focus does not follow selected in a listbox

parent ad93c93e
......@@ -305,8 +305,8 @@ formatting = {
},
pyatspi.ROLE_LIST_ITEM: {
'focused': 'expandableState',
'unfocused': '(labelOrName or (displayedText + allTextSelection)) + checkedStateIfCheckable + pause + expandableState + pause + positionInList + pause + listBoxItemWidgets',
'basicWhereAmI': 'label + roleName + pause + (name or displayedText) + checkedStateIfCheckable + pause + positionInList + pause + expandableState + (nodeLevel or nestingLevel) + pause'
'unfocused': '(labelOrName or (displayedText + allTextSelection)) + checkedStateIfCheckable + pause + unselectedStateIfSelectable + pause + expandableState + pause + positionInList + pause + listBoxItemWidgets',
'basicWhereAmI': 'label + roleName + pause + (name or displayedText) + checkedStateIfCheckable + pause + unselectedStateIfSelectable + pause + positionInList + pause + expandableState + (nodeLevel or nestingLevel) + pause'
},
pyatspi.ROLE_MATH: {
'unfocused': 'math',
......
......@@ -527,6 +527,10 @@ STATE_PRESSED = C_("togglebutton", "pressed")
# Translators: This is a state which applies to a toggle button.
STATE_NOT_PRESSED = C_("togglebutton", "not pressed")
# Translators: This is a state which applies to an item or option
# in a selectable list.
STATE_UNSELECTED_LIST_ITEM = C_("listitem", "not selected")
# Translators: This is a state which applies to a radio button.
STATE_SELECTED_RADIO_BUTTON = C_("radiobutton", "selected")
......
......@@ -1058,6 +1058,28 @@ class SpeechGenerator(generator.Generator):
return result
def _generateUnselectedStateIfSelectable(self, obj, **args):
if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
if args.get('inMouseReview'):
return []
if not obj:
return []
if not (obj.parent and 'Selection' in pyatspi.listInterfaces(obj.parent)):
return []
state = obj.getState()
if state.contains(pyatspi.STATE_SELECTED):
return []
result = [object_properties.STATE_UNSELECTED_LIST_ITEM]
result.extend(self.voice(STATE))
return result
def _generateUnselectedCell(self, obj, **args):
"""Returns an array of strings (and possibly voice and audio
specifications) if this is an icon within an layered pane or a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment