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

List:       kde-commits
Subject:    [gluon/creator-qmlintro-shreya] creator: Setting viewport to ComponentsDocker by default. Timer allo
From:       Shreya Pandit <shreya () shreyapandit ! com>
Date:       2012-06-17 9:48:56
Message-ID: 20120617094856.06E21A60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 09fb0791ec2ddd861d9ccff0a1a77881f9e786f6 by Shreya Pandit.
Committed on 17/06/2012 at 11:48.
Pushed by pandit into branch 'creator-qmlintro-shreya'.

Setting viewport to ComponentsDocker by default. Timer allows the property values to \
be set correctly before animation

M  +3    -6    creator/introslideshow.cpp
M  +29   -34   creator/ui/introduction.qml

http://commits.kde.org/gluon/09fb0791ec2ddd861d9ccff0a1a77881f9e786f6

diff --git a/creator/introslideshow.cpp b/creator/introslideshow.cpp
index ff1b6f8..89f225f 100644
--- a/creator/introslideshow.cpp
+++ b/creator/introslideshow.cpp
@@ -61,9 +61,10 @@ void IntroSlideShow::setDockername(QString name)
 {
 
     docker=name;
-//     if(QString::compare(docker,"", Qt::CaseInsensitive)) {
-        updateDocker();
+    updateDocker();
     emit dockernameChanged();
+
+
 }
 
 qreal IntroSlideShow::getdockX()
@@ -89,11 +90,7 @@ qreal IntroSlideShow::getrefWidth()
 void IntroSlideShow::updateDocker()
 {
     count++;
-    qDebug()<<"dockername"<< docker;
-
-    qDebug()<<"in update docker for" << count <<"th time";
     QRect rectangle;
-
     rectangle= kapp->activeWindow()->findChild<QWidget*>(docker)->frameGeometry();
     setWidth(rectangle.width());
     refWidth=kapp->activeWindow()->width()/2 ;
diff --git a/creator/ui/introduction.qml b/creator/ui/introduction.qml
index 55bc559..235f856 100644
--- a/creator/ui/introduction.qml
+++ b/creator/ui/introduction.qml
@@ -72,13 +72,20 @@ Item {
 
     Item {
 
+        id: viewport;
+        function onCreation(){viewport.state= 'default'}
+
+        Timer {
+            id: viewportTimer
+            interval: 2000
+            onTriggered:{viewport.onCreation();}
+        }
 
         IntroSlideShow {
-                id :animator;
-                dockername: "ComponentsDock";
+            id :animator;
+            Component.onCompleted:viewportTimer.start();
         }
 
-        id: viewport;
         width: animator.width;
         height: animator.height;
         x: animator.x;
@@ -102,39 +109,42 @@ Item {
 
             states: [
 
-            State {
+                State {
                     name: "right"
                     AnchorChanges {
                                 target: text
                                 anchors.left: viewport.right;
 
-                            }
-              },
+                    }
+                },
 
-            State {
+                State {
                     name: "left"
                     AnchorChanges {
                                 target: text
                                 anchors.right: viewport.left;
 
-                            }
+                    }
 
                 }
-]
+            ]
 
 
             function orient() {
 
                 if ((animator.getdockX() +animator.getdockWidth()) < \
(animator.getrefWidth())){  text.state = "right";
-                     console.log("dockname is");
+                    console.log("dockname is");
                     console.log(animator.dockername);
                 }
-                 else{
+
+                else{
+
                     text.state = "left";
                     console.log("dockname is");
                     console.log(animator.dockername);
                 }
+
                 show();
 
             }
@@ -143,11 +153,12 @@ Item {
 
             Behavior on opacity {
                     NumberAnimation { properties:"opacity"; duration: 100 }
-         }
-    }
+               }
+            }
 
         MouseArea {
 
+
             Timer {
                 id: showTimer
                 property int count: 0;
@@ -156,12 +167,6 @@ Item {
 
                      switch(animator.dockername){
 
-                                   case(""):
-                                   {console.log("HAHAHAHAHHA");
-                                       viewport.state = 'component';
-                                   }
-                                   break;
-
                                    case("ComponentsDock"):
 
                                        viewport.state = 'project';
@@ -172,7 +177,7 @@ Item {
                                        break;
 
                                    case("MessageDock"):
-                                       viewport.state = 'scene';
+                                       viewport.state = 'scene';status
                                        break;
 
                                    case("SceneDock"):
@@ -180,7 +185,7 @@ Item {
                                        break;
 
                                    case("PropertiesDock"):
-                                       viewport.state = 'component';
+                                       viewport.state = 'default';
                                        break;
 
                                    default:
@@ -205,7 +210,7 @@ Item {
         states: [
 
         State {
-                name: "component"
+                name: "default"
                 PropertyChanges { target:animator; dockername: "ComponentsDock"}
                 StateChangeScript {
                          name: "myScript"
@@ -253,18 +258,8 @@ Item {
 
                 }
             }
-    ]
+        ]
 
-//     transitions: [
-// 
-//             Transition {
-//                 from: "*"; to: "*"
-//                 NumberAnimation { properties: "x,y,width,height"; duration: 500 }
-//                  ScriptAction { scriptName: "myScript" }
-//             }
-//         ]
-
-
-}
+    }
 
 }


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

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