Scroll chat to bottom on startup
This commit is contained in:
parent
b28330b5d5
commit
57c95e3192
|
|
@ -6,15 +6,22 @@ Item {
|
|||
id: chatPane
|
||||
property bool sidebarVisible: true
|
||||
signal toggleSidebar()
|
||||
function scrollToBottom() {
|
||||
chatView.positionViewAtEnd()
|
||||
}
|
||||
function loadChat() {
|
||||
chatModel.reset()
|
||||
if (ollie.activeSessionId && ollie.activeAgentId) {
|
||||
var log = ollie.readLogForSession(ollie.activeSessionId, ollie.activeAgentId)
|
||||
if (log) { chatModel.appendData(log); chatModel.trimFront(20) }
|
||||
}
|
||||
scrollToBottom()
|
||||
}
|
||||
|
||||
Component.onCompleted: loadChat()
|
||||
Component.onCompleted: {
|
||||
loadChat()
|
||||
scrollToBottom()
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
|
@ -117,6 +124,8 @@ Item {
|
|||
anchors.margins: 4
|
||||
visible: ollie.daemonConnected && ollie.activeAgentId !== ""
|
||||
|
||||
Component.onCompleted: chatPane.scrollToBottom()
|
||||
|
||||
delegate: ChatBlockDelegate {
|
||||
width: chatView.width - 8
|
||||
}
|
||||
|
|
|
|||
Reference in New Issue