Diffstat (limited to 'noncore/net/opieirc/mainwindow.cpp') (more/less context) (show 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 @@ -9,9 +9,10 @@ #include "ircsettings.h" MainWindow::MainWindow(QWidget *parent, const char *name, WFlags f) : QMainWindow(parent, name, f) { 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); setToolBarsMovable(FALSE); QPEMenuBar *menuBar = new QPEMenuBar(this); QPopupMenu *irc = new QPopupMenu(this); @@ -36,14 +37,25 @@ void MainWindow::loadSettings() { IRCTab::m_serverColor = config.readEntry("ServerColor", "#0000FF"); IRCTab::m_notificationColor = config.readEntry("NotificationColor", "#AA3300"); } +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); } +void MainWindow::changeEvent(IRCTab *tab) { + if (tab->id() != m_tabWidget->currentPageIndex()) + m_tabWidget->setTabColor(tab->id(), &blue); +} + void MainWindow::killTab(IRCTab *tab) { m_tabWidget->removePage(tab); m_tabs.remove(tab); /* there might be nicer ways to do this .. */ |