Merge lp:~stolowski/unity-2d/shell-accessible-names into lp:unity-2d

Proposed by Paweł Stołowski
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1050
Merged at revision: 1051
Proposed branch: lp:~stolowski/unity-2d/shell-accessible-names
Merge into: lp:unity-2d
Diff against target: 66 lines (+20/-4)
3 files modified
libunity-2d-private/src/unity2dapplication.cpp (+6/-3)
shell/Shell.qml (+14/-0)
shell/app/shellmanager.cpp (+0/-1)
To merge this branch: bzr merge lp:~stolowski/unity-2d/shell-accessible-names
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
Review via email: mp+101119@code.launchpad.net

Commit message

[a11y] Report correct names of root shell elements to accessibility stack, instead of just "Shell".

Description of the change

UNBLOCK

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good, works as well :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/src/unity2dapplication.cpp'
2--- libunity-2d-private/src/unity2dapplication.cpp 2012-01-23 10:31:52 +0000
3+++ libunity-2d-private/src/unity2dapplication.cpp 2012-04-06 15:28:20 +0000
4@@ -109,11 +109,14 @@
5 return false;
6 }
7
8-QAccessibleInterface *panelFactory(const QString &classname, QObject *object)
9+QAccessibleInterface *accessibilityFactory(const QString &classname, QObject *object)
10 {
11 QAccessibleInterface *interface = 0;
12
13- if (classname == "Unity2dPanel" && object && object->isWidgetType()) {
14+ if (classname == "ShellDeclarativeView" && object && object->isWidgetType()) {
15+ interface = new QAccessibleWidget(static_cast<QWidget *>(object), QAccessible::Pane);
16+ }
17+ else if (classname == "Unity2dPanel" && object && object->isWidgetType()) {
18 interface = new QAccessibleWidget(static_cast<QWidget *>(object), QAccessible::ToolBar);
19 }
20
21@@ -179,7 +182,7 @@
22 qputenv("GSETTINGS_SCHEMA_DIR", unity2dDirectory().toLocal8Bit() + "/data");
23 }
24
25- QAccessible::installFactory(panelFactory);
26+ QAccessible::installFactory(accessibilityFactory);
27 }
28
29 Unity2dApplication::~Unity2dApplication()
30
31=== modified file 'shell/Shell.qml'
32--- shell/Shell.qml 2012-04-04 08:26:18 +0000
33+++ shell/Shell.qml 2012-04-06 15:28:20 +0000
34@@ -28,6 +28,20 @@
35 property variant dashLoader
36 property variant hudLoader
37
38+ Binding {
39+ target: declarativeView
40+ property: "accessibleName"
41+ value: {
42+ if (shellManager.hudActive) {
43+ return "Hud";
44+ }
45+ if (shellManager.dashActive) {
46+ return "Dash";
47+ }
48+ return "Launcher";
49+ }
50+ }
51+
52 /* Space reserved by strutManager is taken off screen.availableGeometry but
53 we want the shell to take all the available space, including the one we
54 reserved ourselves via strutManager. */
55
56=== modified file 'shell/app/shellmanager.cpp'
57--- shell/app/shellmanager.cpp 2012-04-02 14:42:15 +0000
58+++ shell/app/shellmanager.cpp 2012-04-06 15:28:20 +0000
59@@ -117,7 +117,6 @@
60 {
61 const QStringList arguments = qApp->arguments();
62 ShellDeclarativeView * view = new ShellDeclarativeView(q, m_sourceFileUrl, screen);
63- view->setAccessibleName("Shell");
64 if (arguments.contains("-opengl")) {
65 view->setUseOpenGL(true);
66 }

Subscribers

People subscribed via source and target branches