summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorHiers <47784553+Hiers@users.noreply.github.com>2022-09-11 23:05:20 +0000
committerGitHub <noreply@github.com>2022-09-11 23:05:20 +0000
commit8071b192b8cecf0b0f422d74678038dd3afbe3bc (patch)
treee5340dccf4ad742a86199e82758a9de5eff038fb /resources
parentMerge pull request #1163 from foresto/log-options (diff)
downloadnheko-8071b192b8cecf0b0f422d74678038dd3afbe3bc.tar.xz
Line to indicate first unread message (#1147)
* First draft of unread line feature.

* Minor visual fix.

* Removed unnecessary ternary operator.

* Extended unread line functionality to work on minimised window or focusing another window.

* Fix for unread line not showing when last read message is hidden.

* Minor performance improvement. Fix for misbehaving event2order DB at application start.

* Fix for possible performance issues when user has joined a large number of rooms.

* Fix for breaking macos and clazy builds.

* Changed on windows focus function to refresh unread line if room is unread.

* Unread line is removed when user sends a message.

* Linting.

* Fixed unread line to work in standalone room windows.

* Switch isRoomUnread for index 0.

* Merged try/catch blocks.

* Fix for crash on opening a room invite.

* Call fullyReadEventId function when used instead of storing it and passing it through.

* Function that was meant to sync the unread line was relying on an async function, oops.

* Linting again.

* More linting...

* Minor changes.
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/MessageView.qml1
-rw-r--r--resources/qml/RoomList.qml2
-rw-r--r--resources/qml/TimelineRow.qml17
3 files changed, 19 insertions, 1 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml
index fd533229..2e1d9398 100644
--- a/resources/qml/MessageView.qml
+++ b/resources/qml/MessageView.qml
@@ -458,6 +458,7 @@ Item {
                 encryptionError: wrapper.encryptionError
                 timestamp: wrapper.timestamp
                 status: wrapper.status
+                index: wrapper.index
                 relatedEventCacheBuster: wrapper.relatedEventCacheBuster
                 y: section.visible && section.active ? section.y + section.height : 0
 
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml
index 5ce69d97..a4628aa7 100644
--- a/resources/qml/RoomList.qml
+++ b/resources/qml/RoomList.qml
@@ -108,6 +108,8 @@ Page {
                     timelineRoot: timelineView
                     windowTarget: roomWindowW
                 }
+
+                onActiveChanged: { room.lastReadIdOnWindowFocus(); }
             }
 
         }
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index 3a7bf561..dc640099 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -44,12 +44,13 @@ AbstractButton {
     required property int duration
     required property var timestamp
     required property int status
+    required property int index
     required property int relatedEventCacheBuster
 
     hoverEnabled: true
 
     width: parent.width
-    height: row.height+(reactionRow.height > 0 ? reactionRow.height-2 : 0 )
+    height: row.height+(reactionRow.height > 0 ? reactionRow.height-2 : 0 )+unreadRow.height
 
     Rectangle {
         color: (Settings.messageHoverHighlight && hovered) ? Nheko.colors.alternateBase : "transparent"
@@ -277,6 +278,7 @@ AbstractButton {
             }
         }
     }
+
     Reactions {
         anchors {
             top: row.bottom
@@ -292,4 +294,17 @@ AbstractButton {
         reactions: r.reactions
         eventId: r.eventId
     }
+
+    Rectangle {
+        id: unreadRow
+        anchors {
+            top: reactionRow.bottom
+            topMargin: 5
+        }
+        color: Nheko.colors.highlight
+        width: row.maxWidth
+        visible: (r.index > 0 && (chat.model.fullyReadEventId == r.eventId))
+        height: visible ? 3 : 0
+
+    }
 }