Commit 4b06ecab authored by Karel Slaný's avatar Karel Slaný

Experimenting with AccessibleTextField component.

parent 50fd7f97
......@@ -39,6 +39,7 @@ Switch {
Accessible.checkable: true
Accessible.checked: root.checked
Accessible.description: root.accessibleDescription
//Accessible.focusable: true
Accessible.name: (root.accessibleName !== "") ? root.accessibleName : root.text
Accessible.onPressAction: {
root.toggle()
......
/*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
import QtQuick 2.7
import QtQuick.Controls 2.2
/*
* Accessible text field component.
*/
TextField {
id: root
/* These properties must be set by caller. */
property string accessibleDescription: ""
Accessible.role: Accessible.EditableText
Accessible.description: (root.accessibleDescription !== "") ? root.accessibleDescription : root.placeholderText
Accessible.editable: root.enabled
//Accessible.focusable: true
Accessible.multiLine: false
Accessible.name: root.text
Accessible.passwordEdit: (root.echoMode === TextInput.Password) || (root.echoMode === TextInput.PasswordEchoOnEdit)
Accessible.readOnly: root.readOnly
Accessible.searchEdit: false
Accessible.selectableText: true
}
......@@ -224,7 +224,7 @@ Item {
color: datovkaPalette.text
text: qsTr("Account title")
}
TextField {
AccessibleTextField {
id: accountNameTextField
width: parent.width
height: inputItemHeight
......@@ -246,7 +246,7 @@ Item {
color: datovkaPalette.text
text: qsTr("Username")
}
TextField {
AccessibleTextField {
id: userNameTextField
width: parent.width
height: inputItemHeight
......@@ -269,7 +269,7 @@ Item {
color: datovkaPalette.text
text: qsTr("Password")
}
TextField {
AccessibleTextField {
id: passwordTextField
width: parent.width
height: inputItemHeight
......
......@@ -107,6 +107,7 @@
<file>../qml/components/AccessibleSwitch.qml</file>
<file>../qml/components/AccessibleText.qml</file>
<file>../qml/components/AccessibleTextButton.qml</file>
<file>../qml/components/AccessibleTextField.qml</file>
<file>../qml/components/DataboxList.qml</file>
<file>../qml/components/FilterBar.qml</file>
<file>../qml/components/InputLineMenu.qml</file>
......
......@@ -130,6 +130,7 @@ const struct QmlTypeEntry qmlComponents[] = {
{ "AccessibleSwitch", 1, 0 },
{ "AccessibleText", 1, 0 },
{ "AccessibleTextButton", 1, 0 },
{ "AccessibleTextField", 1, 0 },
{ "DataboxList", 1, 0 },
{ "FilterBar", 1, 0 },
{ "InputLineMenu", 1, 0 },
......
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