mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 23:05:48 +02:00
accessibility: fix buttons
Fix the frameless, conversations and invitations buttons for accessibility. GitLab: #2049 Change-Id: I82b6722de53c40a260e706a2517aa7cb37dd99a5
This commit is contained in:
parent
869aef8929
commit
436e11a6a4
4 changed files with 21 additions and 9 deletions
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -43,6 +43,10 @@ TabButton {
|
|||
hoverEnabled: true
|
||||
onClicked: selected()
|
||||
|
||||
Accessible.name: root.labelText
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.description: root.acceleratorSequence
|
||||
|
||||
Rectangle {
|
||||
id: contentRect
|
||||
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue