Deltachat/qml/chat/ChatList.qml
2025-03-15 10:17:05 +07:00

48 lines
1 KiB
QML

import QtQuick 2.15
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.2
import Dcchat 1.0
import DCStyle 1.0
Item {
id: chatlist
anchors.fill: parent
property int cindex : 0
RowLayout {
// view panel
anchors.fill: parent
spacing: 0
ChatListView {
// list view
id: chatlistview
Layout.fillHeight: true
width: 240
}
Rectangle {
color: ChatStyle.list.pcolor
width: ChatStyle.list.psize
Layout.fillHeight: true
}
Loader {
id : chatContend
z:2
asynchronous : true
Layout.fillHeight: true
Layout.fillWidth: true
}
}
function setSource(id){
chatContend.setSource("MessageArea.qml", {"chat_id": id ,})
}
Connections {
target: chatlistview
function onIdChange(id)
{
// set chat id to show
chatContend.source = ""
Qt.callLater(setSource , id)
}
}
}