[orca] Present the child widget of GtkListBox items
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Present the child widget of GtkListBox items
- Date: Tue, 10 Sep 2013 17:55:36 +0000 (UTC)
commit 2cee9805ee086c4b1156561b766b15cd3e078e0d
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Sep 10 13:54:57 2013 -0400
Present the child widget of GtkListBox items
src/orca/formatting.py | 5 +++--
src/orca/generator.py | 14 ++++++++++++++
2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/formatting.py b/src/orca/formatting.py
index 128331f..1624e51 100644
--- a/src/orca/formatting.py
+++ b/src/orca/formatting.py
@@ -100,7 +100,7 @@ formatting = {
},
'default': {
'focused': '[]',
- 'unfocused': 'labelAndName + allTextSelection + roleName + availability + ' + MNEMONIC + ' +
accelerator',
+ 'unfocused': 'labelAndName + allTextSelection + roleName + availability + ' + MNEMONIC + ' +
accelerator + childWidget',
'basicWhereAmI': 'labelAndName + roleName',
'detailedWhereAmI' : '[]'
},
@@ -464,7 +464,8 @@ formatting = {
#pyatspi.ROLE_PAGE_TAB_LIST: 'default'
pyatspi.ROLE_PANEL: {
'unfocused': '[Component(obj,\
- asString((label or displayedText) + roleName))]'
+ asString((label or displayedText) + roleName))]\
+ + (childWidget and ([Region(" ")] + childWidget))'
},
pyatspi.ROLE_PARAGRAPH: {
'unfocused': BRAILLE_TEXT
diff --git a/src/orca/generator.py b/src/orca/generator.py
index b4433ff..402c7a8 100644
--- a/src/orca/generator.py
+++ b/src/orca/generator.py
@@ -517,6 +517,20 @@ class Generator:
result.append(indicators[0])
return result
+ def _generateChildWidget(self, obj, **args):
+ widgetRoles = [pyatspi.ROLE_CHECK_BOX,
+ pyatspi.ROLE_RADIO_BUTTON,
+ pyatspi.ROLE_TOGGLE_BUTTON]
+ isWidget = lambda x: x and x.getRole() in widgetRoles
+
+ # For GtkListBox, such as those found in the control center
+ if obj.parent and obj.parent.getRole() == pyatspi.ROLE_LIST_BOX:
+ widget = pyatspi.findDescendant(obj, isWidget)
+ if widget:
+ return self.generate(widget, includeContext=False)
+
+ return []
+
def _generateToggleState(self, obj, **args):
"""Returns an array of strings for use by speech and braille that
represent the checked state of the object. This is typically
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]