2
* Copyright 2016 Podbird Team
4
* This file is part of Podbird.
6
* Podbird is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* Podbird is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
import Ubuntu.Components 1.3
21
import "../podcasts.js" as Podcasts
22
import "../components"
31
model: player.playlist
37
divider.visible: false
42
// Grab the metaData for the current index using its unique source url
43
property var metaModel: player.metaForSource(model.source)
49
source: Qt.resolvedUrl(layout.metaModel.image)
50
sourceSize.height: width
51
sourceSize.width: width
52
SlotsLayout.position: SlotsLayout.First
55
title.text: layout.metaModel.name
56
// #FIXME: Change this 2 to prevent title eliding when UITK is updated to rev > 1800
57
title.maximumLineCount: 1
58
title.color: player.playlist.currentIndex === index ? podbird.appTheme.focusText
59
: podbird.appTheme.baseText
61
subtitle.text: layout.metaModel.artist
62
subtitle.color: podbird.appTheme.baseSubText
65
leadingActions: ListItemActions {
70
player.playlist.removeItem(index)
71
var source = model.source
72
source = source.toString()
73
Podcasts.removeItemFromQueue(source)
80
if (player.playlist.currentIndex === index) {
83
player.playlist.currentIndex = index