Add "About..." page

This commit is contained in:
Matti Viljanen 2019-01-05 20:16:04 +02:00
parent b1cc485099
commit 790064e56b
3 changed files with 93 additions and 1 deletions

View file

@ -25,7 +25,9 @@ DISTFILES += qml/harbour-batterybuddy.qml \
rpm/harbour-batterybuddy.yaml \
translations/*.ts \
harbour-batterybuddy.desktop \
qml/pages/MainPage.qml
qml/pages/MainPage.qml \
qml/pages/AboutPage.qml
# Begin: include sound files
OTHER_FILES += sounds/upperLimit.ogg \

83
qml/pages/AboutPage.qml Normal file
View file

@ -0,0 +1,83 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
Page {
id: aboutPage
anchors.fill: parent
PageHeader {
id: header
title: qsTr("Battery Buddy")
}
Column {
anchors.top: header.bottom
width: parent.width
spacing: Theme.paddingMedium
Label {
x: Theme.paddingLarge
text: qsTr("Author")
color: Theme.highlightColor
font.pixelSize: Theme.fontSizeLarge
}
Label {
x: Theme.paddingLarge*2
width: parent.width - x*2;
wrapMode: Text.Wrap
text: "Matti Viljanen"
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeMedium
}
Label {
x: Theme.paddingLarge
text: qsTr("License")
color: Theme.highlightColor
font.pixelSize: Theme.fontSizeLarge
}
Label {
x: Theme.paddingLarge*2
width: parent.width - x*2;
wrapMode: Text.Wrap
text: "GNU General Public Licence 3.0"
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeMedium
}
Button {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Code and feedback")
onClicked: Qt.openUrlExternally("http://www.github.com/direc85/harbour-countme2")
}
Label {
x: Theme.paddingLarge
text: qsTr("Sounds")
color: Theme.highlightColor
font.pixelSize: Theme.fontSizeLarge
}
Label {
x: Theme.paddingLarge*2
width: parent.width - x*2;
wrapMode: Text.Wrap
text: "Sounds were obtained from Notification Sounds and are licensed under Creative Commons Attribution license."
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeMedium
}
Button {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Upper limit")
onClicked: Qt.openUrlExternally("https://notificationsounds.com/notification-sounds/unconvinced-569")
}
Button {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Lower limit")
onClicked: Qt.openUrlExternally("https://notificationsounds.com/notification-sounds/unsure-566")
}
}
}

View file

@ -14,6 +14,13 @@ Page {
// Tell SilicaFlickable the height of its content.
contentHeight: column.height
PullDownMenu {
MenuItem {
text: qsTr("About...")
onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml"))
}
}
// Place our content in a Column. The PageHeader is always placed at the top
// of the page, followed by our content.
Column {