-
Notifications
You must be signed in to change notification settings - Fork 0
/
VideoItem.qml
105 lines (91 loc) · 3.26 KB
/
VideoItem.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
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.11
import org.kde.kirigami 2.4 as Kirigami
Rectangle {
RowLayout {
property int visualIndex: index
//height: itemHeight + 2 * itemMargin
clip: true
x: itemMargin; y: itemMargin
//height: itemHeight
height: parent.height - itemMargin * 2
width: parent.width - itemMargin * 2
//anchors.top: parent.top
// image and time
Rectangle {
width: itemHeight * 1.5; height: itemHeight
color: "darkgray"
Image {
// source: "file:///usr/share/icons/breeze/places/symbolic/folder-videos-symbolic.svg"
fillMode: Image.PreserveAspectCrop
source: thumbnail
anchors.fill: parent
}
// place time label on the lower right corner of the image
Label {
z: 1
anchors.right: parent.right
anchors.bottom: parent.bottom
color: "white"
text: secondsToTimeStr(duration)
background: Rectangle { color: "black" ; opacity: 0.85 }
padding: 3
}
}
Item{
height: itemHeight
Layout.fillWidth: true
// head {title, uploader, date)
// text (has to be shrinkable)
// foot {view_count,}
ColumnLayout {
id: column
anchors.fill: parent
FontMetrics { id: metrics }
Label {
text: title
id: titleLabel
topPadding: font.pixelSize - contentHeight + 1
wrapMode: Text.NoWrap
style: "Raised"
verticalAlignment: Text.AlignTop
topInset: 0
}
RowLayout {
id: lowerHeading
//anchors.left: parent.left; anchors.right: parent.right
Label {
id: uploaderLabel
text: "by %1".arg(uploader)
//anchors.left: parent.left
}
// Item { Layout.fillWidth: true } // spacer, push upload date to the right
Label {
//text: "on %1".arg(upload_date)
text: upload_date
//background: Rectangle { color: "black" }
horizontalAlignment: "AlignRight"
Layout.fillWidth: true
}
}
Label {
id: descLabel
//anchors.bottom: infoFooter.top
text: description
wrapMode: Text.WordWrap
Layout.fillHeight: true
clip: true
}
Label {
text: "%1 views".arg(view_count)
bottomPadding: -4
leftPadding: 0
//transformOrigin: Item.Center
//anchors.bottom: parent.bottom
//anchors.bottomMargin: 0
}
}
}
}
}