~nicohman/signal-rs

ref: 5084c926fb753fdc6dda5f3cc2c8af2df5f1190b signal-rs/qml/chats/CreateChat.qml -rw-r--r-- 1.0 KiB
5084c926 — nicohman Make SignalUI a singleton and add application icon 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.15
import org.kde.kirigami 2.13 as Kirigami
import SignalUI 0.1

Kirigami.ScrollablePage {
	title: "Create Chat"
	ListView {
		anchors.fill: parent
		model: SignalUI.contacts
		delegate: ItemDelegate {
			//width: parent.width
			width: crLa.width //+ crAv.width
			height: 40
			onClicked: {
				// Dumb hack to get around fact that we don't have an official Chat yet
                signalState.currentChat = {
                	is_group: false
                };
                signalState.currentIsGroup = false;
                console.log(model.tel);
                signalState.currentName = model.name;
                signalState.setCurrent(model.tel);
                SignalUI.show_chat(model.tel);
                signalState.openView("chatHistory");
                window.pageStack.layers.pop();
			}
			Row {
				/*Avatar {
					id: crAv
					tel: model.tel
					width: 40
					height: 40
				}*/
				Label {
					id: crLa
					height: 20
					text: model.name
				}
			}
		}
	}
}