--- /dev/null
+import Qt 4.7
+
+Rectangle {
+ id: titleBar
+ height: 40
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ property string closeOrBack : "close"
+ signal back
+
+ // This makes it appear always on top
+ z: 2
+
+ color: parent.color
+ opacity: .5
+
+ Text {
+ text: "This is the title"
+ color: "white"
+ anchors.fill: parent
+ }
+
+ Image {
+ id: backIcon
+ source: ( titleBar.closeOrBack == "close" ? "images/close.png" : "images/back.png")
+
+ fillMode: Image.PreserveAspectFit
+
+ anchors.right: parent.right
+ height: parent.height
+ }
+
+ MouseArea {
+ anchors.fill : backIcon
+ onClicked: {
+ titleBar.back ()
+ }
+ }
+
+}
+
color: "black"
state: "in_initPage"
//state: "in_albumsPage"
+
+ TitleBar {
+ closeOrBack: ( screen.state == "in_initPage" ? "close" : "back")
+ onBack: {
+ switch (screen.state) {
+ case "in_initPage":
+ Qt.quit()
+ break
+ case "in_albumsPage":
+ screen.state = "in_initPage"
+ break
+ case "in_alternativesPage":
+ screen.state = "in_albumsPage"
+ break
+ default:
+ console.log ("WFT")
+ }
+ }
+
+ }
+
Intro {
id: initPage