From 436e11a6a43e11ff6433df83c60289e9f8b20e55 Mon Sep 17 00:00:00 2001 From: pmagnier-slimani Date: Tue, 3 Jun 2025 15:08:42 -0400 Subject: [PATCH] accessibility: fix buttons Fix the frameless, conversations and invitations buttons for accessibility. GitLab: #2049 Change-Id: I82b6722de53c40a260e706a2517aa7cb37dd99a5 --- .../commoncomponents/QWKSystemButtonGroup.qml | 6 ++++++ .../mainview/components/CallButtonDelegate.qml | 17 ++++++++--------- src/app/mainview/components/FilterTabButton.qml | 4 ++++ src/app/net/jami/Constants/JamiStrings.qml | 3 +++ 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/app/commoncomponents/QWKSystemButtonGroup.qml b/src/app/commoncomponents/QWKSystemButtonGroup.qml index ed7716c0..ffdc3266 100644 --- a/src/app/commoncomponents/QWKSystemButtonGroup.qml +++ b/src/app/commoncomponents/QWKSystemButtonGroup.qml @@ -37,12 +37,16 @@ Row { SystemButton { id: minButton + Accessible.name: JamiStrings.minimize + Accessible.role: Accessible.Button source: JamiResources.window_bar_minimize_svg onClicked: appWindow.showMinimized() } SystemButton { id: maxButton + Accessible.name: JamiStrings.maximize + Accessible.role: Accessible.Button source: appWindow.visibility === Window.Maximized ? JamiResources.window_bar_restore_svg : JamiResources.window_bar_maximize_svg @@ -53,6 +57,8 @@ Row { SystemButton { id: closeButton + Accessible.name: JamiStrings.closeApplication + Accessible.role: Accessible.Button source: JamiResources.window_bar_close_svg baseColor: "#e81123" onClicked: appWindow.close() diff --git a/src/app/mainview/components/CallButtonDelegate.qml b/src/app/mainview/components/CallButtonDelegate.qml index a2a8bb54..c5da85ae 100644 --- a/src/app/mainview/components/CallButtonDelegate.qml +++ b/src/app/mainview/components/CallButtonDelegate.qml @@ -44,12 +44,12 @@ ItemDelegate { Accessible.role: Accessible.Button Accessible.name: ItemAction.text Accessible.description: { - if (!ItemAction?.text) return "" + if (!ItemAction?.text) + return ""; if (ItemAction.checkable) { - return JamiStrings.pressToToggle.arg(ItemAction.text) - .arg(ItemAction.checked ? JamiStrings.active : JamiStrings.inactive) + return JamiStrings.pressToToggle.arg(ItemAction.text).arg(ItemAction.checked ? JamiStrings.active : JamiStrings.inactive); } - return JamiStrings.pressToAction.arg(ItemAction.text) + return JamiStrings.pressToAction.arg(ItemAction.text); } Accessible.pressed: pressed Accessible.checkable: ItemAction ? ItemAction.checkable : false @@ -87,7 +87,7 @@ ItemDelegate { return HalfPill.None; } - Behavior on color { + Behavior on color { ColorAnimation { duration: JamiTheme.shortFadeDuration } @@ -104,7 +104,7 @@ ItemDelegate { radius: isLast ? 5 : width / 2 type: isLast ? HalfPill.Right : HalfPill.None - Behavior on color { + Behavior on color { ColorAnimation { duration: JamiTheme.shortFadeDuration } @@ -123,7 +123,7 @@ ItemDelegate { source: ItemAction ? ItemAction.icon.source : "" color: ItemAction ? (ItemAction.enabled ? ItemAction.icon.color : Qt.lighter(ItemAction.icon.color)) : null - SequentialAnimation on opacity { + SequentialAnimation on opacity { loops: Animation.Infinite running: ItemAction !== undefined && ItemAction.blinksWhenChecked !== undefined && ItemAction.blinksWhenChecked && checked onStopped: icon.opacity = 1 @@ -198,7 +198,7 @@ ItemDelegate { radius: 4 } - onActivated: index => menuAction.accept(index); + onActivated: index => menuAction.accept(index) model: visible ? menuAction.listModel : null delegate: ItemDelegate { id: menuItem @@ -323,7 +323,6 @@ ItemDelegate { // it fits within the overlay, with an extra leftward margin of 24 pixels. return diff > 0 ? xValue - diff - 24 : xValue; } - } implicitWidth: contentItem.implicitWidth diff --git a/src/app/mainview/components/FilterTabButton.qml b/src/app/mainview/components/FilterTabButton.qml index c700c7a7..d19fa66b 100644 --- a/src/app/mainview/components/FilterTabButton.qml +++ b/src/app/mainview/components/FilterTabButton.qml @@ -43,6 +43,10 @@ TabButton { hoverEnabled: true onClicked: selected() + Accessible.name: root.labelText + Accessible.role: Accessible.Button + Accessible.description: root.acceleratorSequence + Rectangle { id: contentRect diff --git a/src/app/net/jami/Constants/JamiStrings.qml b/src/app/net/jami/Constants/JamiStrings.qml index aafa98c8..b74c3ff9 100644 --- a/src/app/net/jami/Constants/JamiStrings.qml +++ b/src/app/net/jami/Constants/JamiStrings.qml @@ -940,4 +940,7 @@ Item { property string pressToToggle: qsTr("Press to toggle %1 (%2)") property string active: qsTr("active") property string inactive: qsTr("inactive") + property string minimize: qsTr("Minimize application") + property string maximize: qsTr("Maximize application") + property string closeApplication: qsTr("Close application") }