diff options
author | Jan Arve Saether <jan-arve.saether@theqtcompany.com> | 2014-10-06 10:34:26 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-17 14:36:06 +0200 |
commit | 05c30338078fdc59abe1c9e93139976ef8d27534 (patch) | |
tree | 212c5fb969b4dc1a62188f55b3a8fc45810fe9cb | |
parent | 974880da9e4b19b78fc2c7bef1bd595fab5e79f3 (diff) |
Make one day page accessible.
Change-Id: I85d8aef7c170a898bc0867cfde1564032d8c208e
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
-rw-r--r-- | qml/pages/OneDaySliderItem.qml | 6 | ||||
-rw-r--r-- | qml/pages/OneDayZoomItem.qml | 14 | ||||
-rw-r--r-- | translations/QuickForecast_de.ts | 4 |
3 files changed, 24 insertions, 0 deletions
diff --git a/qml/pages/OneDaySliderItem.qml b/qml/pages/OneDaySliderItem.qml index a7aba48..f277ded 100644 --- a/qml/pages/OneDaySliderItem.qml +++ b/qml/pages/OneDaySliderItem.qml @@ -139,6 +139,7 @@ GridLayout { pixelSize: 24 color: temperature > 0 ? ApplicationInfo.colors.doubleDarkGray : ApplicationInfo.colors.blue anchors.horizontalCenter: parent.horizontalCenter + Accessible.ignored: true } } } @@ -155,6 +156,10 @@ GridLayout { Layout.alignment: Qt.AlignHCenter minimumValue: 0 maximumValue: model.periodCount() - 1 + + // these properties are needed for accessibility, for some reason I cannot put the Math.round expression in the same line + readonly property int sliderValue: Math.round(touchSlider.value) + Accessible.name: qsTr("%1 - %2").arg(Utils.getFromTime(sliderValue, root.model)).arg(Utils.getToTime(sliderValue, root.model)) } RowLayout { id: rowTime @@ -170,6 +175,7 @@ GridLayout { horizontalAlignment: Text.AlignHCenter Layout.alignment: Qt.AlignBaseline text: (!!root.model && index !== root.model.periodCount()) ? Utils.getFromTime(index, root.model) : Utils.getToTime(index-1, root.model) + Accessible.ignored: true } } } diff --git a/qml/pages/OneDayZoomItem.qml b/qml/pages/OneDayZoomItem.qml index 4a7638d..e34873e 100644 --- a/qml/pages/OneDayZoomItem.qml +++ b/qml/pages/OneDayZoomItem.qml @@ -51,6 +51,7 @@ GridLayout { property QtObject slider property QtObject model property bool singleItem + function singleTimeString(ind) { //: The given time interval for the forecast displayed, i.e. (8AM - 2PM) return qsTr("(%1 - %2)").arg(Utils.getFromTime(ind, dayModel)).arg(Utils.getToTime(ind, dayModel)) @@ -71,20 +72,25 @@ GridLayout { font.weight: Font.Bold Layout.alignment: Qt.AlignBaseline font.capitalization: Font.Capitalize + Accessible.name: longDay.text + " " + dateLabel.text + " " + timeLabel.text } TouchLabel { + id: dateLabel text: Utils.getLongDate(root.model.date) pixelSize: 30 Layout.alignment: Qt.AlignBaseline | Qt.AlignLeft color: ApplicationInfo.colors.darkGray + Accessible.ignored: true } TouchLabel { + id: timeLabel text: root.singleTimeString(root.sliderValue) pixelSize: 20 Layout.alignment: Qt.AlignBaseline horizontalAlignment: Text.AlignLeft color: ApplicationInfo.colors.darkGray Layout.columnSpan: 2 + Accessible.ignored: true } Item { Image { @@ -141,6 +147,8 @@ GridLayout { return longestTempWidth } Component.onCompleted: Layout.preferredWidth = getLongestTempWidth() + 4 * ApplicationInfo.ratio + Accessible.name: text + Accessible.description: qsTr("Temperature for this part of the day") } RowLayout { Layout.columnSpan: 2 @@ -149,12 +157,15 @@ GridLayout { text : qsTr("Precipitation: ") + Utils.getRain(root.sliderValue, root.model) Layout.alignment: Qt.AlignLeft | Qt.AlignBaseline pixelSize: 30 + Accessible.name: text + " " + rainUnit.text } TouchLabel { //: The rain level unit, millimeters or inches + id: rainUnit text: Utils.isMetricSystem() ? qsTr("mm") : qsTr("in") pixelSize: 24 Layout.alignment: Qt.AlignBaseline | Qt.AlignLeft + Accessible.ignored: true } } RowLayout { @@ -164,12 +175,15 @@ GridLayout { text : qsTr("Wind: ") + Utils.getWindSpeed(root.sliderValue, root.model) Layout.alignment: Qt.AlignLeft | Qt.AlignBaseline pixelSize: 30 + Accessible.name: text + " " + windUnit.text } TouchLabel { //: The wind speed unit, meters per second or miles per hour + id: windUnit text: Utils.isMetricSystem() ? qsTr("m/s") : qsTr("mph") pixelSize: 24 Layout.alignment: Qt.AlignLeft | Qt.AlignBaseline + Accessible.ignored: true } Image { source: Utils.getWindUrl(root.sliderValue, root.model) diff --git a/translations/QuickForecast_de.ts b/translations/QuickForecast_de.ts index b88aab9..5805c67 100644 --- a/translations/QuickForecast_de.ts +++ b/translations/QuickForecast_de.ts @@ -107,6 +107,10 @@ <source>m/s</source> <translation>m/s</translation> </message> + <message> + <source>Temperature for this part of the day</source> + <translation>Temperatur für diesen Teil des Tages</translation> + </message> </context> <context> <name>WeatherModel</name> |