diff options
Diffstat (limited to 'metawatch')
-rw-r--r-- | metawatch/metawatch.pro | 29 | ||||
-rw-r--r-- | metawatch/metawatch.qrc | 23 | ||||
-rw-r--r-- | metawatch/metawatchdigital.cpp | 24 | ||||
-rw-r--r-- | metawatch/metawatchplugin.cpp | 6 | ||||
-rw-r--r-- | metawatch/qml/MWListView.qml | 59 | ||||
-rw-r--r-- | metawatch/qml/MWTitle.qml | 6 | ||||
-rw-r--r-- | metawatch/res/fonts/metawatch_16pt_11pxl.ttf (renamed from metawatch/metawatch_16pt_11pxl.ttf) | bin | 14576 -> 14576 bytes | |||
-rw-r--r-- | metawatch/res/fonts/metawatch_8pt_5pxl_CAPS.ttf (renamed from metawatch/metawatch_8pt_5pxl_CAPS.ttf) | bin | 12408 -> 12408 bytes | |||
-rw-r--r-- | metawatch/res/fonts/metawatch_8pt_7pxl_CAPS.ttf (renamed from metawatch/metawatch_8pt_7pxl_CAPS.ttf) | bin | 15212 -> 15212 bytes | |||
-rw-r--r-- | metawatch/res/graphics/email.bmp (renamed from metawatch/email.bmp) | bin | 126 -> 126 bytes | |||
-rw-r--r-- | metawatch/res/graphics/idle_call.bmp (renamed from metawatch/idle_call.bmp) | bin | 134 -> 134 bytes | |||
-rw-r--r-- | metawatch/res/graphics/idle_gmail.bmp (renamed from metawatch/idle_gmail.bmp) | bin | 134 -> 134 bytes | |||
-rw-r--r-- | metawatch/res/graphics/idle_sms.bmp (renamed from metawatch/idle_sms.bmp) | bin | 134 -> 134 bytes | |||
-rw-r--r-- | metawatch/res/graphics/message.bmp (renamed from metawatch/message.bmp) | bin | 126 -> 126 bytes | |||
-rw-r--r-- | metawatch/res/graphics/phone.bmp (renamed from metawatch/phone.bmp) | bin | 126 -> 126 bytes | |||
-rw-r--r-- | metawatch/res/graphics/play.bmp (renamed from metawatch/play.bmp) | bin | 126 -> 126 bytes | |||
-rw-r--r-- | metawatch/res/graphics/timer.bmp (renamed from metawatch/timer.bmp) | bin | 126 -> 126 bytes | |||
-rw-r--r-- | metawatch/res/graphics/weather_cloudy.bmp (renamed from metawatch/weather_cloudy.bmp) | bin | 158 -> 158 bytes | |||
-rw-r--r-- | metawatch/res/graphics/weather_rain.bmp (renamed from metawatch/weather_rain.bmp) | bin | 158 -> 158 bytes | |||
-rw-r--r-- | metawatch/res/graphics/weather_snow.bmp (renamed from metawatch/weather_snow.bmp) | bin | 158 -> 158 bytes | |||
-rw-r--r-- | metawatch/res/graphics/weather_sunny.bmp (renamed from metawatch/weather_sunny.bmp) | bin | 158 -> 158 bytes | |||
-rw-r--r-- | metawatch/res/graphics/weather_thunderstorm.bmp (renamed from metawatch/weather_thunderstorm.bmp) | bin | 158 -> 158 bytes | |||
-rw-r--r-- | metawatch/res/graphics/weather_wind.bmp (renamed from metawatch/weather_wind.bmp) | bin | 158 -> 158 bytes |
23 files changed, 92 insertions, 55 deletions
diff --git a/metawatch/metawatch.pro b/metawatch/metawatch.pro index f48cfe0..d0ffddf 100644 --- a/metawatch/metawatch.pro +++ b/metawatch/metawatch.pro @@ -30,22 +30,8 @@ HEADERS += metawatchplugin.h \ FORMS += \ metawatchsimulatorform.ui -RESOURCES += \ - metawatch.qrc - -OTHER_FILES += \ - idle_sms.bmp \ - idle_gmail.bmp \ - idle_call.bmp \ - weather_wind.bmp \ - weather_thunderstorm.bmp \ - weather_sunny.bmp \ - weather_snow.bmp \ - weather_rain.bmp \ - weather_cloudy.bmp \ - metawatch_16pt_11pxl.ttf \ - metawatch_8pt_7pxl_CAPS.ttf \ - metawatch_8pt_5pxl_CAPS.ttf +res_files.files += res/graphics res/fonts +qml_files.files += qml/MWListView.qml 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 @@ -69,8 +55,17 @@ unix:!symbian { !isEmpty(MEEGO_VERSION_MAJOR)|maemo5 { QMAKE_RPATHDIR += /opt/sowatch/lib target.path = /opt/sowatch/lib/drivers + res_files.path = /opt/sowatch/share/metawatch + qml_files.path = /opt/sowatch/qml/metawatch } else { target.path = /usr/lib/sowatch/drivers + res_files.path = /usr/share/sowatch/metawatch + qml_files.path = /usr/share/sowatch/qml/metawatch } - INSTALLS += target + INSTALLS += target res_files qml_files } + +OTHER_FILES += \ + qml/MWTitle.qml + + diff --git a/metawatch/metawatch.qrc b/metawatch/metawatch.qrc deleted file mode 100644 index 821a3dc..0000000 --- a/metawatch/metawatch.qrc +++ /dev/null @@ -1,23 +0,0 @@ -<RCC> - <qresource prefix="/metawatch/graphics"> - <file>idle_call.bmp</file> - <file>idle_gmail.bmp</file> - <file>idle_sms.bmp</file> - <file>weather_cloudy.bmp</file> - <file>weather_rain.bmp</file> - <file>weather_snow.bmp</file> - <file>weather_sunny.bmp</file> - <file>weather_thunderstorm.bmp</file> - <file>weather_wind.bmp</file> - <file>email.bmp</file> - <file>message.bmp</file> - <file>phone.bmp</file> - <file>play.bmp</file> - <file>timer.bmp</file> - </qresource> - <qresource prefix="/metawatch/fonts"> - <file>metawatch_8pt_5pxl_CAPS.ttf</file> - <file>metawatch_8pt_7pxl_CAPS.ttf</file> - <file>metawatch_16pt_11pxl.ttf</file> - </qresource> -</RCC> diff --git a/metawatch/metawatchdigital.cpp b/metawatch/metawatchdigital.cpp index f35eab0..b91b370 100644 --- a/metawatch/metawatchdigital.cpp +++ b/metawatch/metawatchdigital.cpp @@ -143,9 +143,9 @@ void MetaWatchDigital::clear(Mode mode, bool black) void MetaWatchDigital::renderIdleScreen() { - QImage idle_call(QString(":/metawatch/graphics/idle_call.bmp")); - QImage idle_sms(QString(":/metawatch/graphics/idle_sms.bmp")); - QImage idle_mail(QString(":/metawatch/graphics/idle_gmail.bmp")); + QImage idle_call(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_call.bmp")); + QImage idle_sms(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_sms.bmp")); + QImage idle_mail(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_gmail.bmp")); QPainter p; _paintMode = IdleMode; @@ -204,17 +204,17 @@ QImage MetaWatchDigital::iconForWeather(WeatherNotification::WeatherType w) { switch (w) { case WeatherNotification::Sunny: - return QImage(QString(":/metawatch/graphics/weather_sunny.bmp")); + return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/weather_sunny.bmp")); case WeatherNotification::PartlyCloudy: case WeatherNotification::Cloudy: case WeatherNotification::Fog: - return QImage(QString(":/metawatch/graphics/weather_cloudy.bmp")); + return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/weather_cloudy.bmp")); case WeatherNotification::Rain: - return QImage(QString(":/metawatch/graphics/weather_rain.bmp")); + return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/weather_rain.bmp")); case WeatherNotification::Thunderstorm: - return QImage(QString(":/metawatch/graphics/weather_thunderstorm.bmp")); + return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/weather_thunderstorm.bmp")); case WeatherNotification::Snow: - return QImage(QString(":/metawatch/graphics/weather_snow.bmp")); + return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/weather_snow.bmp")); default: return QImage(); } @@ -313,18 +313,18 @@ QImage MetaWatchDigital::iconForNotification(const Notification *n) switch (n->type()) { case Notification::CallNotification: case Notification::MissedCallNotification: - return QImage(QString(":/metawatch/graphics/phone.bmp")); + return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/phone.bmp")); break; case Notification::SmsNotification: case Notification::MmsNotification: case Notification::ImNotification: - return QImage(QString(":/metawatch/graphics/message.bmp")); + return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/message.bmp")); break; case Notification::EmailNotification: - return QImage(QString(":/metawatch/graphics/email.bmp")); + return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/email.bmp")); break; case Notification::CalendarNotification: - return QImage(QString(":/metawatch/graphics/timer.bmp")); + return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/timer.bmp")); break; default: return QImage(); diff --git a/metawatch/metawatchplugin.cpp b/metawatch/metawatchplugin.cpp index 5e649a9..523230b 100644 --- a/metawatch/metawatchplugin.cpp +++ b/metawatch/metawatchplugin.cpp @@ -13,9 +13,9 @@ bool MetaWatchPlugin::fontsLoaded = false; MetaWatchPlugin::MetaWatchPlugin() { if (!fontsLoaded) { - QFontDatabase::addApplicationFont(":/metawatch/fonts/metawatch_16pt_11pxl.ttf"); - QFontDatabase::addApplicationFont(":/metawatch/fonts/metawatch_8pt_7pxl_CAPS.ttf"); - QFontDatabase::addApplicationFont(":/metawatch/fonts/metawatch_8pt_5pxl_CAPS.ttf"); + QFontDatabase::addApplicationFont(SOWATCH_RESOURCES_DIR "/metawatch/fonts/metawatch_16pt_11pxl.ttf"); + QFontDatabase::addApplicationFont(SOWATCH_RESOURCES_DIR "/metawatch/fonts/metawatch_8pt_7pxl_CAPS.ttf"); + QFontDatabase::addApplicationFont(SOWATCH_RESOURCES_DIR "/metawatch/fonts/metawatch_8pt_5pxl_CAPS.ttf"); // "MetaWatch Large 16pt", "MetaWatch Large caps 8pt", "MetaWatch Small caps 8pt" fontsLoaded = true; } diff --git a/metawatch/qml/MWListView.qml b/metawatch/qml/MWListView.qml new file mode 100644 index 0000000..e49905b --- /dev/null +++ b/metawatch/qml/MWListView.qml @@ -0,0 +1,59 @@ +import QtQuick 1.0 + +ListView { + id: list + + property bool selectable: true + + //interactive: false + highlightFollowsCurrentItem: false + boundsBehavior: Flickable.StopAtBounds + + property real currentItemTop: currentItem.y - contentY + property real currentItemBottom: currentItemTop + currentItem.height + + function _scrollSelectable(dir) { + var maxy = contentHeight - height; + if (maxy < 0) maxy = 0; + + console.log(contentHeight); + + var newy = contentY; + + if (dir > 0) { + if (currentIndex < count && currentItemBottom < height) { + // If the next item is visible, highlight it + list.incrementCurrentIndex(); + } + if (currentItemBottom >= height) { + // If the next item now is still not visible, scroll + newy += 96/3; + } + } else { + if (currentIndex >= 0 && currentItemTop > 0) { + // If the previous item is visible, highlight it + list.decrementCurrentIndex(); + } + if (currentItemTop <= 0) { + // If the previous item now is still not visible, scroll + newy -= 96/3; + } + } + + //if (newy < 0) newy = 0; + //if (newy > maxy) newy = maxy; + list.contentY = newy; + } + + function scrollDown() { + if (selectable) { + _scrollSelectable(+1); + } + } + + function scrollUp() { + if (selectable) { + _scrollSelectable(-1); + } + } +} diff --git a/metawatch/qml/MWTitle.qml b/metawatch/qml/MWTitle.qml new file mode 100644 index 0000000..44f4f70 --- /dev/null +++ b/metawatch/qml/MWTitle.qml @@ -0,0 +1,6 @@ +import QtQuick 1.0 + +Rectangle { + width: 100 + height: 62 +} diff --git a/metawatch/metawatch_16pt_11pxl.ttf b/metawatch/res/fonts/metawatch_16pt_11pxl.ttf Binary files differindex 9aeb8b3..9aeb8b3 100644 --- a/metawatch/metawatch_16pt_11pxl.ttf +++ b/metawatch/res/fonts/metawatch_16pt_11pxl.ttf diff --git a/metawatch/metawatch_8pt_5pxl_CAPS.ttf b/metawatch/res/fonts/metawatch_8pt_5pxl_CAPS.ttf Binary files differindex a6b8f30..a6b8f30 100644 --- a/metawatch/metawatch_8pt_5pxl_CAPS.ttf +++ b/metawatch/res/fonts/metawatch_8pt_5pxl_CAPS.ttf diff --git a/metawatch/metawatch_8pt_7pxl_CAPS.ttf b/metawatch/res/fonts/metawatch_8pt_7pxl_CAPS.ttf Binary files differindex 72eda9e..72eda9e 100644 --- a/metawatch/metawatch_8pt_7pxl_CAPS.ttf +++ b/metawatch/res/fonts/metawatch_8pt_7pxl_CAPS.ttf diff --git a/metawatch/email.bmp b/metawatch/res/graphics/email.bmp Binary files differindex 7c895af..7c895af 100644 --- a/metawatch/email.bmp +++ b/metawatch/res/graphics/email.bmp diff --git a/metawatch/idle_call.bmp b/metawatch/res/graphics/idle_call.bmp Binary files differindex 2b69eea..2b69eea 100644 --- a/metawatch/idle_call.bmp +++ b/metawatch/res/graphics/idle_call.bmp diff --git a/metawatch/idle_gmail.bmp b/metawatch/res/graphics/idle_gmail.bmp Binary files differindex fd129b0..fd129b0 100644 --- a/metawatch/idle_gmail.bmp +++ b/metawatch/res/graphics/idle_gmail.bmp diff --git a/metawatch/idle_sms.bmp b/metawatch/res/graphics/idle_sms.bmp Binary files differindex 095ca62..095ca62 100644 --- a/metawatch/idle_sms.bmp +++ b/metawatch/res/graphics/idle_sms.bmp diff --git a/metawatch/message.bmp b/metawatch/res/graphics/message.bmp Binary files differindex 53605b8..53605b8 100644 --- a/metawatch/message.bmp +++ b/metawatch/res/graphics/message.bmp diff --git a/metawatch/phone.bmp b/metawatch/res/graphics/phone.bmp Binary files differindex a9da9d8..a9da9d8 100644 --- a/metawatch/phone.bmp +++ b/metawatch/res/graphics/phone.bmp diff --git a/metawatch/play.bmp b/metawatch/res/graphics/play.bmp Binary files differindex f6f507c..f6f507c 100644 --- a/metawatch/play.bmp +++ b/metawatch/res/graphics/play.bmp diff --git a/metawatch/timer.bmp b/metawatch/res/graphics/timer.bmp Binary files differindex 20ae04d..20ae04d 100644 --- a/metawatch/timer.bmp +++ b/metawatch/res/graphics/timer.bmp diff --git a/metawatch/weather_cloudy.bmp b/metawatch/res/graphics/weather_cloudy.bmp Binary files differindex 506c24a..506c24a 100644 --- a/metawatch/weather_cloudy.bmp +++ b/metawatch/res/graphics/weather_cloudy.bmp diff --git a/metawatch/weather_rain.bmp b/metawatch/res/graphics/weather_rain.bmp Binary files differindex fc12c6e..fc12c6e 100644 --- a/metawatch/weather_rain.bmp +++ b/metawatch/res/graphics/weather_rain.bmp diff --git a/metawatch/weather_snow.bmp b/metawatch/res/graphics/weather_snow.bmp Binary files differindex d328105..d328105 100644 --- a/metawatch/weather_snow.bmp +++ b/metawatch/res/graphics/weather_snow.bmp diff --git a/metawatch/weather_sunny.bmp b/metawatch/res/graphics/weather_sunny.bmp Binary files differindex df9f774..df9f774 100644 --- a/metawatch/weather_sunny.bmp +++ b/metawatch/res/graphics/weather_sunny.bmp diff --git a/metawatch/weather_thunderstorm.bmp b/metawatch/res/graphics/weather_thunderstorm.bmp Binary files differindex f101610..f101610 100644 --- a/metawatch/weather_thunderstorm.bmp +++ b/metawatch/res/graphics/weather_thunderstorm.bmp diff --git a/metawatch/weather_wind.bmp b/metawatch/res/graphics/weather_wind.bmp Binary files differindex 59bd81b..59bd81b 100644 --- a/metawatch/weather_wind.bmp +++ b/metawatch/res/graphics/weather_wind.bmp |