Git commit fda43d705adf3f2f01ed4b36f0407c86d22d83d5 by Shantanu Tushar. Committed on 29/07/2012 at 09:34. Pushed by shantanu into branch 'master'. Add playlist delegate A +63 -0 components/playlist/PlaylistDelegate.qml [License: GPL (= v2+)] http://commits.kde.org/plasma-mediacenter/fda43d705adf3f2f01ed4b36f0407c86d= 22d83d5 diff --git a/components/playlist/PlaylistDelegate.qml b/components/playlist= /PlaylistDelegate.qml new file mode 100644 index 0000000..2f58fa0 --- /dev/null +++ b/components/playlist/PlaylistDelegate.qml @@ -0,0 +1,63 @@ +/*************************************************************************= ** + * Copyright 2012 Sinny Kumari = * + * Copyright 2012 Shantanu Tushar = * + * = * + * This program is free software; you can redistribute it and/or modify = * + * it under the terms of the GNU General Public License as published by = * + * the Free Software Foundation; either version 2 of the License, or = * + * (at your option) any later version. = * + * = * + * This program is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the = * + * GNU General Public License for more details. = * + * = * + * You should have received a copy of the GNU General Public License = * + * along with this program; if not, write to the = * + * Free Software Foundation, Inc., = * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . = * + *************************************************************************= **/ + +import QtQuick 1.1 +import org.kde.plasma.components 0.1 as PlasmaComponents + +Item{ + id: listViewItem + + Row { + anchors.fill: parent + Rectangle { + width: parent.width - removeFromPlaylistButton.width; height: = parent.height + color: listViewItem.ListView.isCurrentItem ? "#002378" : "ligh= tsteelblue" + opacity: 0.4 + Text { + anchors { fill: parent; verticalCenter: parent.verticalCen= ter } + text: display + color: (index =3D=3D playlistModel.currentIndex) ? "red" := "white" + elide: Text.ElideRight + font.pixelSize: 18 + } + + MouseArea { + hoverEnabled: true + onEntered: listViewItem.ListView.view.currentIndex =3D ind= ex + anchors.fill: parent + onClicked: { + playlistModel.currentIndex =3D index + playlistItem.playRequested(mediaUrl) + } + } + } + + PlasmaComponents.ToolButton { + id: removeFromPlaylistButton + width: height + height: parent.height + visible: listViewItem.ListView.isCurrentItem + iconSource: "list-remove" + onClicked: { + playlistModel.removeFromPlaylist (index); + } + } + } +}