diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-04-12 17:18:09 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-04-12 17:18:09 (GMT) |
commit | b47f2cdbb8c58b2f2051725443da26c3fb88e1a1 (patch) | |
tree | f766360bbcd762704e93c602cc93960d34060761 /Swift/QtUI | |
parent | e34961aa9b20a745af6934c161ab956867602de2 (diff) | |
download | swift-contrib-b47f2cdbb8c58b2f2051725443da26c3fb88e1a1.zip swift-contrib-b47f2cdbb8c58b2f2051725443da26c3fb88e1a1.tar.bz2 |
Flash the taskbar on new messages.
Fixes: #207
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtChatTabs.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatTabs.cpp b/Swift/QtUI/QtChatTabs.cpp index 59a4b66..42c80a7 100644 --- a/Swift/QtUI/QtChatTabs.cpp +++ b/Swift/QtUI/QtChatTabs.cpp @@ -14,6 +14,7 @@ #include <QTabWidget> #include <QLayout> #include <QTabBar> +#include <QApplication> namespace Swift { QtChatTabs::QtChatTabs() : QWidget() { @@ -113,8 +114,9 @@ void QtChatTabs::handleTabTitleUpdated(QWidget* widget) { } tabs_->setTabText(index, widget->windowTitle()); QColor tabTextColor; + bool flash = false; switch (tabbable->getWidgetAlertState()) { - case QtTabbable::WaitingActivity : tabTextColor = QColor(255, 0, 0); break; + case QtTabbable::WaitingActivity : flash = true; tabTextColor = QColor(255, 0, 0); break; case QtTabbable::ImpendingActivity : tabTextColor = QColor(0, 255, 0); break; default : tabTextColor = QColor(-1,-1,-1);//invalid resets to default } @@ -122,6 +124,12 @@ void QtChatTabs::handleTabTitleUpdated(QWidget* widget) { if (widget == tabs_->currentWidget()) { setWindowTitle(widget->windowTitle()); } + + if (flash) { +#ifndef SWIFTEN_PLATFORM_MACOSX + QApplication::alert(this, 3000); +#endif + } } void QtChatTabs::resizeEvent(QResizeEvent*) { |