mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-24 03:58:49 +03:00
fix marking messages as read by scrolling
This commit is contained in:
parent
3ad0f15f6d
commit
643be19b64
4 changed files with 24 additions and 3 deletions
|
@ -84,6 +84,16 @@ Item {
|
||||||
messageContextMenu: messageContextMenuC
|
messageContextMenu: messageContextMenuC
|
||||||
replyContextMenu: replyContextMenuC
|
replyContextMenu: replyContextMenuC
|
||||||
scrolledToThis: eventId === room.scrollTarget && (y + height > chat.y + chat.contentY && y < chat.y + chat.height + chat.contentY)
|
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 {
|
Component {
|
||||||
|
@ -94,6 +104,16 @@ Item {
|
||||||
messageContextMenu: messageContextMenuC
|
messageContextMenu: messageContextMenuC
|
||||||
replyContextMenu: replyContextMenuC
|
replyContextMenu: replyContextMenuC
|
||||||
scrolledToThis: eventId === room.scrollTarget && (y + height > chat.y + chat.contentY && y < chat.y + chat.height + chat.contentY)
|
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
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ TimelineEvent {
|
||||||
property int avatarMargin: (wrapper.isStateEvent || Settings.smallAvatars ? 0 : (Nheko.avatarSize + 8)) // align bubble with section header
|
property int avatarMargin: (wrapper.isStateEvent || Settings.smallAvatars ? 0 : (Nheko.avatarSize + 8)) // align bubble with section header
|
||||||
|
|
||||||
property alias hovered: messageHover.hovered
|
property alias hovered: messageHover.hovered
|
||||||
property bool scrolledToThis: false
|
|
||||||
|
|
||||||
mainInset: (threadId ? (4 + Nheko.paddingSmall) : 0) + 4
|
mainInset: (threadId ? (4 + Nheko.paddingSmall) : 0) + 4
|
||||||
replyInset: mainInset + 4 + Nheko.paddingSmall
|
replyInset: mainInset + 4 + Nheko.paddingSmall
|
||||||
|
|
|
@ -45,7 +45,6 @@ TimelineEvent {
|
||||||
property int avatarMargin: (wrapper.isStateEvent || Settings.smallAvatars ? 0 : (Nheko.avatarSize + 8)) // align bubble with section header
|
property int avatarMargin: (wrapper.isStateEvent || Settings.smallAvatars ? 0 : (Nheko.avatarSize + 8)) // align bubble with section header
|
||||||
|
|
||||||
property alias hovered: messageHover.hovered
|
property alias hovered: messageHover.hovered
|
||||||
property bool scrolledToThis: false
|
|
||||||
|
|
||||||
mainInset: (threadId ? (4 + Nheko.paddingSmall) : 0)
|
mainInset: (threadId ? (4 + Nheko.paddingSmall) : 0)
|
||||||
replyInset: mainInset + 4 + Nheko.paddingSmall
|
replyInset: mainInset + 4 + Nheko.paddingSmall
|
||||||
|
@ -127,7 +126,9 @@ TimelineEvent {
|
||||||
to: 0
|
to: 0
|
||||||
}
|
}
|
||||||
ScriptAction {
|
ScriptAction {
|
||||||
script: wrapper.room.eventShown()
|
script: {
|
||||||
|
wrapper.room.eventShown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ EventDelegateChooser {
|
||||||
id: wrapper
|
id: wrapper
|
||||||
|
|
||||||
required property bool isStateEvent
|
required property bool isStateEvent
|
||||||
|
property bool scrolledToThis: false
|
||||||
|
|
||||||
// qmllint disable required
|
// qmllint disable required
|
||||||
EventDelegateChoice {
|
EventDelegateChoice {
|
||||||
|
|
Loading…
Reference in a new issue