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

List:       kde-commits
Subject:    =?utf-8?q?=5Bplasma-mobile=5D_research/applets/appletstrip/packa?=
From:       Marco Martin <notmart () gmail ! com>
Date:       2011-02-28 22:07:38
Message-ID: 20110228220738.5C91CA60CD () git ! kde ! org
[Download RAW message or body]

Git commit 6c4ba101e6bc4309d0d2bd09cf810b9af08695d2 by Marco Martin.
Committed on 28/02/2011 at 23:06.
Pushed by mart into branch 'master'.

fix applets addition

M  +10   -4    research/applets/appletstrip/package/contents/ui/PlasmoidContainer.qml \
 M  +16   -3    research/applets/appletstrip/package/contents/ui/main.qml     

http://commits.kde.org/plasma-mobile/6c4ba101e6bc4309d0d2bd09cf810b9af08695d2

diff --git a/research/applets/appletstrip/package/contents/ui/PlasmoidContainer.qml \
b/research/applets/appletstrip/package/contents/ui/PlasmoidContainer.qml index \
                8c9746f..71bd0c2 100644
--- a/research/applets/appletstrip/package/contents/ui/PlasmoidContainer.qml
+++ b/research/applets/appletstrip/package/contents/ui/PlasmoidContainer.qml
@@ -29,6 +29,10 @@ Item {
 
     onAppletChanged: {
         applet.appletDestroyed.connect(appletDestroyed)
+        applet.parent = plasmoidContainer
+        applet.x = 0
+        applet.y = 0
+        height = main.width/2
     }
 
     function appletDestroyed()
@@ -51,9 +55,11 @@ Item {
     }
 
     onHeightChanged: {
-        applet.height = height
-        var ratio = applet.preferredSize.width/applet.preferredSize.height
-        applet.width = main.width/2
-        width = applet.width
+        if (applet) {
+            applet.height = height
+            var ratio = applet.preferredSize.width/applet.preferredSize.height
+            applet.width = main.width/2
+            width = applet.width
+        }
     }
 }
\ No newline at end of file
diff --git a/research/applets/appletstrip/package/contents/ui/main.qml \
b/research/applets/appletstrip/package/contents/ui/main.qml index 9cc3762..2ce8acb \
                100644
--- a/research/applets/appletstrip/package/contents/ui/main.qml
+++ b/research/applets/appletstrip/package/contents/ui/main.qml
@@ -44,9 +44,15 @@ Item {
         var component = Qt.createComponent("PlasmoidContainer.qml");
         var plasmoidContainer = component.createObject(appletsRow, {"x": pos.x, "y": \
pos.y});  plasmoidContainer.applet = applet
-        applet.parent = plasmoidContainer
-        applet.x=0
-        applet.y=0
+
+        /* this will be used for inserting in custom positions
+        var oldChildren = appletsRow.children
+        for (var child in oldChildren) {
+            child.parent = 0
+        }
+        for (var child in oldChildren) {
+            child.parent = appletsRow
+        }*/
     }
 
 
@@ -81,6 +87,13 @@ Item {
                 Row {
                     id: appletsRow
                     height: appletsFlickable.height
+                    add: Transition {
+                        NumberAnimation {
+                            properties: "x"
+                            easing.type: Easing.OutBounce
+                            duration: 250
+                        }
+                    }
                     move: Transition {
                         NumberAnimation {
                             properties: "x"


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

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