Commit 052308a5 authored by Karel Slaný's avatar Karel Slaný

Added AccessibleSwitch component.

parent aea845eb
/*
* 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 switch component.
*/
Switch {
id: root
/* These properties must be set by caller. */
property string accessibleDescription: ""
property string accessibleName: ""
Accessible.role: Accessible.CheckBox
Accessible.checkStateMixed: false
Accessible.checkable: true
Accessible.checked: root.checked
Accessible.description: root.accessibleDescription
Accessible.name: (root.accessibleName !== "") ? root.accessibleName : root.text
Accessible.onToggleAction: {
root.toggle()
}
}
...@@ -331,33 +331,33 @@ Item { ...@@ -331,33 +331,33 @@ Item {
mainPanel.areReguiredFieldsFilled() mainPanel.areReguiredFieldsFilled()
} }
} }
Switch { AccessibleSwitch {
id: dmPublishOwnID id: dmPublishOwnID
text: qsTr("Include sender identification") text: qsTr("Include sender identification")
font.pointSize: defaultTextFont.font.pointSize font.pointSize: defaultTextFont.font.pointSize
checked: true checked: true
} }
Switch { AccessibleSwitch {
id: dmPersonalDelivery id: dmPersonalDelivery
text: qsTr("Personal delivery") text: qsTr("Personal delivery")
font.pointSize: defaultTextFont.font.pointSize font.pointSize: defaultTextFont.font.pointSize
checked: false checked: false
} }
Switch { AccessibleSwitch {
id: dmAllowSubstDelivery id: dmAllowSubstDelivery
visible: false visible: false
text: qsTr("Allow acceptance through fiction") text: qsTr("Allow acceptance through fiction")
font.pointSize: defaultTextFont.font.pointSize font.pointSize: defaultTextFont.font.pointSize
checked: true checked: true
} }
Switch { AccessibleSwitch {
id: dmOVM id: dmOVM
visible: false visible: false
text: qsTr("Send as OVM") text: qsTr("Send as OVM")
font.pointSize: defaultTextFont.font.pointSize font.pointSize: defaultTextFont.font.pointSize
checked: true checked: true
} }
Switch { AccessibleSwitch {
id: initPDZ id: initPDZ
visible: false visible: false
text: qsTr("Pay transfer charges for reply") text: qsTr("Pay transfer charges for reply")
...@@ -367,7 +367,7 @@ Item { ...@@ -367,7 +367,7 @@ Item {
(initPDZ.checked) ? dmType = "I" : dmType = "" (initPDZ.checked) ? dmType = "I" : dmType = ""
} }
} }
Switch { AccessibleSwitch {
id: replyPDZ id: replyPDZ
visible: false visible: false
text: qsTr("Use transfer charges from recipient") text: qsTr("Use transfer charges from recipient")
......
...@@ -289,13 +289,13 @@ Item { ...@@ -289,13 +289,13 @@ Item {
} }
} }
} }
Switch { AccessibleSwitch {
id: rememberPassword id: rememberPassword
text: qsTr("Remember password") text: qsTr("Remember password")
font.pointSize: defaultTextFont.font.pointSize font.pointSize: defaultTextFont.font.pointSize
checked: true checked: true
} }
Switch { AccessibleSwitch {
id: testAccount id: testAccount
text: qsTr("Test account") text: qsTr("Test account")
font.pointSize: defaultTextFont.font.pointSize font.pointSize: defaultTextFont.font.pointSize
...@@ -307,7 +307,7 @@ Item { ...@@ -307,7 +307,7 @@ Item {
text: qsTr("Test accounts are used to access the ISDS testing environment.") text: qsTr("Test accounts are used to access the ISDS testing environment.")
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
Switch { AccessibleSwitch {
id: useLS id: useLS
font.pointSize: defaultTextFont.font.pointSize font.pointSize: defaultTextFont.font.pointSize
text: qsTr("Use local storage (database)") text: qsTr("Use local storage (database)")
......
...@@ -65,7 +65,7 @@ Item { ...@@ -65,7 +65,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.left: parent.left anchors.left: parent.left
spacing: formItemVerticalSpacing spacing: formItemVerticalSpacing
Switch { AccessibleSwitch {
id: downloadOnlyNewMsgs id: downloadOnlyNewMsgs
text: qsTr("Download only newer messages") text: qsTr("Download only newer messages")
font.pointSize: defaultTextFont.font.pointSize font.pointSize: defaultTextFont.font.pointSize
...@@ -81,7 +81,7 @@ Item { ...@@ -81,7 +81,7 @@ Item {
qsTr("All available messages (including those in the data vault) will be downloaded.")) qsTr("All available messages (including those in the data vault) will be downloaded."))
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
Switch { AccessibleSwitch {
id: downloadCompleteMsgs id: downloadCompleteMsgs
text: qsTr("Download complete messages") text: qsTr("Download complete messages")
font.pointSize: defaultTextFont.font.pointSize font.pointSize: defaultTextFont.font.pointSize
......
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
<file>../qml/components/AccessibleImageButton.qml</file> <file>../qml/components/AccessibleImageButton.qml</file>
<file>../qml/components/AccessibleMenu.qml</file> <file>../qml/components/AccessibleMenu.qml</file>
<file>../qml/components/AccessibleOverlaidImageButton.qml</file> <file>../qml/components/AccessibleOverlaidImageButton.qml</file>
<file>../qml/components/AccessibleSwitch.qml</file>
<file>../qml/components/AccessibleText.qml</file> <file>../qml/components/AccessibleText.qml</file>
<file>../qml/components/AccessibleTextButton.qml</file> <file>../qml/components/AccessibleTextButton.qml</file>
<file>../qml/components/DataboxList.qml</file> <file>../qml/components/DataboxList.qml</file>
......
...@@ -127,6 +127,7 @@ const struct QmlTypeEntry qmlComponents[] = { ...@@ -127,6 +127,7 @@ const struct QmlTypeEntry qmlComponents[] = {
{ "AccessibleImageButton", 1, 0 }, { "AccessibleImageButton", 1, 0 },
{ "AccessibleMenu", 1, 0 }, { "AccessibleMenu", 1, 0 },
{ "AccessibleOverlaidImageButton", 1, 0 }, { "AccessibleOverlaidImageButton", 1, 0 },
{ "AccessibleSwitch", 1, 0 },
{ "AccessibleText", 1, 0 }, { "AccessibleText", 1, 0 },
{ "AccessibleTextButton", 1, 0 }, { "AccessibleTextButton", 1, 0 },
{ "DataboxList", 1, 0 }, { "DataboxList", 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