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

Created AccessibleTabButton.

parent 35578ced
/*
* 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 button component.
*/
TabButton {
id: root
/* These properties must be set by caller. */
property string accessibleDescription: ""
property string accessibleName: ""
Accessible.role: Accessible.Button
Accessible.description: root.accessibleDescription
Accessible.name: (root.accessibleName !== "") ? root.accessibleName : root.text
Accessible.onPressAction: {
root.clicked()
}
}
......@@ -255,7 +255,7 @@ Item {
width: parent.width
Repeater {
model: [qsTr("General"), qsTr("Recipients"), qsTr("Attachments"), qsTr("Additional")]
TabButton {
AccessibleTabButton {
text: modelData
width: Math.max(100, tabBar.width / 4)
}
......
......@@ -108,6 +108,7 @@
<file>../qml/components/AccessibleSpinBox.qml</file>
<file>../qml/components/AccessibleSpinBoxZeroMax.qml</file>
<file>../qml/components/AccessibleSwitch.qml</file>
<file>../qml/components/AccessibleTabButton.qml</file>
<file>../qml/components/AccessibleText.qml</file>
<file>../qml/components/AccessibleTextButton.qml</file>
<file>../qml/components/AccessibleTextField.qml</file>
......
......@@ -131,6 +131,7 @@ const struct QmlTypeEntry qmlComponents[] = {
{ "AccessibleSpinBox", 1, 0 },
{ "AccessibleSpinBoxZeroMax", 1, 0 },
{ "AccessibleSwitch", 1, 0 },
{ "AccessibleTabButton", 1, 0 },
{ "AccessibleText", 1, 0 },
{ "AccessibleTextButton", 1, 0 },
{ "AccessibleTextField", 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