Add highlight on goToEvent

Add a temporary highlight when the goToEvent is triggered.

This implementation also alows a temporary highlight of an item at anytime if the timeline container's isTemporaryHighlighted property is set to true.

Closes network/neochat#34
This commit is contained in:
James Graham
2022-10-04 18:07:54 +00:00
parent cd7232e7bf
commit 1a3befef36
2 changed files with 21 additions and 3 deletions

View File

@@ -430,7 +430,9 @@ Kirigami.ScrollablePage {
headerPositioning: ListView.OverlayHeader
function goToEvent(eventID) {
messageListView.positionViewAtIndex(eventToIndex(eventID), ListView.Contain)
const index = eventToIndex(eventID)
messageListView.positionViewAtIndex(index, ListView.Center)
itemAtIndex(index).isTemporaryHighlighted = true
}
Item {