From be7617d366a554745842370ecb7c46941da90fe2 Mon Sep 17 00:00:00 2001 From: Torrie Fischer Date: Sat, 15 Jul 2023 17:28:25 +0200 Subject: [PATCH] wip: accessability :D --- src/qml/Component/Timeline/ImageDelegate.qml | 4 ++++ src/qml/Component/Timeline/MessageDelegate.qml | 4 ++++ src/qml/Component/Timeline/TimelineContainer.qml | 6 ++++++ src/qml/Component/TimelineView.qml | 5 +++++ 4 files changed, 19 insertions(+) diff --git a/src/qml/Component/Timeline/ImageDelegate.qml b/src/qml/Component/Timeline/ImageDelegate.qml index 6e88fb5f8..46060cdbc 100644 --- a/src/qml/Component/Timeline/ImageDelegate.qml +++ b/src/qml/Component/Timeline/ImageDelegate.qml @@ -55,7 +55,11 @@ TimelineContainer { onOpenContextMenu: openFileContext(root) + Accessible.name: "Image from " + author.displayName + Accessible.role: Accessible.Graphic + innerObject: AnimatedImage { + Accessible.ignored: true id: img property var imageWidth: { diff --git a/src/qml/Component/Timeline/MessageDelegate.qml b/src/qml/Component/Timeline/MessageDelegate.qml index 4c69f6c4f..27afc2061 100644 --- a/src/qml/Component/Timeline/MessageDelegate.qml +++ b/src/qml/Component/Timeline/MessageDelegate.qml @@ -40,7 +40,11 @@ TimelineContainer { onOpenContextMenu: openMessageContext(label.selectedText) + Accessible.role: Accessible.StaticText + Accessible.name: author.displayName + " " + root.display + innerObject: ColumnLayout { + Accessible.ignored: true Layout.maximumWidth: root.contentMaxWidth RichLabel { id: label diff --git a/src/qml/Component/Timeline/TimelineContainer.qml b/src/qml/Component/Timeline/TimelineContainer.qml index 142ee83bc..88ab6ca82 100644 --- a/src/qml/Component/Timeline/TimelineContainer.qml +++ b/src/qml/Component/Timeline/TimelineContainer.qml @@ -323,6 +323,7 @@ ColumnLayout { ] SectionDelegate { + Accessible.ignored: true id: sectionDelegate Layout.fillWidth: true @@ -331,6 +332,7 @@ ColumnLayout { } QQC2.ItemDelegate { + Accessible.ignored: true id: mainContainer Layout.fillWidth: true @@ -354,6 +356,7 @@ ColumnLayout { } Kirigami.Avatar { + Accessible.ignored: true id: avatar width: visible || Config.showAvatarInTimeline ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.smallSpacing * 2 : 0 height: width @@ -430,6 +433,7 @@ ColumnLayout { ] contentItem: RowLayout { + Accessible.ignored: true Kirigami.Icon { source: "content-loading-symbolic" width: height @@ -561,6 +565,7 @@ ColumnLayout { } ReactionDelegate { + Accessible.ignored: true Layout.maximumWidth: root.width - Kirigami.Units.largeSpacing * 2 Layout.alignment: showUserMessageOnRight ? Qt.AlignRight : Qt.AlignLeft Layout.leftMargin: showUserMessageOnRight ? 0 : bubble.x + bubble.anchors.leftMargin @@ -572,6 +577,7 @@ ColumnLayout { onReactionClicked: (reaction) => currentRoom.toggleReaction(root.eventId, reaction) } AvatarFlow { + Accessible.ignored: true Layout.alignment: Qt.AlignRight Layout.rightMargin: Kirigami.Units.largeSpacing visible: root.showReadMarkers diff --git a/src/qml/Component/TimelineView.qml b/src/qml/Component/TimelineView.qml index fc14982ac..a5c5b9fc6 100644 --- a/src/qml/Component/TimelineView.qml +++ b/src/qml/Component/TimelineView.qml @@ -181,6 +181,8 @@ QQC2.ScrollView { QQC2.RoundButton { id: goReadMarkerFab + Accessible.name: i18n("Jump to first unread message") + anchors.right: parent.right anchors.top: parent.top anchors.topMargin: Kirigami.Units.largeSpacing @@ -202,10 +204,12 @@ QQC2.ScrollView { } QQC2.ToolTip { + Accessible.ignored: true text: i18n("Jump to first unread message") } } QQC2.RoundButton { + Accessible.name: i18n("Jump to latest message") id: goMarkAsReadFab anchors.right: parent.right anchors.bottom: parent.bottom @@ -225,6 +229,7 @@ QQC2.ScrollView { } QQC2.ToolTip { + Accessible.ignored: true text: i18n("Jump to latest message") } }