-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChatPage.qml
144 lines (118 loc) · 3.55 KB
/
ChatPage.qml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import NinepunchGlobals 1.0
import "Android"
import "Components"
import "js/fonticons.js" as FontIcons
Page {
property bool useBackButton: false
property bool useHeader: true
ListView{
id: chatContent
anchors.fill: parent
model: 20
delegate: Item{
width: parent.width
height: childrenRect.height
Item{
id: chatAvatar
width: 64
height: 48
Rectangle{
width: 32
height: width
radius: width * 0.5
anchors.centerIn: parent
}
}
Column{
anchors{
left: chatAvatar.right
right: parent.right
top: parent.top
margins: 4
}
Row{
spacing: 8
Label{
text: "Sam Za Nemesis"
font.weight: Font.DemiBold
}
Label{
text: "today at 00:00"
font.pixelSize: 12
color: "gray"
anchors.bottom: parent.bottom
}
}
Label{
text: "Lorem ipsum dolor sit amet"
}
}
}
//Indicate that we are loading previous messages
footer: Item{
width: parent.width
height: 64
BusyIndicator{
width: 48
height: 48
anchors.centerIn: parent
}
}
//Space so our crazy footer can breathe
header: Item{
width: 1
height: 64
}
verticalLayoutDirection: ListView.BottomToTop
}
BlurRectangle{
element: chatContent
useRGBA: true
anchors{
left: parent.left
right: parent.right
bottom: parent.bottom
}
color: Globals.mainColor
height: chatTextArea.contentHeight + 32
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
RowLayout{
anchors.fill: parent
anchors.margins: 4
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
PostToolButton{
glyph: FontIcons.Ionicons.ios_plus
implicitHeight: 32
onClicked: {
console.log( JSON.stringify(discountApp.qdiscord) );
console.log( JSON.stringify(discountApp.qdiscord.state) );
console.log( JSON.stringify(discountApp.qdiscord.state.guilds) );
console.log( JSON.stringify(discountApp.qdiscord.state.guilds[0]) );
console.log( discountApp.qdiscord.state.guilds[0].icon );
}
}
Rectangle{
width: 1
height: 32
}
TextArea{
id: chatTextArea
height: 32
Layout.fillWidth: true
color: "white"
}
PostToolButton{
glyph: FontIcons.Ionicons.happy
implicitHeight: 32
}
PostToolButton{
glyph: FontIcons.Ionicons.android_send
implicitHeight: 32
}
}
}
}