[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [plasma-mediacenter] /: Show album cover in popup menu
From: Shantanu Tushar <shantanu () kde ! org>
Date: 2013-11-30 18:13:40
Message-ID: E1Vmp2y-0001Y8-Or () scm ! kde ! org
[Download RAW message or body]
Git commit a03fd6db880dc5ed9ac6b231c0f1ccca948d8edf by Shantanu Tushar.
Committed on 30/11/2013 at 18:13.
Pushed by shantanu into branch 'master'.
Show album cover in popup menu
M +68 -43 mediaelements/popupmenu/PopupMenu.qml
M +1 -1 shells/newshell/package/contents/ui/mediacenter.qml
http://commits.kde.org/plasma-mediacenter/a03fd6db880dc5ed9ac6b231c0f1ccca948d8edf
diff --git a/mediaelements/popupmenu/PopupMenu.qml \
b/mediaelements/popupmenu/PopupMenu.qml index 0857b30..3ef66bb 100644
--- a/mediaelements/popupmenu/PopupMenu.qml
+++ b/mediaelements/popupmenu/PopupMenu.qml
@@ -20,7 +20,7 @@
import QtQuick 1.1
import org.kde.plasma.components 0.1 as PlasmaComponents
-Rectangle {
+Item {
id: popupMenu
property string mediaUrl
@@ -31,54 +31,79 @@ Rectangle {
property alias model: rootListView.model
signal popupMenuItemClicked(int index)
- opacity: 0.8
- z: 2
- color: theme.backgroundColor
- visible: false
+ Row {
+ anchors.centerIn: parent
+ width: musicStatsLeftPane.width + musicStatsRightPane.width
- MouseArea {
- anchors.fill: parent
- ListView {
- id: rootListView
- property int delegateHeight: 60
- spacing: 5
- anchors.centerIn: parent
- width: parent.width/2
- height: (delegateHeight+spacing)*count - spacing
- delegate: Item {
- id: delegateItem
- width: rootListView.width
- height: rootListView.delegateHeight
- Rectangle {
- anchors.fill: parent
- id: popupDelegateItem
- radius: 10
- color: theme.backgroundColor
- Text {
- text: name
- color: theme.textColor
- font.pointSize: 24
- anchors { centerIn: parent; margins: 10 }
- }
+ Item {
+ id: musicStatsLeftPane
+ anchors.verticalCenter: parent.verticalCenter
+ height: musicStatsAlbumCoverImage.height * 1.2
+ width: musicStatsAlbumCoverImage.width * 1.2
+
+ BorderImage {
+ source: _pmc_shadow_image_path
+ width: musicStatsAlbumCoverImage.width+40
+ height: musicStatsAlbumCoverImage.height+40
+ border.left: 50; border.top: 50
+ border.right: 54; border.bottom: 54
+ anchors.horizontalCenter: musicStatsAlbumCoverImage.horizontalCenter
+ anchors.verticalCenter: musicStatsAlbumCoverImage.verticalCenter
+ }
+ Image {
+ id: musicStatsAlbumCoverImage
+ anchors.centerIn: parent
+ source: "image://coverart/" + popupMenu.mediaUrl
+ smooth: true
+ width: Math.min(sourceSize.width, popupMenu.width*0.9)
+ height: sourceSize.height*width/sourceSize.width
+ }
+ }
- PlasmaComponents.ToolButton {
- height: parent.height
- width: height
- iconSource: icon
- anchors.right: parent.right
+ Item {
+ id: musicStatsRightPane
+ height: popupMenu.height; width: popupMenu.width*0.4
+
+ ListView {
+ id: rootListView
+ property int delegateHeight: 60
+ spacing: 5
+ anchors.centerIn: parent
+ width: parent.width*0.75
+ height: (delegateHeight+spacing)*count - spacing
+ delegate: Item {
+ id: delegateItem
+ width: rootListView.width
+ height: rootListView.delegateHeight
+ Rectangle {
+ anchors.fill: parent
+ id: popupDelegateItem
+ radius: 10
+ color: theme.backgroundColor
+ Text {
+ text: name
+ color: theme.textColor
+ font.pointSize: 24
+ anchors { centerIn: parent; margins: 10 }
+ }
+
+ PlasmaComponents.ToolButton {
+ height: parent.height
+ width: height
+ iconSource: icon
+ anchors.right: parent.right
+ }
}
- }
- MouseArea {
- anchors.fill: parent
- hoverEnabled: true
- onEntered: delegateItem.ListView.view.currentIndex = index
- onClicked: {
- \
popupMenuItemClicked(delegateItem.ListView.view.currentIndex); + \
MouseArea { + anchors.fill: parent
+ hoverEnabled: true
+ onEntered: delegateItem.ListView.view.currentIndex = index
+ onClicked: {
+ \
popupMenuItemClicked(delegateItem.ListView.view.currentIndex); + \
} }
}
}
}
-
- onClicked: popupMenu.visible = false
}
}
diff --git a/shells/newshell/package/contents/ui/mediacenter.qml \
b/shells/newshell/package/contents/ui/mediacenter.qml index 2e99e5d..58870d1 100644
--- a/shells/newshell/package/contents/ui/mediacenter.qml
+++ b/shells/newshell/package/contents/ui/mediacenter.qml
@@ -271,7 +271,7 @@ Image {
}
ListElement {
name: "Play"
- icon: "media-playback-start"
+ icon: "pmc-play"
}
ListElement {
name: "Cancel"
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic