diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2016-02-17 20:41:52 +0100 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2016-02-17 20:41:52 +0100 |
| commit | 0f3d090bd1dc9a6b912eb0b1e587602573304b4a (patch) | |
| tree | aa52d58d9ba119d20d491a37595c3fa4f3458980 /rockwork/qml/CoverPage.qml | |
| parent | 07fb609095291f8d8544441925dea3d60d636f87 (diff) | |
First attempt at QML hacking.
Main and ServiceControl adapted. Project files
Diffstat (limited to 'rockwork/qml/CoverPage.qml')
| -rw-r--r-- | rockwork/qml/CoverPage.qml | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/rockwork/qml/CoverPage.qml b/rockwork/qml/CoverPage.qml new file mode 100644 index 0000000..962e876 --- /dev/null +++ b/rockwork/qml/CoverPage.qml @@ -0,0 +1,44 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 + +CoverBackground { + property var pebble: null + Image { + fillMode: Image.PreserveAspectCrop + anchors.fill: parent + source: "back-cover.png" + } + + Label { + id: label + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: state.top + anchors.bottomMargin: Theme.paddingSmall + font.pointSize: Theme.fontSizeExtraLarge + text: pebble.name ? pebble.name : "Pebble" + } + Label { + id: state + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.verticalCenter + font.pointSize: Theme.fontSizeExtraSmall + color: Theme.highlightColor + text: pebble.connected ? qsTr("connected") : qsTr("disconnected") + } + + CoverActionList { + id: coverAction + enabled: pebble.connected + + CoverAction { + iconSource: pebble.connected ? "image://theme/icon-cover-transfers" : "image://theme/icon-cover-sync" + onTriggered: { + if (pebble.connected) { + pebble.requestScreenshot(); + } else { + pebble.reconnect(); + } + } + } + } +} |
