bigger toolboxes. chat --> left
This commit is contained in:
@@ -51,13 +51,13 @@ void Chat::receiveMessage(QString playerName, QString message) {
|
||||
|
||||
void Chat::checkInvisible() {
|
||||
|
||||
switch (myW->tabWidget->currentIndex()) {
|
||||
switch (myW->tabWidget_Left->currentIndex()) {
|
||||
|
||||
case 1: { myW->tabWidget->stopBlinkChatTab();
|
||||
myW->tabWidget->showDefaultChatTab();
|
||||
case 1: { myW->tabWidget_Left->stopBlinkChatTab();
|
||||
myW->tabWidget_Left->showDefaultChatTab();
|
||||
}
|
||||
break;
|
||||
default: { myW->tabWidget->startBlinkChatTab(); }
|
||||
default: { myW->tabWidget_Left->startBlinkChatTab(); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -558,7 +558,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
||||
connect ( horizontalSlider_speed, SIGNAL( valueChanged(int)), this, SLOT ( setGameSpeed(int) ) );
|
||||
connect ( pushButton_break, SIGNAL( clicked()), this, SLOT ( breakButtonClicked() ) ); // auch wieder starten!!!!
|
||||
|
||||
connect( tabWidget, SIGNAL( currentChanged(int) ), this, SLOT( tabSwitchAction() ) );
|
||||
connect( tabWidget_Left, SIGNAL( currentChanged(int) ), this, SLOT( tabSwitchAction() ) );
|
||||
connect( lineEdit_ChatInput, SIGNAL( returnPressed () ), this, SLOT( sendChatMessage() ) );
|
||||
connect( lineEdit_ChatInput, SIGNAL( textChanged (QString) ), this, SLOT( checkChatInputLength(QString) ) );
|
||||
|
||||
@@ -2516,7 +2516,7 @@ void mainWindowImpl::checkChatInputLength(QString string) { myChat->checkInputLe
|
||||
|
||||
void mainWindowImpl::tabSwitchAction() {
|
||||
|
||||
switch(tabWidget->currentIndex()) {
|
||||
switch(tabWidget_Left->currentIndex()) {
|
||||
|
||||
case 1: { lineEdit_ChatInput->setFocus();
|
||||
myChat->checkInvisible();
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// C++ Implementation: MyLeftTabWidget
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#include "mylefttabwidget.h"
|
||||
|
||||
// using namespace std;
|
||||
|
||||
MyLeftTabWidget::MyLeftTabWidget(QGroupBox *parent)
|
||||
: QTabWidget(parent), chatBlinkTimer(0), myTabBar(0)
|
||||
{
|
||||
// fadeOutTimer = new QTimer;
|
||||
// connect(flipCardsTimer, SIGNAL(timeout()), this, SLOT(nextFlipCardsFrame()));
|
||||
myTabBar = this->tabBar();
|
||||
|
||||
chatBlinkTimer = new QTimer;
|
||||
connect(chatBlinkTimer, SIGNAL(timeout()), this, SLOT( blinkChatTab() ));
|
||||
}
|
||||
|
||||
|
||||
MyLeftTabWidget::~MyLeftTabWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void MyLeftTabWidget::startBlinkChatTab() { chatBlinkTimer->start(500); }
|
||||
void MyLeftTabWidget::stopBlinkChatTab() { chatBlinkTimer->stop(); }
|
||||
void MyLeftTabWidget::showDefaultChatTab() { myTabBar->setTabTextColor(1, QColor(240,240,240)); }
|
||||
|
||||
void MyLeftTabWidget::blinkChatTab() {
|
||||
|
||||
if(myTabBar->tabTextColor(1).red() == 240) myTabBar->setTabTextColor(1, QColor(113,162,0));
|
||||
else myTabBar->setTabTextColor(1, QColor(240,240,240));
|
||||
}
|
||||
|
||||
void MyLeftTabWidget::paintEvent(QPaintEvent * event) {
|
||||
|
||||
QTabWidget::paintEvent(event);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// C++ Interface: MyLeftTabWidget
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#ifndef MYLEFTTABWIDGET_H
|
||||
#define MYLEFTTABWIDGET_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QtCore>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class MyLeftTabWidget : public QTabWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MyLeftTabWidget(QGroupBox*);
|
||||
|
||||
~MyLeftTabWidget();
|
||||
|
||||
|
||||
void paintEvent(QPaintEvent * event);
|
||||
void startBlinkChatTab();
|
||||
void stopBlinkChatTab();
|
||||
void showDefaultChatTab();
|
||||
|
||||
public slots:
|
||||
|
||||
void blinkChatTab();
|
||||
|
||||
private:
|
||||
|
||||
QTimer *chatBlinkTimer;
|
||||
QTabBar *myTabBar;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -14,14 +14,14 @@
|
||||
// using namespace std;
|
||||
|
||||
MyRightTabWidget::MyRightTabWidget(QGroupBox *parent)
|
||||
: QTabWidget(parent), chatBlinkTimer(0), myTabBar(0)
|
||||
: QTabWidget(parent), myTabBar(0)
|
||||
{
|
||||
// fadeOutTimer = new QTimer;
|
||||
// connect(flipCardsTimer, SIGNAL(timeout()), this, SLOT(nextFlipCardsFrame()));
|
||||
myTabBar = this->tabBar();
|
||||
|
||||
chatBlinkTimer = new QTimer;
|
||||
connect(chatBlinkTimer, SIGNAL(timeout()), this, SLOT( blinkChatTab() ));
|
||||
// chatBlinkTimer = new QTimer;
|
||||
// connect(chatBlinkTimer, SIGNAL(timeout()), this, SLOT( blinkChatTab() ));
|
||||
}
|
||||
|
||||
|
||||
@@ -29,15 +29,15 @@ MyRightTabWidget::~MyRightTabWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void MyRightTabWidget::startBlinkChatTab() { chatBlinkTimer->start(500); }
|
||||
void MyRightTabWidget::stopBlinkChatTab() { chatBlinkTimer->stop(); }
|
||||
void MyRightTabWidget::showDefaultChatTab() { myTabBar->setTabTextColor(1, QColor(240,240,240)); }
|
||||
// // void MyRightTabWidget::startBlinkChatTab() { chatBlinkTimer->start(500); }
|
||||
// void MyRightTabWidget::stopBlinkChatTab() { chatBlinkTimer->stop(); }
|
||||
// void MyRightTabWidget::showDefaultChatTab() { myTabBar->setTabTextColor(1, QColor(240,240,240)); }
|
||||
|
||||
void MyRightTabWidget::blinkChatTab() {
|
||||
|
||||
if(myTabBar->tabTextColor(1).red() == 240) myTabBar->setTabTextColor(1, QColor(113,162,0));
|
||||
else myTabBar->setTabTextColor(1, QColor(240,240,240));
|
||||
}
|
||||
// void MyRightTabWidget::blinkChatTab() {
|
||||
//
|
||||
// if(myTabBar->tabTextColor(1).red() == 240) myTabBar->setTabTextColor(1, QColor(113,162,0));
|
||||
// else myTabBar->setTabTextColor(1, QColor(240,240,240));
|
||||
// }
|
||||
|
||||
void MyRightTabWidget::paintEvent(QPaintEvent * event) {
|
||||
|
||||
|
||||
@@ -27,17 +27,17 @@ public:
|
||||
|
||||
|
||||
void paintEvent(QPaintEvent * event);
|
||||
void startBlinkChatTab();
|
||||
void stopBlinkChatTab();
|
||||
void showDefaultChatTab();
|
||||
// void startBlinkChatTab();
|
||||
// void stopBlinkChatTab();
|
||||
// void showDefaultChatTab();
|
||||
|
||||
public slots:
|
||||
|
||||
void blinkChatTab();
|
||||
// void blinkChatTab();
|
||||
|
||||
private:
|
||||
|
||||
QTimer *chatBlinkTimer;
|
||||
// QTimer *chatBlinkTimer;
|
||||
QTabBar *myTabBar;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user