diff options
-rw-r--r-- | resources/qml/MessageView.qml | 20 | ||||
-rw-r--r-- | resources/qml/TimelineBubbleMessageStyle.qml | 1 | ||||
-rw-r--r-- | resources/qml/TimelineDefaultMessageStyle.qml | 5 | ||||
-rw-r--r-- | resources/qml/TimelineEvent.qml | 1 |
4 files changed, 24 insertions, 3 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml index 5ad414f7..f253b7a8 100644 --- a/resources/qml/MessageView.qml +++ b/resources/qml/MessageView.qml @@ -84,6 +84,16 @@ Item { messageContextMenu: messageContextMenuC replyContextMenu: replyContextMenuC scrolledToThis: eventId === room.scrollTarget && (y + height > chat.y + chat.contentY && y < chat.y + chat.height + chat.contentY) + data: [ + Connections { + function onMovementEnded() { + if (y + height + 2 * chat.spacing > chat.contentY + chat.height && y < chat.contentY + chat.height) { + room.currentIndex = index; + } + } + target: chat + } + ] } } Component { @@ -94,6 +104,16 @@ Item { messageContextMenu: messageContextMenuC replyContextMenu: replyContextMenuC scrolledToThis: eventId === room.scrollTarget && (y + height > chat.y + chat.contentY && y < chat.y + chat.height + chat.contentY) + data: [ + Connections { + function onMovementEnded() { + if (y + height + 2 * chat.spacing > chat.contentY + chat.height && y < chat.contentY + chat.height) { + room.currentIndex = index; + } + } + target: chat + } + ] } } diff --git a/resources/qml/TimelineBubbleMessageStyle.qml b/resources/qml/TimelineBubbleMessageStyle.qml index 3b0f2d94..dd197264 100644 --- a/resources/qml/TimelineBubbleMessageStyle.qml +++ b/resources/qml/TimelineBubbleMessageStyle.qml @@ -45,7 +45,6 @@ TimelineEvent { property int avatarMargin: (wrapper.isStateEvent || Settings.smallAvatars ? 0 : (Nheko.avatarSize + 8)) // align bubble with section header property alias hovered: messageHover.hovered - property bool scrolledToThis: false mainInset: (threadId ? (4 + Nheko.paddingSmall) : 0) + 4 replyInset: mainInset + 4 + Nheko.paddingSmall diff --git a/resources/qml/TimelineDefaultMessageStyle.qml b/resources/qml/TimelineDefaultMessageStyle.qml index 331a5dfe..16db9964 100644 --- a/resources/qml/TimelineDefaultMessageStyle.qml +++ b/resources/qml/TimelineDefaultMessageStyle.qml @@ -45,7 +45,6 @@ TimelineEvent { property int avatarMargin: (wrapper.isStateEvent || Settings.smallAvatars ? 0 : (Nheko.avatarSize + 8)) // align bubble with section header property alias hovered: messageHover.hovered - property bool scrolledToThis: false mainInset: (threadId ? (4 + Nheko.paddingSmall) : 0) replyInset: mainInset + 4 + Nheko.paddingSmall @@ -127,7 +126,9 @@ TimelineEvent { to: 0 } ScriptAction { - script: wrapper.room.eventShown() + script: { + wrapper.room.eventShown(); + } } } } diff --git a/resources/qml/TimelineEvent.qml b/resources/qml/TimelineEvent.qml index 3cc239c9..ef1a9578 100644 --- a/resources/qml/TimelineEvent.qml +++ b/resources/qml/TimelineEvent.qml @@ -13,6 +13,7 @@ EventDelegateChooser { id: wrapper required property bool isStateEvent + property bool scrolledToThis: false // qmllint disable required EventDelegateChoice { |