-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMessageIncoming.qml
More file actions
163 lines (148 loc) · 3.78 KB
/
MessageIncoming.qml
File metadata and controls
163 lines (148 loc) · 3.78 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import QtQuick 2.5
Item {
id: messageItem
width: 559
anchors.left: parent.left
implicitHeight: messageCont.implicitHeight + 20
Image {
source: imageSrc
id: avatar
width: 70
height: 70
anchors.left: parent.left
anchors.leftMargin: 10
anchors.top: parent.top
anchors.topMargin: 10
}
Rectangle {
id: messageCont
width: 457
implicitHeight: replyUsername.implicitHeight + replyText.implicitHeight + 20
color: "#16d2ff"
radius: 10
anchors.left: avatar.right
anchors.leftMargin: 10
anchors.top: parent.top
anchors.topMargin: 10
MouseArea {
id: mouseAreaMsg
anchors.fill: parent
property bool ipVisible: false
onClicked: {
if (!ipVisible) {
fadeIn.start()
expand.start()
ipVisible = true
} else {
fadeOut.start()
contract.start()
ipVisible = false
}
}
}
Text {
text: userName
id: replyUsername
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 5
anchors.leftMargin: 10
anchors.rightMargin: 10
font.pixelSize: 14
font.weight: Font.Bold
}
Text {
text: textContents
id: replyText
anchors.top: parent.top
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.topMargin: 25
anchors.leftMargin: 10
anchors.bottomMargin: 10
anchors.rightMargin: 10
font.pixelSize: 12
}
}
Text {
text: ipAddress
id: ipAddressText
anchors.top: messageCont.bottom
anchors.topMargin: 5
anchors.left: messageCont.left
anchors.leftMargin: 5
font.pixelSize: 9
opacity: 0.0
NumberAnimation {
id: fadeIn
target: ipAddressText
properties: "opacity"
from: 0.0
to: 1.0
duration: 100
}
NumberAnimation {
id: fadeOut
target: ipAddressText
properties: "opacity"
from: 1.0
to: 0.0
duration: 100
}
PropertyAnimation {
id: expand
target: messageItem
properties: "implicitHeight"
to: messageCont.implicitHeight + 40
duration: 100
}
PropertyAnimation {
id: contract
target: messageItem
properties: "implicitHeight"
to: messageCont.implicitHeight + 20
duration: 100
}
}
}
/*
*/
/*Item {
id: messageItem
width: 559
height: childrenRect + 20
anchors.left: parent
Image {
id: avatar
width: 70
height: 70
anchors.right: parent.right
anchors.rightMargin: 10
anchors.top: parent.top
anchors.topMargin: 10
}
Rectangle {
id: messageCont
width: 457
height: childrenRect + 20
color: "#85e9fe"
radius: 10
anchors.right: avatar.left
anchors.rightMargin: 10
anchors.top: parent.top
anchors.topMargin: 10
MouseArea {
id: mouseArea1
anchors.fill: parent
}
Text {
id: replyText
anchors.fill: parent
anchors.margins: 10
text: qsTr("Text")
font.pixelSize: 12
}
}
}*/