summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-10-06 01:39:30 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-10-06 16:16:24 +0200
commit857d9cf2b6c649feb7557ed82bf7b98b63aa376e (patch)
treef902243343c7a1d8398de9246bded319d432887f /resources
parentTranslated using Weblate (Finnish) (diff)
downloadnheko-857d9cf2b6c649feb7557ed82bf7b98b63aa376e.tar.xz
Basic thread filtering
The reply pagination logic is a bit weird rn though.
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/MessageView.qml17
1 files changed, 13 insertions, 4 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml

index a9ce8b55..bf336dfb 100644 --- a/resources/qml/MessageView.qml +++ b/resources/qml/MessageView.qml
@@ -38,7 +38,14 @@ Item { displayMarginBeginning: height / 2 displayMarginEnd: height / 2 - model: room + + TimelineFilter { + id: filteredTimeline + source: room + filterByThread: room ? room.thread : "" + } + + model: filteredTimeline.filterByThread ? filteredTimeline : room // reuseItems still has a few bugs, see https://bugreports.qt.io/browse/QTBUG-95105 https://bugreports.qt.io/browse/QTBUG-95107 //onModelChanged: if (room) room.sendReset() //reuseItems: true @@ -215,16 +222,18 @@ Item { } } + // These shortcuts use the room timeline because switching to threads and out is annoying otherwise. + // Better solution welcome. Shortcut { sequence: "Alt+Up" - onActivated: room.reply = chat.model.indexToId(room.reply ? chat.model.idToIndex(room.reply) + 1 : 0) + onActivated: room.reply = room.indexToId(room.reply ? room.idToIndex(room.reply) + 1 : 0) } Shortcut { sequence: "Alt+Down" onActivated: { - var idx = room.reply ? chat.model.idToIndex(room.reply) - 1 : -1; - room.reply = idx >= 0 ? chat.model.indexToId(idx) : null; + var idx = room.reply ? room.idToIndex(room.reply) - 1 : -1; + room.reply = idx >= 0 ? room.indexToId(idx) : null; } }