Changed PageHeader color to a gradient
[quandoparte] / application / resources / harmattan / qml / PageHeader.qml
1 import QtQuick 1.0
2 import com.nokia.meego 1.0
3 import com.nokia.extras 1.0
4 import "uiconstants.js" as UiConstants
5
6 Rectangle {
7     property alias text: label.text
8     property alias options: dialog.model
9     property alias selectedIndex: dialog.selectedIndex
10
11     id: root
12     width: parent.width
13     height: screen.currentOrientation == Screen.Landscape ?
14                 UiConstants.HeaderDefaultHeightLandscape :
15     UiConstants.HeaderDefaultHeightPortrait
16     gradient: Gradient {
17         GradientStop { color: mouse.pressed ? "#040" : "#061"; position: 0.0 }
18         GradientStop { color: "#0a2"; position: 1.0 }
19     }
20
21     TumblerButtonStyle {
22         id: style
23         inverted: true
24     }
25     Item {
26         id: spacer
27         anchors.left: parent.left
28         width: UiConstants.DefaultMargins
29         height: parent.heigth
30     }
31     Label {
32         id: label
33         anchors.left: spacer.right
34         anchors.verticalCenter: parent.verticalCenter
35         font {
36             pixelSize: UiConstants.HeaderFontPixelSize
37             bold: false
38         }
39         color: style.textColor
40     }
41     MouseArea {
42         id: mouse
43         anchors.fill: parent
44         onClicked: dialog.open()
45     }
46
47     Image {
48         id: icon
49
50         anchors { right: (label.text != "") ? parent.right : undefined;
51             rightMargin: UiConstants.DefaultMargins;
52             horizontalCenter: (label.text != "") ? undefined : parent.horizontalCenter;
53             verticalCenter: parent.verticalCenter;
54         }
55         height: label.height
56         source: "image://theme/meegotouch-combobox-indicator" +
57                 (style.inverted ? "-inverted" : "") +
58                 (root.enabled ? "" : "-disabled") +
59                 (mouse.pressed ? "-pressed" : "")
60     }
61     SelectionDialog {
62         id: dialog
63         titleText: qsTr("Show")
64     }
65 }