This repository has been archived by the owner on Jan 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathEventDetailPage.qml
220 lines (181 loc) · 7.34 KB
/
EventDetailPage.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
import QtQuick 2.0
import "functions.js" as F
import "Theme.js" as Theme
Page {
id: page
property alias um: usersModel;
// property alias title: header.title
property alias talkName: talkNameLabel.text
property alias description: descriptionLabel.text
property string startDay;
property string startTime
property string endTime
property alias room: roomLabel.text
property alias roomColor: roomLabel.color
property alias tags: tagsLabel.text;
property bool inFavorites: false;
property string session_id;
signal addToFavorites(string session_id);
signal removeFromFavorites(string session_id);
ListModel {
id: usersModel;
}
Flickable {
anchors.fill: parent;
contentHeight: column.height
Column {
id: column
width: page.width
spacing: Theme.paddingMedium
// PageHeader {
// id: header;
// title: "event"
// }
Text {
id: talkNameLabel
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: Theme.paddingMedium;
// font.family: Theme.fontFamilyHeading
font.pointSize: Theme.header_pointSize
color: Theme.primary_color
wrapMode: Text.WordWrap
}
Text {
id: timeLabel
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: Theme.paddingMedium;
color: Theme.secondary_color
font.pointSize: Theme.secondary_pointSize
text: startTime + " - " + endTime
}
Text {
id: roomLabel
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: Theme.paddingMedium;
color: Theme.secondary_color
font.pointSize: Theme.secondary_pointSize
}
Repeater {
model: usersModel;
delegate: BackgroundItem {
id: usersDelegate
highlight_enabled: false;
height: Math.max(avatarImage.height, nameLabel.paintedHeight + companyLabel.paintedHeight + positionLabel.paintedHeight + 2*Theme.paddingMedium) + 2 * Theme.paddingMedium
Image {
id: dummyImage;
z: avatarImage.z -1;
anchors.fill: avatarImage;
source: "qrc:/images/blank_boy.png"
visible: avatarImage.status !== Image.Ready;
width: avatarImage.width;
height: avatarImage.height
}
Image {
id: avatarImage;
z: usersDelegate.z+2
anchors.left: parent.left
anchors.top: parent.top;
source: model.avatar;
width: 1.5 * dpix;
height: 1.5 * dpiy;
anchors.margins: Theme.paddingMedium;
}
Text {
id: nameLabel
anchors.top: parent.top;
anchors.left: avatarImage.right
anchors.right: parent.right
anchors.margins: Theme.paddingMedium;
text: model.name
color: Theme.primary_color
font.pointSize: Theme.primary_pointSize
wrapMode: Text.WordWrap
}
Text {
id: companyLabel
anchors.left: avatarImage.right
anchors.top: nameLabel.bottom
anchors.right: parent.right
anchors.margins: Theme.paddingMedium;
text: model.company
color: Theme.secondary_color
font.pointSize: Theme.secondary_pointSize
wrapMode: Text.WordWrap
}
Text {
id: positionLabel
anchors.right: parent.right
anchors.margins: Theme.paddingMedium;
anchors.top: companyLabel.bottom
anchors.left: avatarImage.right
text: model.position
color: Theme.secondary_color
font.pointSize: Theme.secondary_pointSize
wrapMode: Text.WordWrap
}
}
}
Rectangle {
id: tagsLabelBackground
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: Theme.paddingMedium;
height: tagsLabel.paintedHeight + tagsLabel.anchors.topMargin + tagsLabel.anchors.bottomMargin
color: Theme.section_header_color
z: tagsLabel.z -1;
Text {
id: tagsLabel;
anchors.fill: tagsLabelBackground
anchors.margins: Theme.paddingSmall
font.pointSize: Theme.secondary_pointSize
color: "#ffffff";//Theme.section_header_color
wrapMode: Text.WordWrap
textFormat: Text.RichText;
}
}
Text {
id: descriptionLabel
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: Theme.paddingMedium;
font.pointSize: Theme.secondary_pointSize
color: Theme.secondary_color
wrapMode: Text.WordWrap
textFormat: Text.RichText;
}
LineButton {
image: inFavorites ? "./images/ic_favorite_white_48dp.png" : "./images/ic_favorite_grey600_48dp.png";
text: inFavorites ?
//% "Remove from favorites"
qsTrId("remove-from-favorites")
:
//% "Add to favorites"
qsTrId("add-to-favorites")
onClicked: {
if (inFavorites) {
removeFromFavorites(session_id);
inFavorites = false;
} else {
addToFavorites(session_id);
inFavorites = true;
}
}
}
LineButton {
visible: (conferenceDetailPage.feedback_url !== '')
image: "./images/ic_stars_white_48dp.png";
//% "Leave your feedback here"
text: qsTrId("open-feedback-form")
onClicked: {
var link = conferenceDetailPage.feedback_url;
link = link.replace(/\{url_id\}/, conferenceDetailPage.url_id)
link = link.replace(/\{session_id\}/, session_id)
Qt.openUrlExternally( link )
}
}
}
}
}