Changeset View
Changeset View
Standalone View
Standalone View
src/qml/PlayListEntry.qml
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Line(s) | 144 | Item { | |||
---|---|---|---|---|---|
173 | } | 173 | } | ||
174 | } | 174 | } | ||
175 | 175 | | |||
176 | Item { | 176 | Item { | ||
177 | id: fakeDiscNumberItem | 177 | id: fakeDiscNumberItem | ||
178 | 178 | | |||
179 | visible: isValid && (!hasValidDiscNumber || isSingleDiscAlbum) | 179 | visible: isValid && (!hasValidDiscNumber || isSingleDiscAlbum) | ||
180 | 180 | | |||
181 | Layout.preferredWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) | 181 | Layout.preferredWidth: (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) + (elisaTheme.layoutHorizontalMargin / 4) | ||
182 | Layout.minimumWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) | 182 | Layout.minimumWidth: (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) + (elisaTheme.layoutHorizontalMargin / 4) | ||
183 | Layout.maximumWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) | 183 | Layout.maximumWidth: (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) + (elisaTheme.layoutHorizontalMargin / 4) | ||
184 | 184 | | |||
185 | TextMetrics { | 185 | TextMetrics { | ||
186 | id: fakeDiscNumberSize | 186 | id: fakeDiscNumberSize | ||
187 | 187 | | |||
188 | text: '/9' | 188 | text: '/9' | ||
189 | } | 189 | } | ||
190 | } | 190 | } | ||
191 | 191 | | |||
192 | Label { | 192 | Label { | ||
193 | id: trackNumberLabel | 193 | id: trackNumberLabel | ||
194 | 194 | | |||
195 | horizontalAlignment: Text.AlignRight | 195 | horizontalAlignment: Text.AlignRight | ||
196 | 196 | | |||
197 | text: trackNumber !== 0 && trackNumber !== -1 ? Number(trackNumber).toLocaleString(Qt.locale(), 'f', 0) : '' | 197 | text: trackNumber !== 0 && trackNumber !== -1 ? Number(trackNumber).toLocaleString(Qt.locale(), 'f', 0) : '' | ||
198 | 198 | | |||
199 | font.weight: (isPlaying ? Font.Bold : Font.Light) | 199 | font.weight: (isPlaying ? Font.Bold : Font.Light) | ||
200 | color: myPalette.text | 200 | color: myPalette.text | ||
201 | 201 | | |||
202 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 202 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
203 | 203 | | |||
204 | visible: isValid | 204 | visible: isValid | ||
205 | 205 | | |||
206 | Layout.preferredWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) | 206 | Layout.preferredWidth: ((trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) > (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x) ? (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) : (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x)) | ||
207 | Layout.minimumWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) | 207 | Layout.minimumWidth: ((trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) > (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x) ? (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) : (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x)) | ||
208 | Layout.maximumWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) | 208 | Layout.maximumWidth: ((trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) > (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x) ? (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) : (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x)) | ||
209 | 209 | | |||
210 | Layout.rightMargin: !LayoutMirroring.enabled ? (discNumber !== 0 && !isSingleDiscAlbum ? | 210 | Layout.rightMargin: !LayoutMirroring.enabled ? (discNumber !== 0 && !isSingleDiscAlbum ? | ||
211 | 0 : elisaTheme.layoutHorizontalMargin / 2) : 0 | 211 | 0 : elisaTheme.layoutHorizontalMargin / 2) : 0 | ||
212 | Layout.leftMargin: LayoutMirroring.enabled ? (discNumber !== 0 && !isSingleDiscAlbum ? | 212 | Layout.leftMargin: LayoutMirroring.enabled ? (discNumber !== 0 && !isSingleDiscAlbum ? | ||
213 | 0 : elisaTheme.layoutHorizontalMargin / 2) : 0 | 213 | 0 : elisaTheme.layoutHorizontalMargin / 2) : 0 | ||
214 | 214 | | |||
215 | TextMetrics { | 215 | TextMetrics { | ||
216 | id: trackNumberSize | 216 | id: trackNumberSize | ||
Show All 15 Lines | 228 | Label { | |||
232 | 232 | | |||
233 | visible: isValid && discNumber !== 0 && !isSingleDiscAlbum | 233 | visible: isValid && discNumber !== 0 && !isSingleDiscAlbum | ||
234 | 234 | | |||
235 | font.weight: (isPlaying ? Font.Bold : Font.Light) | 235 | font.weight: (isPlaying ? Font.Bold : Font.Light) | ||
236 | color: myPalette.text | 236 | color: myPalette.text | ||
237 | 237 | | |||
238 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | 238 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
239 | 239 | | |||
240 | Layout.preferredWidth: numberSeparatorSize.width | 240 | Layout.preferredWidth: (numberSeparatorSize.boundingRect.width - numberSeparatorSize.boundingRect.x) | ||
241 | Layout.minimumWidth: numberSeparatorSize.width | 241 | Layout.minimumWidth: (numberSeparatorSize.boundingRect.width - numberSeparatorSize.boundingRect.x) | ||
242 | Layout.maximumWidth: numberSeparatorSize.width | 242 | Layout.maximumWidth: (numberSeparatorSize.boundingRect.width - numberSeparatorSize.boundingRect.x) | ||
243 | 243 | | |||
244 | TextMetrics { | 244 | TextMetrics { | ||
245 | id: numberSeparatorSize | 245 | id: numberSeparatorSize | ||
246 | 246 | | |||
247 | text: '/' | 247 | text: '/' | ||
248 | } | 248 | } | ||
249 | } | 249 | } | ||
250 | 250 | | |||
251 | Label { | 251 | Label { | ||
252 | horizontalAlignment: Text.AlignRight | 252 | horizontalAlignment: Text.AlignRight | ||
253 | 253 | | |||
254 | font.weight: (isPlaying ? Font.Bold : Font.Light) | 254 | font.weight: (isPlaying ? Font.Bold : Font.Light) | ||
255 | color: myPalette.text | 255 | color: myPalette.text | ||
256 | 256 | | |||
257 | text: Number(discNumber).toLocaleString(Qt.locale(), 'f', 0) | 257 | text: Number(discNumber).toLocaleString(Qt.locale(), 'f', 0) | ||
258 | 258 | | |||
259 | visible: isValid && discNumber !== 0 && !isSingleDiscAlbum | 259 | visible: isValid && discNumber !== 0 && !isSingleDiscAlbum | ||
260 | 260 | | |||
261 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 261 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
262 | 262 | | |||
263 | Layout.preferredWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) | 263 | Layout.preferredWidth: ((discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) > (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x) ? | ||
264 | Layout.minimumWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) | 264 | (discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) : | ||
265 | Layout.maximumWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) | 265 | (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x)) | ||
266 | Layout.minimumWidth: ((discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) > (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x) ? | ||||
267 | (discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) : | ||||
268 | (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x)) | ||||
269 | Layout.maximumWidth: ((discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) > (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x) ? | ||||
270 | (discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) : | ||||
271 | (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x)) | ||||
266 | 272 | | |||
267 | Layout.rightMargin: !LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin / 2) : 0 | 273 | Layout.rightMargin: !LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin / 2) : 0 | ||
268 | Layout.leftMargin: LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin / 2) : 0 | 274 | Layout.leftMargin: LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin / 2) : 0 | ||
269 | 275 | | |||
270 | TextMetrics { | 276 | TextMetrics { | ||
271 | id: discNumberSize | 277 | id: discNumberSize | ||
272 | 278 | | |||
273 | text: '9' | 279 | text: '9' | ||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 379 | RatingStar { | |||
375 | 381 | | |||
376 | starRating: rating | 382 | starRating: rating | ||
377 | 383 | | |||
378 | starSize: elisaTheme.ratingStarSize | 384 | starSize: elisaTheme.ratingStarSize | ||
379 | 385 | | |||
380 | visible: rating > 0 | 386 | visible: rating > 0 | ||
381 | } | 387 | } | ||
382 | 388 | | |||
383 | TextMetrics { | | |||
384 | id: durationTextMetrics | | |||
385 | text: i18nc("This is used to preserve a fixed width for the duration text.", "00:00") | | |||
386 | } | | |||
387 | | ||||
388 | LabelWithToolTip { | 389 | LabelWithToolTip { | ||
389 | id: durationLabel | 390 | id: durationLabel | ||
390 | 391 | | |||
391 | text: duration | 392 | text: duration | ||
392 | 393 | | |||
393 | font.weight: (isPlaying ? Font.Bold : Font.Normal) | 394 | font.weight: (isPlaying ? Font.Bold : Font.Normal) | ||
394 | color: myPalette.text | 395 | color: myPalette.text | ||
395 | 396 | | |||
396 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 397 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
397 | Layout.preferredWidth: durationTextMetrics.width + 1 | | |||
398 | Layout.leftMargin: elisaTheme.layoutHorizontalMargin / 2 | 398 | Layout.leftMargin: elisaTheme.layoutHorizontalMargin / 2 | ||
399 | Layout.rightMargin: elisaTheme.layoutHorizontalMargin / 2 | 399 | Layout.rightMargin: elisaTheme.layoutHorizontalMargin / 2 | ||
400 | 400 | | |||
401 | horizontalAlignment: Text.AlignRight | 401 | horizontalAlignment: Text.AlignRight | ||
402 | } | 402 | } | ||
403 | } | 403 | } | ||
404 | } | 404 | } | ||
405 | } | 405 | } | ||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |