author | wazlaf <wazlaf> | 2002-09-30 08:07:05 (UTC) |
---|---|---|
committer | wazlaf <wazlaf> | 2002-09-30 08:07:05 (UTC) |
commit | a999acbcd1b8bc1715f2ad2dda6acedf423b89ea (patch) (side-by-side diff) | |
tree | 898d433efa8ff3b25a5d10ab4dc4a0a9bc415104 /noncore/net/opieirc/mainwindow.cpp | |
parent | 75dccdfe90324e9ff2426930ae185c3a6bdab734 (diff) | |
download | opie-a999acbcd1b8bc1715f2ad2dda6acedf423b89ea.zip opie-a999acbcd1b8bc1715f2ad2dda6acedf423b89ea.tar.gz opie-a999acbcd1b8bc1715f2ad2dda6acedf423b89ea.tar.bz2 |
tabs now change their color when actions occur
Diffstat (limited to 'noncore/net/opieirc/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/mainwindow.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp index d78e5ab..fe59c3b 100644 --- a/noncore/net/opieirc/mainwindow.cpp +++ b/noncore/net/opieirc/mainwindow.cpp @@ -12,3 +12,4 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags f) : QMainWindo setCaption(tr("IRC Client")); - m_tabWidget = new QTabWidget(this); + m_tabWidget = new IRCTabWidget(this); + connect(m_tabWidget, SIGNAL(currentChanged(QWidget *)), this, SLOT(selected(QWidget *))); setCentralWidget(m_tabWidget); @@ -39,5 +40,11 @@ void MainWindow::loadSettings() { +void MainWindow::selected(QWidget *) { + m_tabWidget->setTabColor(m_tabWidget->currentPageIndex(), &black); +} + void MainWindow::addTab(IRCTab *tab) { + connect(tab, SIGNAL(changed(IRCTab *)), this, SLOT(changeEvent(IRCTab *))); m_tabWidget->addTab(tab, tab->title()); m_tabWidget->showPage(tab); + tab->setID(m_tabWidget->currentPageIndex()); m_tabs.append(tab); @@ -45,2 +52,7 @@ void MainWindow::addTab(IRCTab *tab) { +void MainWindow::changeEvent(IRCTab *tab) { + if (tab->id() != m_tabWidget->currentPageIndex()) + m_tabWidget->setTabColor(tab->id(), &blue); +} + void MainWindow::killTab(IRCTab *tab) { |