From 6d64f7d6330a42dd57cafcb869dfab34c75ed3bc Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sat, 15 Jun 2013 21:31:06 +0200 Subject: add new icons for liveview watchlets --- nekowatchlet/nekowatchlet.pro | 3 - qmafwwatchlet/liveview.qml | 123 ++++++++++++++++++++++++ qmafwwatchlet/metawatch-digital-icon.png | Bin 0 -> 188 bytes qmafwwatchlet/qmafwwatchlet.pro | 4 +- qmapwatchlet/compass-liveview-icon.png | Bin 0 -> 1762 bytes qmapwatchlet/compass-liveview.qml | 15 +++ qmapwatchlet/compass-metawatch-digital-icon.png | Bin 0 -> 226 bytes qmapwatchlet/qmapwatchlet.pro | 6 +- qmsgwatchlet/qmsgwatchlet.pro | 2 +- qorgwatchlet/qorgwatchlet.pro | 2 +- sysinfowatchlet/sysinfowatchlet.pro | 2 +- 11 files changed, 146 insertions(+), 11 deletions(-) create mode 100644 qmafwwatchlet/liveview.qml create mode 100644 qmafwwatchlet/metawatch-digital-icon.png create mode 100644 qmapwatchlet/compass-liveview-icon.png create mode 100644 qmapwatchlet/compass-liveview.qml create mode 100644 qmapwatchlet/compass-metawatch-digital-icon.png diff --git a/nekowatchlet/nekowatchlet.pro b/nekowatchlet/nekowatchlet.pro index 5777390..91b1f18 100644 --- a/nekowatchlet/nekowatchlet.pro +++ b/nekowatchlet/nekowatchlet.pro @@ -26,6 +26,3 @@ unix:!symbian { } INSTALLS += target qml_files } - -OTHER_FILES += \ - liveview.qml diff --git a/qmafwwatchlet/liveview.qml b/qmafwwatchlet/liveview.qml new file mode 100644 index 0000000..23273eb --- /dev/null +++ b/qmafwwatchlet/liveview.qml @@ -0,0 +1,123 @@ +import QtQuick 1.0 + +Rectangle { + width: 128 + height: 128 + + color: "black" + + Image { + id: mediaart + anchors.fill: parent + fillMode: Image.PreserveAspectFit + smooth: true + source: player.mediaArt + } + + Rectangle { + x: 0 + width: parent.width + height: 14 + anchors.bottom: parent.bottom + color: "black" + + Text { + anchors.fill: parent + text: player.title.length > 0 ? player.title : qsTr("No media"); + color: "white" + } + } + + Rectangle { + id: volumeBar + width: 18 + + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.right: parent.right + + color: "white" + + visible: false + + Image { + id: volumeIcon + anchors.top: parent.top + anchors.left: parent.left + anchors.leftMargin: 2 + + source: "volume.png" + } + + Rectangle { + id: volumeBarBox + + anchors.top: volumeIcon.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.leftMargin: 2 + + color: "black" + + Rectangle { + id: volumeBarThing + + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.margins: 4 + + height: volumeBar.visible ? + (volumeControl.volume * (parent.height - anchors.margins*2)) / (volumeControl.max - volumeControl.min) : + 0; // Avoid unnecessary updates when not visible. + + color: "white" + } + } + + Timer { + id: autoHideTimer + interval: 3000 + repeat: false + onTriggered: { + volumeBar.visible = false; + } + } + + function show() { + volumeBar.visible = true; + autoHideTimer.restart(); + } + } + + Connections { + target: watch + onButtonPressed : { + switch(button) { + case 0: { + player.playPause(); + break; + } + case 1: { + volumeControl.up(); + volumeBar.show(); + break; + } + case 2: { + volumeControl.down(); + volumeBar.show(); + break; + } + case 3: { + player.previous(); + break; + } + case 4: { + player.next(); + break; + } + } + } + } +} diff --git a/qmafwwatchlet/metawatch-digital-icon.png b/qmafwwatchlet/metawatch-digital-icon.png new file mode 100644 index 0000000..8b8dac4 Binary files /dev/null and b/qmafwwatchlet/metawatch-digital-icon.png differ diff --git a/qmafwwatchlet/qmafwwatchlet.pro b/qmafwwatchlet/qmafwwatchlet.pro index 8dc89d4..fdd529d 100644 --- a/qmafwwatchlet/qmafwwatchlet.pro +++ b/qmafwwatchlet/qmafwwatchlet.pro @@ -15,7 +15,9 @@ HEADERS += qmafwwatchlet.h \ qmafwwatchletplayer.h \ qmafwwatchletvolumecontrol.h -qml_files.files = metawatch-digital.qml icon.png volume.png +qml_files.files = icon.png volume.png \ + metawatch-digital.qml metawatch-digital-icon.png \ + liveview.qml liveview-icon.png LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch INCLUDEPATH += $$PWD/../libsowatch diff --git a/qmapwatchlet/compass-liveview-icon.png b/qmapwatchlet/compass-liveview-icon.png new file mode 100644 index 0000000..bb48368 Binary files /dev/null and b/qmapwatchlet/compass-liveview-icon.png differ diff --git a/qmapwatchlet/compass-liveview.qml b/qmapwatchlet/compass-liveview.qml new file mode 100644 index 0000000..60a6aa6 --- /dev/null +++ b/qmapwatchlet/compass-liveview.qml @@ -0,0 +1,15 @@ +import QtQuick 1.0 +import com.javispedro.sowatch.qmap 1.0 + +Rectangle { + color: "black" + + CompassView { + anchors.centerIn: parent + id: compass + updateEnabled: watch.active + updateInterval: 3000 + width: 36 + height: 36 + } +} diff --git a/qmapwatchlet/compass-metawatch-digital-icon.png b/qmapwatchlet/compass-metawatch-digital-icon.png new file mode 100644 index 0000000..65e7254 Binary files /dev/null and b/qmapwatchlet/compass-metawatch-digital-icon.png differ diff --git a/qmapwatchlet/qmapwatchlet.pro b/qmapwatchlet/qmapwatchlet.pro index 240beac..7b655b1 100644 --- a/qmapwatchlet/qmapwatchlet.pro +++ b/qmapwatchlet/qmapwatchlet.pro @@ -13,7 +13,8 @@ HEADERS += qmapwatchletplugin.h qmapwatchlet.h mapview.h \ qml_files.files = map-metawatch-digital.qml map-liveview.qml \ map-icon.png map-metawatch-digital-icon.png map-liveview-icon.png arrow.png \ - compass-metawatch-digital.qml compass-icon.png compass.png + compass-metawatch-digital.qml compass-liveview.qml \ + compass-icon.png compass-metawatch-digital-icon.png compass-liveview-icon.png compass.png LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch INCLUDEPATH += $$PWD/../libsowatch @@ -30,6 +31,3 @@ unix:!symbian { } INSTALLS += target qml_files } - -OTHER_FILES += \ - map-liveview.qml diff --git a/qmsgwatchlet/qmsgwatchlet.pro b/qmsgwatchlet/qmsgwatchlet.pro index 9e18e42..9a60dbb 100644 --- a/qmsgwatchlet/qmsgwatchlet.pro +++ b/qmsgwatchlet/qmsgwatchlet.pro @@ -8,7 +8,7 @@ SOURCES += qmsgwatchletplugin.cpp qmsgwatchlet.cpp HEADERS += qmsgwatchletplugin.h qmsgwatchlet.h -qml_files.files = metawatch-digital.qml icon.png +qml_files.files = metawatch-digital.qml icon.png metawatch-digital-icon.png liveview-icon.png LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch diff --git a/qorgwatchlet/qorgwatchlet.pro b/qorgwatchlet/qorgwatchlet.pro index 4affbee..842717f 100644 --- a/qorgwatchlet/qorgwatchlet.pro +++ b/qorgwatchlet/qorgwatchlet.pro @@ -8,7 +8,7 @@ SOURCES += qorgwatchletplugin.cpp qorgwatchlet.cpp HEADERS += qorgwatchletplugin.h qorgwatchlet.h -qml_files.files = metawatch-digital.qml icon.png +qml_files.files = metawatch-digital.qml icon.png metawatch-digital-icon.png liveview-icon.png LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch diff --git a/sysinfowatchlet/sysinfowatchlet.pro b/sysinfowatchlet/sysinfowatchlet.pro index 3b3087b..1af927b 100644 --- a/sysinfowatchlet/sysinfowatchlet.pro +++ b/sysinfowatchlet/sysinfowatchlet.pro @@ -15,7 +15,7 @@ SOURCES += sysinfoplugin.cpp sysinfowatchlet.cpp HEADERS += sysinfoplugin.h sysinfowatchlet.h -qml_files.files = metawatch-digital.qml icon.png +qml_files.files = metawatch-digital.qml icon.png metawatch-digital-icon.png liveview-icon.png LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch -- cgit v1.2.3