Deltachat/qml/chat/ChatListView.qml
2025-04-04 15:38:03 +07:00

88 lines
2 KiB
QML

import QtQuick 2.15
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.2
import Dcchat 1.0
import DCStyle 1.0
import "ChatListView.js" as ChatL
Rectangle {
// detachat
id: list
signal idChange(int id)
ChatListModel {
id : lmodel
}
ChatProxyModel {
id: proxy
sourceModel: lmodel
}
ColumnLayout{
anchors.fill: parent
spacing: 1
Item {
id: bar
height: search.height
Layout.fillWidth: true
z:2
TextField {
id: search
anchors.top: parent.top
anchors.left: parent.left
anchors.right: btn.right
}
Button {
id :btn
anchors.top: parent.top
anchors.right: parent.right
width: 30
text: "tk"
onClicked: {
var text = search.text
proxy.setFilterString(text)
}
}
}
ListView {
id: view
spacing: 5
model: proxy
Layout.fillWidth: true
Layout.fillHeight: true
delegate: ChatListItem {
width: list.width
}
}
RowLayout {
Layout.fillWidth: true
height: addContact.height
Button {
visible: ! lmodel.status
id : _tstats
text: qsTr("Connecting to server ...")
}
Item {
Layout.fillWidth: true
}
TextIcon {
y:0
id: addContact
// visible: lmodel.status
size: 50
dptext: "+"
MouseArea {
anchors.fill: parent
onClicked: {
chatlist.showView("qrc:/qml/chat/contact/ContactList.qml")
}
}
}
}
}
}