From d08e989695cd0ecb9d7755cc353c41e8554e55f4 Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Wed, 6 Sep 2023 17:28:01 +0300 Subject: [PATCH] TimelineView: Improve UX of "jump-to" round buttons They are not meant to be focused or interacted via keyboard. Besides, our default qqc2-desktop-style looks too bright and flashy for no reason. Also set text on the action itself for accessibility reasons, but force display mode at IconOnly. --- src/qml/TimelineView.qml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/qml/TimelineView.qml b/src/qml/TimelineView.qml index 285ba385c..26337479f 100644 --- a/src/qml/TimelineView.qml +++ b/src/qml/TimelineView.qml @@ -134,23 +134,25 @@ QQC2.ScrollView { implicitWidth: Kirigami.Units.gridUnit * 2 implicitHeight: Kirigami.Units.gridUnit * 2 + display: QQC2.AbstractButton.IconOnly + focusPolicy: Qt.NoFocus + z: 2 visible: root.currentRoom && root.currentRoom.hasUnreadMessages && root.currentRoom.readMarkerLoaded action: Kirigami.Action { + icon.name: "go-up" + shortcut: "Shift+PgUp" + text: i18n("Jump to first unread message") + onTriggered: { if (!Kirigami.Settings.isMobile) { root.focusChatBox(); } messageListView.goToEvent(root.currentRoom.readMarkerEventId) } - icon.name: "go-up" - shortcut: "Shift+PgUp" - } - - QQC2.ToolTip { - text: i18n("Jump to first unread message") } } + QQC2.RoundButton { id: goMarkAsReadFab anchors.right: parent.right @@ -160,18 +162,19 @@ QQC2.ScrollView { implicitWidth: Kirigami.Units.gridUnit * 2 implicitHeight: Kirigami.Units.gridUnit * 2 + display: QQC2.AbstractButton.IconOnly + focusPolicy: Qt.NoFocus + z: 2 visible: !messageListView.atYEnd action: Kirigami.Action { + icon.name: "go-down" + text: i18n("Jump to latest message") + onTriggered: { messageListView.goToLastMessage(); root.currentRoom.markAllMessagesAsRead(); } - icon.name: "go-down" - } - - QQC2.ToolTip { - text: i18n("Jump to latest message") } }