diff options
author | Kevin Smith <git@kismith.co.uk> | 2009-12-19 19:52:05 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2009-12-19 19:52:05 (GMT) |
commit | ca44245623972e6d52fe72acca09a96772d7e26a (patch) | |
tree | 6639114733f2769269080efadb24080216745fd6 /Swift/QtUI/QtChatTabs.cpp | |
parent | bdb8ace202917809c5492aa37921e0ffd0354730 (diff) | |
download | swift-contrib-ca44245623972e6d52fe72acca09a96772d7e26a.zip swift-contrib-ca44245623972e6d52fe72acca09a96772d7e26a.tar.bz2 |
Colour tabs with waiting messages.
Resolves: #278
Diffstat (limited to 'Swift/QtUI/QtChatTabs.cpp')
-rw-r--r-- | Swift/QtUI/QtChatTabs.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatTabs.cpp b/Swift/QtUI/QtChatTabs.cpp index f9a42a4..6e5c55d 100644 --- a/Swift/QtUI/QtChatTabs.cpp +++ b/Swift/QtUI/QtChatTabs.cpp @@ -7,10 +7,11 @@ #include <QtGlobal> #include <QTabWidget> #include <QLayout> +#include <QTabBar> namespace Swift { QtChatTabs::QtChatTabs() : QWidget() { - tabs_ = new QTabWidget(this); + tabs_ = new QtTabWidget(this); #if QT_VERSION >= 0x040500 /*For Macs, change the tab rendering.*/ tabs_->setDocumentMode(true); @@ -97,11 +98,13 @@ void QtChatTabs::handleTabTitleUpdated(QWidget* widget) { if (!widget) { return; } + QtTabbable* tabbable = qobject_cast<QtTabbable*>(widget); int index = tabs_->indexOf(widget); if (index < 0) { return; } tabs_->setTabText(index, widget->windowTitle()); + tabs_->tabBar()->setTabTextColor(index, tabbable->isWidgetAlerting() ? QColor(255,0,0) : QColor(-1,-1,-1)); //invalid resets to default if (widget == tabs_->currentWidget()) { setWindowTitle(widget->windowTitle()); } |