diff options
author | Kevin Smith <git@kismith.co.uk> | 2009-06-18 20:34:41 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2009-06-18 20:35:22 (GMT) |
commit | 9a457c621bd75a9929cc0616b7659dba2945fdac (patch) | |
tree | fa1b7e541355edb1983dea78728892ddf89f08ff /Swift/QtUI/QtSystemTray.cpp | |
parent | 38e83db22eed41e115c1483323a62c62be34dbec (diff) | |
download | swift-contrib-9a457c621bd75a9929cc0616b7659dba2945fdac.zip swift-contrib-9a457c621bd75a9929cc0616b7659dba2945fdac.tar.bz2 |
System Tray
We need to have a look at the icons somewhat, but these will do for the second.
Diffstat (limited to 'Swift/QtUI/QtSystemTray.cpp')
-rw-r--r-- | Swift/QtUI/QtSystemTray.cpp | 21 |
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 |