Commit ff7f0727 authored by Karel Slaný's avatar Karel Slaný

Exposing file dialogue content into accessibility.

parent 6a5a4f0d
...@@ -78,4 +78,5 @@ SpinBox { ...@@ -78,4 +78,5 @@ SpinBox {
Accessible.role: Accessible.SpinBox Accessible.role: Accessible.SpinBox
Accessible.description: "" /* Tell what the item does. */ Accessible.description: "" /* Tell what the item does. */
Accessible.name: textFromValue(value) Accessible.name: textFromValue(value)
/* TODO -- Need to export buttons. */
} }
/* /*
* Copyright (C) 2014-2017 CZ.NIC * Copyright (C) 2014-2018 CZ.NIC
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -132,13 +132,11 @@ Dialog { ...@@ -132,13 +132,11 @@ Dialog {
Button { Button {
id: upButton id: upButton
text: "<" text: "<"
MouseArea { Accessible.name: sqTr("Up") /* Needs to be specified as "<" is not read. */
anchors.fill: parent onClicked: {
onClicked: { /* Navigate to parent folder. */
/* Navigate to parent folder. */ if (folderModel.parentFolder !== "") {
if (folderModel.parentFolder !== "") { folderModel.folder = folderModel.parentFolder
folderModel.folder = folderModel.parentFolder
}
} }
} }
} }
...@@ -207,8 +205,21 @@ Dialog { ...@@ -207,8 +205,21 @@ Dialog {
} }
} }
MouseArea { MouseArea {
anchors.fill: parent function accessibleDescriptionText() {
onClicked: { var aText = "";
if (fileIsDir) {
aText += qsTr("Open directory.");
} else {
if (isSelected(pathListModel, index) >= 0) {
aText += qsTr("File is selected.")
} else {
aText += qsTr("File is not selected.")
}
}
return aText;
}
function handleClick() {
if (fileIsDir) { if (fileIsDir) {
/* Navigate to selected directory. */ /* Navigate to selected directory. */
folderModel.folder = fileURL folderModel.folder = fileURL
...@@ -233,6 +244,18 @@ Dialog { ...@@ -233,6 +244,18 @@ Dialog {
} }
} }
} }
anchors.fill: parent
Accessible.role: Accessible.Button
Accessible.description: accessibleDescriptionText()
Accessible.name: fileName
Accessible.onPressAction: {
handleClick()
}
onClicked: {
handleClick()
}
} }
} }
} // Component } // Component
......
/* /*
* Copyright (C) 2014-2017 CZ.NIC * Copyright (C) 2014-2018 CZ.NIC
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (C) 2014-2017 CZ.NIC * Copyright (C) 2014-2018 CZ.NIC
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
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