mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-02-14 11:03:08 -05:00
feat: Add navigation panel for messages
This commit is contained in:
@ -81,6 +81,17 @@ ChatRootView {
|
||||
checked: typeof _chatview !== 'undefined' ? _chatview.isPin : false
|
||||
onCheckedChanged: _chatview.isPin = topBar.pinButton.checked
|
||||
}
|
||||
navigation.currentMessageNumber: {
|
||||
return "%1/%2".arg(chatListView.currentIndex + 1).arg(chatListView.count)
|
||||
}
|
||||
navigation.onMessageUp: {
|
||||
const newIndex = Math.max(0, chatListView.currentIndex - 1)
|
||||
chatListView.positionViewAtIndex(newIndex, ListView.Center)
|
||||
}
|
||||
navigation.onMessageDown: {
|
||||
const newIndex = Math.min(chatListView.count - 1, chatListView.currentIndex + 1)
|
||||
chatListView.positionViewAtIndex(newIndex, ListView.Center)
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
@ -95,7 +106,6 @@ ChatRootView {
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
cacheBuffer: 2000
|
||||
|
||||
|
||||
delegate: Loader {
|
||||
required property var model
|
||||
required property int index
|
||||
@ -124,6 +134,13 @@ ChatRootView {
|
||||
}
|
||||
}
|
||||
|
||||
onContentYChanged: {
|
||||
const index = indexAt(width / 2, contentY + height / 2)
|
||||
if (index !== -1) {
|
||||
currentIndex = index
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: chatItemComponent
|
||||
|
||||
|
||||
Reference in New Issue
Block a user