-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMusicGridHotView.qml
76 lines (72 loc) · 2.29 KB
/
MusicGridHotView.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
import QtQuick 2.15
import QtQuick.Controls
import QtQml
Item{
property alias list: gridRepeter.model
Grid{
id:gridLyout
anchors.fill: parent
columns: 5
Repeater{
id:gridRepeter
Frame{
padding: 8
width: parent.width*0.2
height: parent.width*0.2+30
background: Rectangle{
id:background
color: "#00000000"
radius: 6
}
clip: true
MusicRundImage{
id:image
width: parent.width
height: parent.width
imgSrc: getCoverImage(modelData.coverImgUrl)
}
Text {
text: modelData.name
width: parent.width
height: 30
anchors{
top:image.bottom
horizontalCenter: parent.horizontalCenter
leftMargin: 5
rightMargin: 5
}
font{
family: window.mFontFamily
pointSize: 12
}
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
color: "#eeffffff"
elide: Qt.ElideMiddle//显示不下就截取
}
MouseArea{
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onEntered: {
background.color="#50ffffff"
}
onExited: {
background.color="#00000000"
}
onClicked: {
var item=gridRepeter.model[index]
pageHomeView.onPlayListItemClicked(item.id,"1000");
}
}
}
}
}
function getCoverImage(coverImage){
if(coverImage.lastIndexOf("145983724.jpg")>0){
console.log("coverImage="+coverImage)
return""
}
return coverImage
}
}