summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2014-09-26 13:25:20 +0200
committerJan Arve Sæther <jan-arve.saether@theqtcompany.com>2014-10-08 17:11:29 +0200
commit778a1ea02b02971dea9d2f3bbc04db80704de325 (patch)
tree33a7b6db28c3fba7c04f2a2d422c2afeb2a992c3
parentdbc1b4030623f6fa8e6107264ac90c74b5e5a248 (diff)
Make city search results and list of cities accessible
Change-Id: Ibc9fa8d4bb15019b2a4d5bc9a818b948c412a255 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
-rw-r--r--qml/pages/CitiesPage.qml2
-rw-r--r--qml/touch/ListViewDelegate.qml12
2 files changed, 14 insertions, 0 deletions
diff --git a/qml/pages/CitiesPage.qml b/qml/pages/CitiesPage.qml
index b2c7dfd..07e2feb 100644
--- a/qml/pages/CitiesPage.qml
+++ b/qml/pages/CitiesPage.qml
@@ -72,6 +72,7 @@ BasicPage {
interactive: true
flickableDirection: Flickable.VerticalFlick
model: ApplicationInfo.foundCities
+ Accessible.role: Accessible.List
delegate: ListViewDelegate {
isSearchView: true
onClicked: validateSearchIndex(index)
@@ -86,6 +87,7 @@ BasicPage {
model: availableCities
interactive: true
flickableDirection: Flickable.VerticalFlick
+ Accessible.role: Accessible.List
delegate: ListViewDelegate {
onClicked: page1.processCity(index)
onDeleteCity: availableCities.removeCityModel(index)
diff --git a/qml/touch/ListViewDelegate.qml b/qml/touch/ListViewDelegate.qml
index 8e4ae6b..04cc9e7 100644
--- a/qml/touch/ListViewDelegate.qml
+++ b/qml/touch/ListViewDelegate.qml
@@ -52,6 +52,7 @@ Rectangle {
property bool isSearchView: false
color: mouseNext.pressed ? ApplicationInfo.colors.smokeGray : ApplicationInfo.colors.white
+ Accessible.role: Accessible.ListItem
GridLayout {
id: _grid
@@ -60,12 +61,18 @@ Rectangle {
rowSpacing: 4 * ApplicationInfo.ratio
columnSpacing: 0
columns: 2
+ Accessible.role: Accessible.Button
+ Accessible.name: loader.item.accessibleName
+ function accessiblePressAction() {
+ rect.clicked()
+ }
Rectangle {
Layout.preferredWidth: ApplicationInfo.hMargin
Layout.fillHeight: true
opacity: 0
}
Loader {
+ id: loader
sourceComponent: isSearchView ? searchViewRow : cityViewRow
Layout.fillHeight: true
Layout.fillWidth: true
@@ -94,6 +101,7 @@ Rectangle {
property Component searchViewRow: RowLayout {
spacing: 0
+ property string accessibleName: country
TouchLabel {
color: ApplicationInfo.colors.mediumGray
id: countryLabel
@@ -102,6 +110,7 @@ Rectangle {
Layout.alignment: Qt.AlignBaseline
Layout.fillWidth: true
Layout.maximumWidth: rect.width - 2 * ApplicationInfo.hMargin
+ Accessible.ignored: true
}
Rectangle {
Layout.preferredWidth: ApplicationInfo.hMargin
@@ -112,12 +121,14 @@ Rectangle {
property Component cityViewRow: RowLayout {
spacing: 0
+ property string accessibleName: city.text + " - " + countryLabel.text
TouchLabel {
id: city
text: name
font.weight: Font.DemiBold
Layout.maximumWidth: maximumWidth * 2
Layout.alignment: Qt.AlignBaseline
+ Accessible.ignored: true
}
Item {
implicitWidth: 12 * ApplicationInfo.ratio
@@ -131,6 +142,7 @@ Rectangle {
Layout.alignment: Qt.AlignBaseline | Qt.AlignLeft
Layout.fillWidth: true
Layout.minimumWidth: 0
+ Accessible.ignored: true
}
MouseArea {
id: deleteMouse