From: David Llewellyn-Jones Date: Sat, 14 Jul 2018 20:09:58 +0000 (+0100) Subject: Add About page X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=commitdiff_plain;h=e5b6de629d0585d29f0591deec4afec33f44f20c Add About page --- diff --git a/qml/components/InfoRow.qml b/qml/components/InfoRow.qml index 64a714e..8a2ec5a 100644 --- a/qml/components/InfoRow.qml +++ b/qml/components/InfoRow.qml @@ -17,6 +17,7 @@ Item { property int pixelSize: Theme.fontSizeSmall property alias labelTextBold: labelText.font.bold property alias valueTextBold: valueText.font.bold + property alias horizontalAlignment: valueText.horizontalAlignment Text { id: labelText @@ -45,7 +46,7 @@ Item { leftMargin: midLine + Theme.paddingSmall rightMargin: detailItem.rightMargin } - horizontalAlignment: Text.AlignRight + horizontalAlignment: Text.AlignLeft color: Theme.primaryColor font.pixelSize: pixelSize textFormat: Text.PlainText diff --git a/qml/pages/About.qml b/qml/pages/About.qml index 669fc47..60a30f9 100644 --- a/qml/pages/About.qml +++ b/qml/pages/About.qml @@ -1,30 +1,94 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 +import "../components" Page { - id: page + id: aboutPage + // The version property is now in the application + // initialisation code in harbour-pedalo.cpp + //property string version: "?.?-?" // The effective value will be restricted by ApplicationWindow.allowedOrientations allowedOrientations: Orientation.All - SilicaListView { - id: listView - model: 20 - anchors.fill: parent - header: PageHeader { - title: qsTr("About") - } - delegate: BackgroundItem { - id: delegate - - Label { - x: Theme.horizontalPageMargin - text: qsTr("Item") + " " + index - anchors.verticalCenter: parent.verticalCenter - color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor + width: parent.width + height: parent.height + + anchors.fill: parent + + VerticalScrollDecorator {} + + Column { + id: aboutColumn + width: parent.width + spacing: Theme.paddingLarge + + PageHeader { + title: qsTr("About Pedalo") + } + + Image { + anchors.topMargin: Theme.paddingLarge + anchors.horizontalCenter: parent.horizontalCenter + source : Qt.resolvedUrl("image://theme/icon-m-cloud-download") + } + + Label { + text: qsTr("Compare your pedalo performance with others") + wrapMode: Text.WordWrap + font.pixelSize: Theme.fontSizeSmall + anchors { + leftMargin: Theme.paddingLarge + rightMargin: Theme.paddingLarge + left: parent.left + right: parent.right + } + } + + InfoRow { + label: qsTr("Version:") + value: version + midlineRatio: 0.3 + midlineMin: Theme.fontSizeSmall * 5 + midlineMax: Theme.fontSizeSmall * 10 + } + + InfoRow { + label: qsTr("Author:") + value: "David Llewellyn-Jones" + midlineRatio: 0.3 + midlineMin: Theme.fontSizeSmall * 5 + midlineMax: Theme.fontSizeSmall * 10 + } + + InfoRow { + label: qsTr("Licence:") + value: "MIT" + midlineRatio: 0.3 + midlineMin: Theme.fontSizeSmall * 5 + midlineMax: Theme.fontSizeSmall * 10 + } + + SectionHeader { + text: qsTr("Links") + } + + Row { + spacing: Theme.paddingLarge + anchors.horizontalCenter: parent.horizontalCenter + Button { + id: website + text: qsTr("Website") + enabled: true + onClicked: Qt.openUrlExternally("http://www.flypig.co.uk/?to=pedalo") + } + Button { + id : email + text: qsTr("Email") + enabled: true + onClicked: Qt.openUrlExternally("mailto:david@flypig.co.uk") } - onClicked: console.log("Clicked " + index) } - VerticalScrollDecorator {} } } + diff --git a/qml/pages/JourneyInfo.qml b/qml/pages/JourneyInfo.qml index 95e58ab..0181602 100644 --- a/qml/pages/JourneyInfo.qml +++ b/qml/pages/JourneyInfo.qml @@ -61,6 +61,7 @@ Page { midlineRatio: shortlineRatio midlineMin: shortlineMin midlineMax: shortlineMax + horizontalAlignment: Text.AlignRight } InfoRow { @@ -72,6 +73,7 @@ Page { midlineRatio: shortlineRatio midlineMin: shortlineMin midlineMax: shortlineMax + horizontalAlignment: Text.AlignRight } InfoRow { @@ -88,6 +90,7 @@ Page { midlineRatio: shortlineRatio midlineMin: shortlineMin midlineMax: shortlineMax + horizontalAlignment: Text.AlignRight } InfoRow { @@ -100,6 +103,7 @@ Page { midlineRatio: shortlineRatio midlineMin: shortlineMin midlineMax: shortlineMax + horizontalAlignment: Text.AlignRight } InfoRow { @@ -111,6 +115,7 @@ Page { midlineRatio: widelineRatio midlineMin: widelineMin midlineMax: widelineMax + horizontalAlignment: Text.AlignRight } InfoRow { @@ -122,6 +127,7 @@ Page { midlineRatio: widelineRatio midlineMin: widelineMin midlineMax: widelineMax + horizontalAlignment: Text.AlignRight } } } diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index 0de4dc4..101376a 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -14,8 +14,8 @@ Page { // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView PullDownMenu { MenuItem { - text: qsTr("Show Page 2") - onClicked: pageStack.push(Qt.resolvedUrl("SecondPage.qml")) + text: qsTr("About") + onClicked: pageStack.push(Qt.resolvedUrl("About.qml")) } } diff --git a/src/harbour-pedalo.cpp b/src/harbour-pedalo.cpp index d7da21f..a4218cd 100644 --- a/src/harbour-pedalo.cpp +++ b/src/harbour-pedalo.cpp @@ -47,6 +47,11 @@ int main(int argc, char *argv[]) view->setSource(SailfishApp::pathTo("qml/harbour-pedalo.qml")); QQmlContext *ctxt = view->rootContext(); + ctxt->setContextProperty("version", VERSION); + qDebug() << "harbour-pedalo VERSION string: " << VERSION; + qDebug() << "VERSION_MAJOR: " << VERSION_MAJOR; + qDebug() << "VERSION_MINOR: " << VERSION_MINOR; + qDebug() << "VERSION_BUILD: " << VERSION_BUILD; ctxt->setContextProperty("journeymodel", &journeys); ctxt->setContextProperty("currentStatus", ¤tStatus); diff --git a/translations/harbour-pedalo-de.ts b/translations/harbour-pedalo-de.ts index 9bff26f..d479ac1 100644 --- a/translations/harbour-pedalo-de.ts +++ b/translations/harbour-pedalo-de.ts @@ -4,12 +4,36 @@ About - About + About Pedalo + + + + Compare your pedalo performance with others + + + + Version: + + + + Author: + + + + Licence: - Item - Element + Links + + + + Website + + + + Email + @@ -103,10 +127,6 @@ MainPage - - Show Page 2 - Zur Seite 2 - Pedalo @@ -147,6 +167,10 @@ Finish + + About + + Stats diff --git a/translations/harbour-pedalo.ts b/translations/harbour-pedalo.ts index 79a127d..42382ec 100644 --- a/translations/harbour-pedalo.ts +++ b/translations/harbour-pedalo.ts @@ -4,11 +4,35 @@ About - About + About Pedalo + + + + Compare your pedalo performance with others + + + + Version: + + + + Author: + + + + Licence: - Item + Links + + + + Website + + + + Email @@ -103,10 +127,6 @@ MainPage - - Show Page 2 - - Pedalo @@ -147,6 +167,10 @@ Finish + + About + + Stats