Repository navigation
Expand file tree
/
Copy pathSongMessageView.qml
More file actions
91 lines (87 loc) · 2.25 KB
/
Copy pathSongMessageView.qml
File metadata and controls
91 lines (87 loc) · 2.25 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
import QtQuick 2.0
import QtGraphicalEffects 1.0
Rectangle
{
id:songMessageView
width: 190*dp
height: 85*dp
property var setInfo: (function(url,title,text)
{
img.source = url;
songName.text = title
singer.text = text
})
//头像
Item
{
property bool isFirstClick: false
width: 50*dp
height: 50*dp
anchors
{
left:parent.left
leftMargin:20*dp
verticalCenter:parent.verticalCenter
}
Image {
id: img
source: "http://lc-ba69fjyb.cn-n1.lcfile.com/BIDDmLSwSosWhO8mxcqIJ3A"
sourceSize: Qt.size(parent.width, parent.height)
smooth: true
visible: false
}
Rectangle{
id:mask
anchors.fill: parent
radius: 5*dp
}
OpacityMask {
anchors.fill: parent
source: img
maskSource: mask
}
//点击事件
MouseArea
{
anchors.fill: parent
onClicked:
{
if(!parent.isFirstClick)
{
personPopup.open()
parent.isFirstClick = ! parent.isFirstClick
}
else
{
personPopup.close()
parent.isFirstClick = ! parent.isFirstClick
}
}
}
//歌曲名称
Text {
id: songName
text: qsTr("Nothing to fear");font.pixelSize: 14;width: 60*dp;
font.bold: true
anchors
{
top:parent.top
topMargin:10*dp
left:img.right
leftMargin:10*dp
}
}
//歌手
Text {
id: singer
text: qsTr("Dexter Britain");font.pixelSize: 14;width: 60*dp;
anchors
{
bottom:parent.bottom
bottomMargin:6*dp
left:img.right
leftMargin:10*dp
}
}
}
}