[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-mediacenter] components/playlist: Add playlist delegate
From:       Shantanu Tushar <shaan7in () gmail ! com>
Date:       2012-07-29 7:35:04
Message-ID: 20120729073504.A5166A6094 () git ! kde ! org
[Download RAW message or body]

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/fda43d705adf3f2f01ed4b36f0407c86d22d83d5

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 <ksinny@gmail.com>                        *
+ *   Copyright 2012 Shantanu Tushar <shaan7in@gmail.com>                   *
+ *                                                                         *
+ *   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" : "lightsteelblue"
+            opacity: 0.4
+            Text {
+                anchors { fill: parent; verticalCenter: parent.verticalCenter }
+                text: display
+                color: (index == playlistModel.currentIndex) ? "red" : "white"
+                elide: Text.ElideRight
+                font.pixelSize: 18
+            }
+
+            MouseArea {
+                hoverEnabled: true
+                onEntered: listViewItem.ListView.view.currentIndex = index
+                anchors.fill: parent
+                onClicked: {
+                    playlistModel.currentIndex = index
+                    playlistItem.playRequested(mediaUrl)
+                }
+            }
+        }
+
+        PlasmaComponents.ToolButton {
+            id: removeFromPlaylistButton
+            width: height
+            height: parent.height
+            visible: listViewItem.ListView.isCurrentItem
+            iconSource: "list-remove"
+            onClicked: {
+                playlistModel.removeFromPlaylist (index);
+            }
+        }
+    }
+}
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic