2 import com.nokia.meego 1.0
3 import com.nokia.extras 1.0
4 import "uiconstants.js" as UiConstants
7 property alias text: label.text
8 property alias options: dialog.model
9 property alias selectedIndex: dialog.selectedIndex
13 height: screen.currentOrientation === Screen.Landscape ?
14 UiConstants.HeaderDefaultHeightLandscape :
15 UiConstants.HeaderDefaultHeightPortrait
17 GradientStop { color: Qt.darker(UiConstants.AccentColor, mouse.pressed ? 1.5 : 1.25); position: 0.0 }
18 GradientStop { color: Qt.lighter(UiConstants.AccentColor, 1.5); position: 1.0 }
29 leftMargin: UiConstants.DefaultMargin;
30 verticalCenter: parent.verticalCenter;
33 pixelSize: UiConstants.HeaderFontPixelSize
36 color: style.textColor
41 onClicked: if (options.count > 1) dialog.open()
47 right: (label.text != "") ? parent.right : undefined;
48 rightMargin: UiConstants.DefaultMargin;
49 horizontalCenter: (label.text != "") ? undefined : parent.horizontalCenter;
50 verticalCenter: parent.verticalCenter;
52 visible: options.count > 1
54 source: "image://theme/meegotouch-combobox-indicator" +
55 (style.inverted ? "-inverted" : "") +
56 (root.enabled ? "" : "-disabled") +
57 (mouse.pressed ? "-pressed" : "")
61 titleText: qsTr("Show")
63 onSelectedIndexChanged: {
64 console.log("Selection changed to: " + selectedIndex)
65 if (options === undefined || options.count === 0 ||
66 options.get(selectedIndex) === undefined) {
69 header.text = options.get(selectedIndex).name
70 console.log("Selection text is: " + header.text)