-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCard.qml
74 lines (59 loc) · 1.6 KB
/
Card.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
import QtQuick 2.0
import QtGraphicalEffects 1.0
Rectangle {
property string mainRectColor
property string cardTitle: "No Title"
property string cardDescription: "No Description"
DropShadow {
anchors.fill: mainRect
source:mainRect
horizontalOffset: 3
verticalOffset: 3
radius: 8.0
samples: 16
color: "#80000000"
transparentBorder: true
}
Rectangle {
id:mainRect
color: mainRectColor
anchors.fill: parent
Text {
id:title
text:cardTitle
color: "#555"
font {
bold: true
pixelSize: parent.height/5
}
anchors{
top: parent.top
left: parent.left
topMargin: parent.height*(0.1)
leftMargin: parent.width*(0.05)
}
}
Text {
id:description
text:cardDescription
anchors{
top: parent.top
left: parent.left
right: parent.right
bottom: parent.bottom
topMargin: parent.height*(0.4)
leftMargin: parent.width*(0.1)
rightMargin: parent.width*(0.03)
}
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
color: "#888"
font {
bold: true
pixelSize: parent.height/8
}
onTextChanged: {
description.text = description.text.substring(0,140)
}
}
}
}