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

Exposing file dialogue content into accessibility.

parent 6a5a4f0d
......@@ -78,4 +78,5 @@ SpinBox {
Accessible.role: Accessible.SpinBox
Accessible.description: "" /* Tell what the item does. */
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
* it under the terms of the GNU General Public License as published by
......@@ -132,13 +132,11 @@ Dialog {
Button {
id: upButton
text: "<"
MouseArea {
anchors.fill: parent
onClicked: {
/* Navigate to parent folder. */
if (folderModel.parentFolder !== "") {
folderModel.folder = folderModel.parentFolder
}
Accessible.name: sqTr("Up") /* Needs to be specified as "<" is not read. */
onClicked: {
/* Navigate to parent folder. */
if (folderModel.parentFolder !== "") {
folderModel.folder = folderModel.parentFolder
}
}
}
......@@ -207,8 +205,21 @@ Dialog {
}
}
MouseArea {
anchors.fill: parent
onClicked: {
function accessibleDescriptionText() {
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) {
/* Navigate to selected directory. */
folderModel.folder = fileURL
......@@ -233,6 +244,18 @@ Dialog {
}
}
}
anchors.fill: parent
Accessible.role: Accessible.Button
Accessible.description: accessibleDescriptionText()
Accessible.name: fileName
Accessible.onPressAction: {
handleClick()
}
onClicked: {
handleClick()
}
}
}
} // 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
* 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
* 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