Title "bar" on the alternatives page
authorIvan Frade <ivan.frade@gmail.com>
Mon, 4 Jul 2011 12:26:44 +0000 (15:26 +0300)
committerIvan Frade <ivan.frade@gmail.com>
Mon, 4 Jul 2011 12:26:44 +0000 (15:26 +0300)
ui/Alternatives.qml

index 1fab2bb..c96b5c6 100644 (file)
@@ -1,5 +1,6 @@
 import QtQuick 1.1
 import com.meego 1.0
+import "UIConstants.js" as UIConstants
 
 Page {
     id: coversAlternativesPage
@@ -12,10 +13,31 @@ Page {
              }
     }
 
+    Rectangle {
+        id: titleArea
+        anchors.top: coversAlternativesPage.top
+        width: coversAlternativesPage.width
+        height: 70
+        color: UIConstants.COLOR_SELECT
+        Label {     
+          platformStyle: LabelStyle { fontFamily: UIConstants.FONT_FAMILY; fontPixelSize: UIConstants.FONT_LARGE;}
+          anchors.fill: parent
+          anchors.leftMargin: UIConstants.DEFAULT_MARGIN
+          id: titleLabel
+          text: "Select a cover:"
+          verticalAlignment: Text.AlignVCenter
+          color: "white"
+        }
+    } 
+
+
     GridView { 
         id: coversView
         model: coversModel
-        anchors.fill : coversAlternativesPage
+        anchors.top: titleArea.bottom
+        anchors.bottom : coversAlternativesPage.bottom
+        anchors.left: coversAlternativesPage.left
+        anchors.right: coversAlternativesPage.right
         cellWidth: 160
         cellHeight: 160
 
@@ -33,12 +55,15 @@ Page {
                  height: parent.height
                  cache: false
                  anchors.centerIn: parent
+                 visible: model.cover.url != ""
               }              
               
-              Text {
-                 id: t
-                 text: "xxx"
-                 visible: (model.cover.url == null)
+              BusyIndicator {
+                 id: loadingIndicator
+                 platformStyle: BusyIndicatorStyle {size: "small"}
+                 running: (model.cover.url == "")
+                 visible: (model.cover.url == "")
+                 anchors.centerIn: parent
               }
 
               MouseArea {
@@ -55,42 +80,3 @@ Page {
     }
 
 }
-
-
-/*
-Row {
-       id: coversAlternatives
-
-       // This are set on construction
-       property alias altmodel: imagesLoop.model
-       property variant albumListModel
-       property variant mc
-
-       // Pass this when an image is clicked
-       property int indexInAlbumList
-       
-       signal done
-
-       anchors.horizontalCenter : parent.horizontalCenter
-       anchors.verticalCenter: parent.verticalCenter
-
-       spacing: parent.width / 16
-
-       Repeater {
-           id: imagesLoop
-           delegate: Component {
-                ClickeableImage {
-                  source: model.cover.url
-                  width: 120
-                  height: 120
-                  onClicked: { 
-                     console.log (model.cover.url) 
-                     mc.coverSelected (model.cover, albumListModel, indexInAlbumList)
-                     coversAlternatives.done ()
-                  }
-               }
-           }
-       }
-}
-
-*/