summaryrefslogtreecommitdiff
path: root/rockwork/qml/CoverPage.qml
blob: 962e8761dd7c3a21599acb68204702146eeee8b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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();
                }
            }
        }
    }
}