forked from patrickelectric/agora-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActivitiesStackView.qml
42 lines (40 loc) · 2.6 KB
/
ActivitiesStackView.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
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
MyStackView {
id: thisStackView
property bool showDate: false
delegate: Frame {
id: frame
width: parent.width
height: grid.height + 2*padding
anchors { left: parent.left; right: parent.right; rightMargin: internal.viewMargin; leftMargin: internal.viewMargin }
GridLayout {
id: grid
columns: 2
rows: 2 + modelData.speakers.length + ((modelData.room !== undefined) ? 1:0)
flow: GridLayout.TopToBottom
Label { text: "\uf017"; Layout.preferredWidth: internal.maxIconWidth; horizontalAlignment: Text.AlignHCenter; font { family: fontAwesome.name; pointSize: 12 } }
Label { text: "\uf041"; Layout.preferredWidth: internal.maxIconWidth; horizontalAlignment: Text.AlignHCenter; visible: modelData.room !== undefined; font { family: fontAwesome.name; pointSize: 12 } }
Label { text: (modelData.activity_type !== undefined) ? modelData.activity_type.icon:"\uf00c"; Layout.preferredWidth: internal.maxIconWidth; horizontalAlignment: Text.AlignHCenter; font { family: fontAwesome.name; pointSize: 12 } }
Repeater {
model: modelData.speakers
Label { text: "\uf007"; Layout.preferredWidth: internal.maxIconWidth; horizontalAlignment: Text.AlignHCenter; font { family: fontAwesome.name; pointSize: 12 } }
}
Label { text: ((showDate) ? (modelData.start_date.substring(8, 10) + "/" + modelData.start_date.substring(5, 7) + "/" + modelData.start_date.substring(0, 4) + " ("):"") + modelData.start_date.substring(11, 16) + " ‒ " + modelData.end_date.substring(11, 16) + ((showDate) ? ")":"") }
Label { text: (visible) ? (modelData.room.name + ((modelData.room.location !== "") ? (" ‒ " + modelData.room.location):"")):""; visible: modelData.room !== undefined }
Label { id: titleLabel; color: "#1c274a"; text: modelData.title; Layout.preferredWidth: thisStackView.width*0.8; wrapMode: Text.WordWrap }
Repeater {
model: modelData.speakers
Label { text: modelData.name + ((modelData.affiliation !== "") ? (" (" + modelData.affiliation + ")"):""); Layout.preferredWidth: frame.width-10*internal.viewMargin; elide: Text.ElideRight }
}
}
ItemDelegate {
anchors { fill: parent; margins: -11 }
onClicked: {
if (modelData.abstract)
thisStackView.push("qrc:/activity.qml", { "model": thisStackView.model[index] })
}
}
}
}