-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCardBack.qml
156 lines (123 loc) · 3.94 KB
/
CardBack.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
145
146
147
148
149
150
151
import QtQuick 2.0
import QtQuick.Controls 1.3
Item {
id:cardbackList
states: [
State {
name:"show"
PropertyChanges {
target:cardbackList
visible:true
}
},
State {
name:"hide"
PropertyChanges {
target:cardbackList
visible:false
}
}
]
state:"hide"
Rectangle {
width:parent.width
height:parent.height
color:"white"
border.color:"black"
border.width:2
radius:5
}
Text {
id:title
anchors.top:parent.top
anchors.topMargin: 10
anchors.horizontalCenter: parent.horizontalCenter
text: "Select Card Back."
font.pixelSize: parent.width * 0.1
}
Text {
id:subtitle
anchors.top:title.bottom
anchors.horizontalCenter: parent.horizontalCenter
text: "Scroll up or down to select card back."
}
GridView {
id: backGrid
anchors.top:subtitle.bottom
anchors.topMargin:10
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width * 0.9
height: backGrid.width / 1.75
snapMode: GridView.SnapToRow
flow: GridView.FlowLeftToRight
boundsBehavior: Flickable.DragAndOvershootBounds
flickableDirection: Flickable.VerticalFlick
visible: true
clip:true
delegate:
Rectangle {
width: parent.width
height:backGrid.width / 1.75
//color: colorCode
radius: 0
border.color: "black"
border.width: 1
anchors.horizontalCenter: parent.horizontalCenter
Image {
anchors.fill:parent
source:img
MouseArea {
anchors.fill: parent
onClicked: {
cardbImg = img
cardbackList.state = "hide"
}
}
}
}
cellHeight: backGrid.width / 1.75 //passerbyGrid.height
cellWidth: backGrid.width
model: ListModel {
id: backmodel
ListElement {
img:"img/default_card.png"
}
ListElement {
img:"img/art-default.png"
}
ListElement {
img:"img/music-default.png"
}
ListElement {
img:"img/theatre-default.png"
}
ListElement {
img:"img/business-default.png"
}
ListElement {
img:"img/communication-default.png"
}
ListElement {
img:"img/author-default.png"
}
}
}
Text {
anchors.top:backGrid.bottom
anchors.topMargin:10
anchors.horizontalCenter: parent.horizontalCenter
//text: "Use your own?"
text:'<a href="http://www.vagueentertainment.com/applications/cafesync/?page_id=30">Use your own?</a>'
onLinkActivated: Qt.openUrlExternally("http://www.vagueentertainment.com/applications/cafesync/?page_id=30")
}
Button {
// anchors.left:parent.left
anchors.bottom:parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
width:parent.width * 0.9
height:parent.height * 0.05
anchors.margins:10
text: "Cancel"
onClicked: cardbackList.state = "hide"
}
}