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

List:       kde-commits
Subject:    =?utf-8?q?=5Bplasma-mobile=5D_shell/activityconfiguration/qml=3A?=
From:       Marco Martin <notmart () gmail ! com>
Date:       2011-05-19 10:54:22
Message-ID: 20110519105422.129B0A60A4 () git ! kde ! org
[Download RAW message or body]

Git commit e76c2ba907dce19b8bf6342dbdeab6709613c383 by Marco Martin.
Committed on 19/05/2011 at 12:52.
Pushed by mart into branch 'master'.

move the delegate in another file

A  +62   -0    shell/activityconfiguration/qml/WallpaperDelegate.qml         \
[License: LGPL (v2+)] M  +1    -37   shell/activityconfiguration/qml/view.qml     

http://commits.kde.org/plasma-mobile/e76c2ba907dce19b8bf6342dbdeab6709613c383

diff --git a/shell/activityconfiguration/qml/WallpaperDelegate.qml \
b/shell/activityconfiguration/qml/WallpaperDelegate.qml new file mode 100644
index 0000000..111672e
--- /dev/null
+++ b/shell/activityconfiguration/qml/WallpaperDelegate.qml
@@ -0,0 +1,62 @@
+/*
+ *   Copyright 2010 Marco Martin <notmart@gmail.com>
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Library General Public License as
+ *   published by the Free Software Foundation; either version 2, 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 Library 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 Qt 4.7
+import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
+import org.kde.plasma.core 0.1 as PlasmaCore
+import org.kde.qtextracomponents 0.1
+import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
+
+Rectangle {
+    radius: 4
+    width: wallpapersList.height*1.6
+    height: wallpapersList.height-4
+
+    QPixmapItem {
+        pixmap: screenshot
+        anchors {
+            fill: parent
+            margins: 6
+        }
+        Rectangle {
+            anchors.bottom: parent.bottom
+            anchors.horizontalCenter: parent.horizontalCenter
+            color: Qt.rgba(1,1,1,0.6)
+            radius: 4
+            width: wallpaperName.paintedWidth
+            height: wallpaperName.paintedHeight
+            Text {
+                id: wallpaperName
+                text: display
+            }
+        }
+        Rectangle {
+            opacity:wallpapersList.currentIndex == index?1:0
+            width:10
+            height:10
+            radius:5
+            anchors.top:parent.top
+            anchors.horizontalCenter: parent.horizontalCenter
+        }
+    }
+    MouseArea {
+        anchors.fill: parent
+        onClicked: wallpapersList.currentIndex = index
+    }
+}
diff --git a/shell/activityconfiguration/qml/view.qml \
b/shell/activityconfiguration/qml/view.qml index bc82d05..ff1db40 100644
--- a/shell/activityconfiguration/qml/view.qml
+++ b/shell/activityconfiguration/qml/view.qml
@@ -143,43 +143,7 @@ Rectangle {
             snapMode: ListView.SnapOneItem
             orientation: ListView.Horizontal
             model: configInterface.wallpaperModel
-            delegate: Rectangle {
-                radius: 4
-                width: wallpapersList.height*1.6
-                height: wallpapersList.height-4
-
-                QPixmapItem {
-                    pixmap: screenshot
-                    anchors {
-                        fill: parent
-                        margins: 6
-                    }
-                    Rectangle {
-                        anchors.bottom: parent.bottom
-                        anchors.horizontalCenter: parent.horizontalCenter
-                        color: Qt.rgba(1,1,1,0.6)
-                        radius: 4
-                        width: wallpaperName.paintedWidth
-                        height: wallpaperName.paintedHeight
-                        Text {
-                            id: wallpaperName
-                            text: display
-                        }
-                    }
-                    Rectangle {
-                        opacity:wallpapersList.currentIndex == index?1:0
-                        width:10
-                        height:10
-                        radius:5
-                        anchors.top:parent.top
-                        anchors.horizontalCenter: parent.horizontalCenter
-                    }
-                }
-                MouseArea {
-                    anchors.fill: parent
-                    onClicked: wallpapersList.currentIndex = index
-                }
-            }
+            delegate: WallpaperDelegate {}
         }
 
         PlasmaWidgets.PushButton {


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

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