From 1cdacce135cad31c2a8d75b95f742c47038211ee Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sat, 27 Sep 2014 17:20:54 +0200 Subject: add a few icons for some notifications --- src/controller.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/controller.cpp') 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; -- cgit v1.2.3