From 989b0c15d56472dd430edb378315d5c40bc91d08 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Tue, 3 Jan 2012 19:04:30 +0100 Subject: adding icons to mw watchlet titles --- .../com/javispedro/sowatch/metawatch/MWTitle.qml | 20 +++++++++++++------- notificationswatchlet/icon.png | Bin 0 -> 3241 bytes notificationswatchlet/metawatch-digital.qml | 3 ++- notificationswatchlet/notificationswatchlet.pro | 2 +- sysinfowatchlet/icon.png | Bin 0 -> 3237 bytes sysinfowatchlet/metawatch-digital.qml | 2 ++ sysinfowatchlet/sysinfowatchlet.pro | 2 +- 7 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 notificationswatchlet/icon.png create mode 100644 sysinfowatchlet/icon.png diff --git a/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml b/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml index 5369c18..3f31130 100644 --- a/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml +++ b/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml @@ -5,13 +5,19 @@ Rectangle { height: 16 property alias text: label.text + property alias icon: image - Row { - anchors.fill: parent - anchors.margins: 1 - Text { - id: label - font.bold: true - } + Image { + id: image + anchors.left: parent.left + anchors.top: parent.top + } + + Text { + id: label + anchors.left: image.right + anchors.leftMargin: 2 + anchors.verticalCenter: parent + font.bold: true } } diff --git a/notificationswatchlet/icon.png b/notificationswatchlet/icon.png new file mode 100644 index 0000000..ba4ba96 Binary files /dev/null and b/notificationswatchlet/icon.png differ diff --git a/notificationswatchlet/metawatch-digital.qml b/notificationswatchlet/metawatch-digital.qml index a298395..493cc96 100644 --- a/notificationswatchlet/metawatch-digital.qml +++ b/notificationswatchlet/metawatch-digital.qml @@ -9,10 +9,11 @@ Rectangle { MWTitle { id: title - text: qsTr("Notifications") anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right + text: qsTr("Notifications") + icon.source: "icon.png" } MWListView { diff --git a/notificationswatchlet/notificationswatchlet.pro b/notificationswatchlet/notificationswatchlet.pro index 865fa3b..eafd756 100644 --- a/notificationswatchlet/notificationswatchlet.pro +++ b/notificationswatchlet/notificationswatchlet.pro @@ -7,7 +7,7 @@ SOURCES += notificationswatchletplugin.cpp notificationswatchlet.cpp HEADERS += notificationswatchletplugin.h notificationswatchlet.h -qml_files.files = metawatch-digital.qml +qml_files.files = metawatch-digital.qml icon.png win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../libsowatch/release/ -lsowatch else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../libsowatch/debug/ -lsowatch diff --git a/sysinfowatchlet/icon.png b/sysinfowatchlet/icon.png new file mode 100644 index 0000000..137d583 Binary files /dev/null and b/sysinfowatchlet/icon.png differ diff --git a/sysinfowatchlet/metawatch-digital.qml b/sysinfowatchlet/metawatch-digital.qml index 67486ba..1e6acfb 100644 --- a/sysinfowatchlet/metawatch-digital.qml +++ b/sysinfowatchlet/metawatch-digital.qml @@ -13,10 +13,12 @@ Rectangle { MWTitle { id: title text: qsTr("Phone Info") + icon.source: "icon.png" } Column { spacing: 4 + width: 96 Text { text: "Battery: " + batteryLevel + "%" diff --git a/sysinfowatchlet/sysinfowatchlet.pro b/sysinfowatchlet/sysinfowatchlet.pro index 96af06a..70fd3f7 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 +qml_files.files = metawatch-digital.qml icon.png win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../libsowatch/release/ -lsowatch else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../libsowatch/debug/ -lsowatch -- cgit v1.2.3