summaryrefslogtreecommitdiff
path: root/qmafwwatchlet/metawatch-digital.qml
blob: e5a6eb4c8ea5d83f10c5018ccf1e31f732e594e5 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import QtQuick 1.0
import com.javispedro.sowatch.metawatch 1.0

Rectangle {
	width: 96
	height: 96

	color: "white"

	MWTitle {
		anchors.top: parent.top
		anchors.left: parent.left
		anchors.right: parent.right
		visible: player.mediaArt.length == 0
		text: qsTr("Music")
		icon.source: "icon.png"
	}

	Image {
		anchors.fill: parent
		fillMode: Image.PreserveAspectFit
		smooth: true
		source: player.mediaArt
	}

	Rectangle {
		x: 0
		width: parent.width
		height: 14
		anchors.bottom: parent.bottom
		color: "white"

		Text {
			anchors.fill: parent
			text: player.title.length > 0 ? player.title : qsTr("No media");
			color: "black"
		}
	}

	Connections {
		target: watch
		onButtonPressed : {
			switch(button) {
			case 1:
				player.volumeUp();
				break;
			case 2:
				player.volumeDown();
				break;
			case 4:
				player.playPause();
				break;
			case 5:
				player.next();
				break;
			}
		}
	}
}