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