summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtSystemTray.cpp')
-rw-r--r--Swift/QtUI/QtSystemTray.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/Swift/QtUI/QtSystemTray.cpp b/Swift/QtUI/QtSystemTray.cpp
new file mode 100644
index 0000000..b22da6b
--- /dev/null
+++ b/Swift/QtUI/QtSystemTray.cpp
@@ -0,0 +1,21 @@
+#include "Swift/QtUI/QtSystemTray.h"
+
+#include <QIcon>
+#include <QPixmap>
+#include <QResource>
+
+namespace Swift {
+QtSystemTray::QtSystemTray() : standardIcon_(":icons/tray-standard.png"), newMessageIcon_(":icons/new-chat.png") {
+ trayIcon_ = new QSystemTrayIcon(standardIcon_);
+ trayIcon_->show();
+}
+
+QtSystemTray::~QtSystemTray() {
+ delete trayIcon_;
+}
+
+void QtSystemTray::setUnreadMessages(bool some) {
+ trayIcon_->setIcon(some ? newMessageIcon_ : standardIcon_);
+}
+
+} \ No newline at end of file