diff --git a/share/qtcreator/templates/qtquickapp/qml/app/meego10/MainPage.qml b/share/qtcreator/templates/qtquickapp/qml/app/meego10/MainPage.qml index 9de64968f444c06422e47d3dc0074265d663dd38..79ec4ad1c0a92684bab0dc88f4ffe04918032218 100644 --- a/share/qtcreator/templates/qtquickapp/qml/app/meego10/MainPage.qml +++ b/share/qtcreator/templates/qtquickapp/qml/app/meego10/MainPage.qml @@ -2,22 +2,65 @@ import QtQuick 1.1 import com.nokia.meego 1.0 Page { + id: page tools: commonTools - Label { - id: label - anchors.centerIn: parent - text: qsTr("Hello world!") - visible: false + property string title : "Application Title" + + Image { + id: pageHeader + anchors { + top: page.top + left: page.left + right: page.right + } + + height: parent.width < parent.height ? 72 : 46 + width: parent.width + source: "image://theme/meegotouch-view-header-fixed" + (theme.inverted ? "-inverted" : "") + z: 1 + + Label { + id: header + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + leftMargin: 16 + } + platformStyle: LabelStyle { + fontFamily: "Nokia Pure Text Light" + fontPixelSize: 32 + } + text: page.title + } } - Button{ + Flickable { + id: pageFlickableContent anchors { - horizontalCenter: parent.horizontalCenter - top: label.bottom - topMargin: 10 + top: pageHeader.bottom + bottom: page.bottom + left: page.left + right: page.right + margins: 16 } - text: qsTr("Click here!") - onClicked: label.visible = true + contentHeight: pageContent.height + contentWidth: pageContent.width + flickableDirection: Flickable.VerticalFlick + + Column { + id: pageContent + width: page.width - pageFlickableContent.anchors.margins * 2 + spacing: 16 + + Button{ + text: qsTr("Click here!") + onClicked: appWindow.showStatusBar = !appWindow.showStatusBar + } + } + } + + ScrollDecorator { + flickableItem: pageFlickableContent } } diff --git a/share/qtcreator/templates/qtquickapp/qml/app/meego10/main.qml b/share/qtcreator/templates/qtquickapp/qml/app/meego10/main.qml index bfb4552a29c4fe2ca91f4db776cff999a821ad70..37c6a0263d0af8fc6a5b22281d5e87bc67d2cfcb 100644 --- a/share/qtcreator/templates/qtquickapp/qml/app/meego10/main.qml +++ b/share/qtcreator/templates/qtquickapp/qml/app/meego10/main.qml @@ -12,19 +12,53 @@ PageStackWindow { ToolBarLayout { id: commonTools - visible: true + + ToolIcon { + visible: pageStack.depth > 1 + platformIconId: "toolbar-back" + onClicked: { + pageStack.pop(); + } + } + + ToolButton { + anchors.horizontalCenter: parent.horizontalCenter + text: theme.inverted ? "Inverted" : "Non-Inverted" + onClicked: { + theme.inverted = !theme.inverted; + } + } + ToolIcon { platformIconId: "toolbar-view-menu" - anchors.right: (parent === undefined) ? undefined : parent.right - onClicked: (myMenu.status === DialogStatus.Closed) ? myMenu.open() : myMenu.close() + onClicked: { + appWindow.showToolBar = false; + myMenu.open(); + } } } + QueryDialog { + id: aboutDialog + titleText: "Application Title" + message: "(C) [year] [your name]\n[version]" + } + Menu { id: myMenu visualParent: pageStack MenuLayout { - MenuItem { text: qsTr("Sample menu item") } + MenuItem { + text: qsTr("About") + onClicked: { + aboutDialog.open(); + } + } + } + onStatusChanged: { + if (status === DialogStatus.Closed) { + appWindow.showToolBar = true; + } } } }