diff options
author | Javier S. Pedro <dev.git@javispedro.com> | 2014-09-27 17:20:54 +0200 |
---|---|---|
committer | Javier S. Pedro <dev.git@javispedro.com> | 2014-09-27 17:20:54 +0200 |
commit | 1cdacce135cad31c2a8d75b95f742c47038211ee (patch) | |
tree | c08a24ab2ae0ded13fceb17672773872cde002f1 /src/controller.cpp | |
parent | 51bbe08bbe6093fedc5d265524167bd9fde3682b (diff) | |
download | salmeta-1cdacce135cad31c2a8d75b95f742c47038211ee.tar.gz salmeta-1cdacce135cad31c2a8d75b95f742c47038211ee.zip |
add a few icons for some notifications
Diffstat (limited to 'src/controller.cpp')
-rw-r--r-- | src/controller.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/controller.cpp b/src/controller.cpp index 0a502da..35d6dae 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -239,8 +239,11 @@ void Controller::handleIncomingNotification(const QString &sender, const QIcon & QFont large("MetaWatch Large 16pt"); large.setPixelSize(16); + // Render notification background p.drawImage(0, 0, QImage(SailfishApp::pathTo("qml/watch/notification.png").toLocalFile())); - icon.paint(&p, 0, 96 - 24, 24, 24, Qt::AlignLeft | Qt::AlignBottom); + + // Render the associated icon on the bottom left corner + icon.paint(&p, 0, 96 - 24, 28, 24, Qt::AlignLeft | Qt::AlignBottom); QString title = summary; bool title_drawn_fully = false; @@ -248,6 +251,7 @@ void Controller::handleIncomingNotification(const QString &sender, const QIcon & title = QString("%1 %2").arg(count).arg(summary); } + // Render title area p.setFont(large); if (!title.isEmpty()) { QRect area(2, 2, 96 - 18, 18); @@ -264,6 +268,8 @@ void Controller::handleIncomingNotification(const QString &sender, const QIcon & const int max_y = 96 - 24; int y = 26; + // Now render the contents + // If the title did not fit in the title area, also draw it fully here. p.setFont(small); if (!title_drawn_fully && !title.isEmpty()) { QRect r; |