QML: Move main screen to its own QML file
authorIvan Frade <ivan.frade@nokia.com>
Fri, 8 Apr 2011 11:50:15 +0000 (14:50 +0300)
committerIvan Frade <ivan.frade@nokia.com>
Fri, 8 Apr 2011 11:50:15 +0000 (14:50 +0300)
ui/Intro.qml [new file with mode: 0644]
ui/main.qml

diff --git a/ui/Intro.qml b/ui/Intro.qml
new file mode 100644 (file)
index 0000000..fc1e943
--- /dev/null
@@ -0,0 +1,25 @@
+import Qt 4.7
+
+Row {
+        id: initPage
+
+        signal selected (string state)
+
+        anchors.horizontalCenter : parent.horizontalCenter
+        anchors.verticalCenter: parent.verticalCenter
+        spacing: screen.width / 4
+
+        FancyButton {
+           source: "images/button-blue.png"
+           caption: "Edit metadata"
+        }
+
+        FancyButton {
+           source: "images/button-red.png"
+           caption: "Album art"
+           onClicked: {
+              initPage.selected ("in_albumsPage")
+              screen.state = "in_albumsPage"
+           }
+        }
+}
index 082d3b6..33e9c1f 100644 (file)
@@ -5,30 +5,17 @@ Rectangle {
     width: 800
     height: 480
     color: "black"
-    //state: "in_initPage"
-    state: "in_albumsPage"
+    state: "in_initPage"
+    //state: "in_albumsPage"
      
-    Row {
-        id: initPage
-
-        anchors.horizontalCenter : screen.horizontalCenter
-        anchors.verticalCenter: screen.verticalCenter
-        spacing: screen.width / 4
-
-        FancyButton {
-           source: "images/button-blue.png"
-           caption: "Edit metadata"
-        }
-
-        FancyButton {
-           source: "images/button-red.png"
-           caption: "Album art"
-           onClicked: {
-              screen.state = "in_albumsPage"
-           }
-        }
+    Intro {
+       id: initPage
+       onSelected: {
+          screen.state = state
+       }
     }
 
+
     AlbumList {
         id: albumsPage
         model: albumModel