forked from Silverfish/proton-bridge
feat(BRIDGE-234): add accessibility name in QML for UI automation.
This commit is contained in:
@ -86,11 +86,13 @@ Item {
|
||||
}
|
||||
}
|
||||
Button {
|
||||
id: signIn
|
||||
Layout.alignment: Qt.AlignTop
|
||||
colorScheme: root.colorScheme
|
||||
secondary: true
|
||||
text: qsTr("Sign in")
|
||||
visible: root.user ? (root.user.state === EUserState.SignedOut) : false
|
||||
Accessible.name: text
|
||||
|
||||
onClicked: {
|
||||
if (user) {
|
||||
@ -99,11 +101,13 @@ Item {
|
||||
}
|
||||
}
|
||||
Button {
|
||||
id: removeAccount
|
||||
Layout.alignment: Qt.AlignTop
|
||||
colorScheme: root.colorScheme
|
||||
icon.source: "/qml/icons/ic-trash.svg"
|
||||
secondary: true
|
||||
visible: root.user ? root.user.state !== EUserState.Locked : false
|
||||
Accessible.name: qsTr("Remove account")
|
||||
|
||||
onClicked: {
|
||||
if (!root.user)
|
||||
@ -118,6 +122,7 @@ Item {
|
||||
height: root._lineThickness
|
||||
}
|
||||
SettingsItem {
|
||||
id: configureEmailClient
|
||||
Layout.fillWidth: true
|
||||
actionText: qsTr("Configure email client")
|
||||
colorScheme: root.colorScheme
|
||||
@ -126,6 +131,7 @@ Item {
|
||||
text: qsTr("Email clients")
|
||||
type: SettingsItem.PrimaryButton
|
||||
visible: _connected && ((!root.user.splitMode) || (root.user.addresses.length === 1))
|
||||
Accessible.name: actionText
|
||||
|
||||
onClicked: {
|
||||
if (!root.user)
|
||||
@ -143,6 +149,7 @@ Item {
|
||||
text: qsTr("Split addresses")
|
||||
type: SettingsItem.Toggle
|
||||
visible: _connected && root.user.addresses.length > 1
|
||||
Accessible.name: text
|
||||
|
||||
onClicked: {
|
||||
if (!splitMode.checked) {
|
||||
|
||||
@ -114,6 +114,7 @@ Item {
|
||||
colorScheme: leftBar.colorScheme
|
||||
horizontalPadding: 0
|
||||
icon.source: "/qml/icons/ic-question-circle.svg"
|
||||
Accessible.name: qsTr("Help")
|
||||
|
||||
onClicked: rightContent.showHelpView()
|
||||
}
|
||||
@ -130,6 +131,7 @@ Item {
|
||||
colorScheme: leftBar.colorScheme
|
||||
horizontalPadding: 0
|
||||
icon.source: "/qml/icons/ic-cog-wheel.svg"
|
||||
Accessible.name: qsTr("Settings")
|
||||
|
||||
onClicked: rightContent.showGeneralSettings()
|
||||
}
|
||||
@ -147,6 +149,7 @@ Item {
|
||||
colorScheme: leftBar.colorScheme
|
||||
horizontalPadding: 0
|
||||
icon.source: "/qml/icons/ic-three-dots-vertical.svg"
|
||||
Accessible.name: "..."
|
||||
|
||||
onClicked: {
|
||||
dotMenu.open();
|
||||
@ -319,6 +322,7 @@ Item {
|
||||
horizontalPadding: 0
|
||||
icon.source: "/qml/icons/ic-plus.svg"
|
||||
width: 36
|
||||
Accessible.name: qsTr("Add account")
|
||||
|
||||
onClicked: {
|
||||
root.showLogin("");
|
||||
|
||||
@ -172,6 +172,8 @@ FocusScope {
|
||||
|
||||
implicitHeight: children[0].implicitHeight
|
||||
implicitWidth: children[0].implicitWidth
|
||||
Accessible.role: Accessible.Grouping
|
||||
Accessible.name: label.text
|
||||
|
||||
onEditingFinished: {
|
||||
if (!validateOnEditingFinished) {
|
||||
@ -274,6 +276,7 @@ FocusScope {
|
||||
selectionColor: control.palette.highlight
|
||||
topPadding: 8
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
Accessible.name: label.text + qsTr(" edit")
|
||||
|
||||
background: Item {
|
||||
implicitHeight: 36
|
||||
@ -349,6 +352,7 @@ FocusScope {
|
||||
icon.color: control.color
|
||||
icon.source: checked ? "../icons/ic-eye-slash.svg" : "../icons/ic-eye.svg"
|
||||
visible: root.echoMode === TextInput.Password
|
||||
Accessible.name: label.text + qsTr(" show check")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,6 +41,8 @@ Item {
|
||||
|
||||
implicitHeight: children[0].implicitHeight + children[0].anchors.topMargin + children[0].anchors.bottomMargin
|
||||
implicitWidth: children[0].implicitWidth + children[0].anchors.leftMargin + children[0].anchors.rightMargin
|
||||
Accessible.name: text
|
||||
Accessible.role: Accessible.Grouping
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
@ -77,6 +79,8 @@ Item {
|
||||
colorScheme: root.colorScheme
|
||||
loading: root.loading
|
||||
visible: root.type === SettingsItem.ActionType.Toggle
|
||||
Accessible.role: Accessible.CheckBox
|
||||
Accessible.name: root.Accessible.name + " toggle"
|
||||
|
||||
onClicked: {
|
||||
if (!root.loading)
|
||||
@ -92,6 +96,8 @@ Item {
|
||||
secondary: root.type !== SettingsItem.PrimaryButton
|
||||
text: root.actionText
|
||||
visible: root.type === SettingsItem.Button || root.type === SettingsItem.PrimaryButton
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: root.Accessible.name + " button"
|
||||
|
||||
onClicked: {
|
||||
if (!root.loading)
|
||||
|
||||
@ -80,6 +80,7 @@ Item {
|
||||
horizontalPadding: 8
|
||||
icon.source: "/qml/icons/ic-arrow-left.svg"
|
||||
secondary: true
|
||||
Accessible.name: qsTr("Back")
|
||||
|
||||
onClicked: root.back()
|
||||
|
||||
|
||||
@ -37,6 +37,8 @@ Rectangle {
|
||||
}
|
||||
height: 68
|
||||
radius: ProtonStyle.banner_radius
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: root.text
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
@ -33,6 +33,7 @@ Button {
|
||||
icon.source: "/qml/icons/ic-question-circle.svg"
|
||||
icon.width: _iconSize
|
||||
verticalPadding: 0
|
||||
Accessible.name: qsTr("Help")
|
||||
|
||||
onClicked: {
|
||||
menu.popup(-menu.width + root.width, -menu.height);
|
||||
|
||||
Reference in New Issue
Block a user