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

List:       kde-commits
Subject:    [plasma-mediacenter] /: Improvements to browser layouts, error handling for music model.
From:       Shantanu Tushar <shaan7in () gmail ! com>
Date:       2012-08-06 16:05:00
Message-ID: 20120806160500.A7B57A6094 () git ! kde ! org
[Download RAW message or body]

Git commit bb8d67e2683dd1c16e99c13a2fe7f279cb23d9b0 by Shantanu Tushar.
Committed on 06/08/2012 at 18:03.
Pushed by shantanu into branch 'master'.

Improvements to browser layouts, error handling for music model.
Patch by Fabian Riethmayer <fabian@web2.0-apps.de>
Welcome to Plasma and KDE dev :)

REVIEW: 105816

M  +5    -0    browsingbackends/metadatabackends/metadatamusicbackend/nepom=
ukmusicmodel.cpp
M  +1    -0    browsingbackends/metadatabackends/metadatamusicbackend/nepom=
ukmusicmodel.h
M  +49   -22   components/mediabrowser/MediaItemDelegate.qml

http://commits.kde.org/plasma-mediacenter/bb8d67e2683dd1c16e99c13a2fe7f279c=
b23d9b0

diff --git a/browsingbackends/metadatabackends/metadatamusicbackend/nepomuk=
musicmodel.cpp b/browsingbackends/metadatabackends/metadatamusicbackend/nep=
omukmusicmodel.cpp
index d4f7449..02fe154 100644
--- a/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmo=
del.cpp
+++ b/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmo=
del.cpp
@@ -119,3 +119,8 @@ void NepomukMusicModel::finishedListing()
 {
     reset();
 }
+
+void NepomukMusicModel::error(const QString &message)
+{
+    kDebug() << message;
+}
\ No newline at end of file
diff --git a/browsingbackends/metadatabackends/metadatamusicbackend/nepomuk=
musicmodel.h b/browsingbackends/metadatabackends/metadatamusicbackend/nepom=
ukmusicmodel.h
index 1ba77e7..a20858b 100644
--- a/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmo=
del.h
+++ b/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmo=
del.h
@@ -41,6 +41,7 @@ protected Q_SLOTS:
     void entriesRemoved(QList< QUrl > entries);
     void finishedListing();
     void updateModel();
+    void error(const QString &message);
 =

 private:
     QString m_icon;
diff --git a/components/mediabrowser/MediaItemDelegate.qml b/components/med=
iabrowser/MediaItemDelegate.qml
index bd181ab..f1ecbc4 100644
--- a/components/mediabrowser/MediaItemDelegate.qml
+++ b/components/mediabrowser/MediaItemDelegate.qml
@@ -36,21 +36,24 @@ Item {
     signal playRequested(int index, string url, string currentMediaType)
 =

     Item {
-        anchors { fill: parent; margins: 1 }
+        anchors { fill: parent; margins: 20 }
         clip: true
-        Rectangle {
+        /*Rectangle {
             anchors.fill: parent
             radius: 5
             z: -1
             color: "black"
             opacity: mediaItemDelegateItem.GridView.isCurrentItem ? 0.9 : 0
-        }
+            border.color: theme.viewHoverColor
+            border.width: mediaItemDelegateItem.GridView.isCurrentItem ? 2=
 : 0
+        }*/
 =

         Item {
             anchors {
                 fill: parent
+                margins: 2
             }
-
+            clip: true
             PlasmaCore.Theme {
                 id:theme
             }
@@ -81,14 +84,38 @@ Item {
 =

                 Component {
                     id: delegateItemImageComponent
-                    Image {
-                        id: delegateItemImage
-                        anchors.horizontalCenter: parent.horizontalCenter
-                        fillMode: Image.PreserveAspectCrop
-                        sourceSize.width: width * 2
-                        sourceSize.height: 0
-                        asynchronous: true
-                        source: rootColumn.source
+                    Item {
+                        width: parent.width;
+                        height: parent.height;
+                        Rectangle {
+                            width: parent.width - 6
+                            height: parent.height - 6
+                            clip: true
+                            anchors.centerIn: parent
+                            color: "transparent"
+                            Image {
+                                id: delegateItemImage
+                                width: parent.width - 6
+                                height: parent.height - 6
+                                anchors.centerIn: parent
+                                fillMode: Image.PreserveAspectCrop
+                                sourceSize.width: width * 2
+                                sourceSize.height: 0
+                                asynchronous: true
+                                source: rootColumn.source
+                                z: 1
+                            }
+                        }
+                        Rectangle {
+                            anchors.centerIn: parent
+                            radius: 2
+                            z: 2
+                            color: "transparent"
+                            width: parent.width - 2
+                            height: parent.height -2
+                            border.color: mediaItemDelegateItem.GridView.i=
sCurrentItem ? theme.viewHoverColor : "#666"
+                            border.width: 1
+                        }
                     }
                 }
 =

@@ -114,7 +141,7 @@ Item {
                     text: hideLabel ? "" : ( display ? display : "" )
                     visible: !hideLabel
                     font.pointSize: 14
-                    color: "white"
+                    color: mediaItemDelegateItem.GridView.isCurrentItem ? =
theme.viewHoverColor : "white"
                     elide: mediaItemDelegateItem.GridView.isCurrentItem ? =
Text.ElideNone : Text.ElideMiddle
                     width: parent.width
                     wrapMode: mediaItemDelegateItem.GridView.isCurrentItem=
 ? Text.Wrap : Text.NoWrap
@@ -146,14 +173,6 @@ Item {
                 onTextChanged: iconImageLoader.checkAndLoad()
             }
 =

-            Keys.onReturnPressed: {
-                if (isExpandable) {
-                    backend.expand(index);
-                } else {
-                    mediaItemDelegateItem.playRequested(index, mediaUrl, m=
ediaType)
-                }
-            }
-
             Behavior on width {
                 NumberAnimation {
                     duration: 1000
@@ -185,4 +204,12 @@ Item {
             easing.type: Easing.OutExpo
         }
     }
-}
+    =

+    Keys.onReturnPressed: {
+        if (isExpandable) {
+            backend.expand(index);
+        } else {
+            mediaItemDelegateItem.playRequested(index, mediaUrl, mediaType)
+        }
+    }
+}
\ No newline at end of file
[prev in list] [next in list] [prev in thread] [next in thread] 

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