diff --git a/pokerth.pro b/pokerth.pro index 471d22b8..4daa5c87 100755 --- a/pokerth.pro +++ b/pokerth.pro @@ -111,6 +111,7 @@ HEADERS += src/game.h \ src/engine/network_engine/clientturn.h \ src/gui/qt/mainwindow/mainwindowimpl.h \ src/gui/qt/mainwindow/mycardspixmaplabel.h \ + src/gui/qt/mainwindow/myrighttabwidget.h \ src/gui/qt/mainwindow/startsplash/startsplash.h \ src/gui/qt/mainwindow/log/log.h \ src/gui/qt/mainwindow/chat/chat.h \ @@ -199,6 +200,7 @@ SOURCES += src/game.cpp \ src/gui/qt/guiwrapper.cpp \ src/gui/qt/mainwindow/mainwindowimpl.cpp \ src/gui/qt/mainwindow/mycardspixmaplabel.cpp \ + src/gui/qt/mainwindow/myrighttabwidget.cpp \ src/gui/qt/mainwindow/startsplash/startsplash.cpp \ src/gui/qt/mainwindow/log/log.cpp \ src/gui/qt/mainwindow/chat/chat.cpp \ diff --git a/src/gui/qt/mainwindow.ui b/src/gui/qt/mainwindow.ui index 797579da..528567a8 100644 --- a/src/gui/qt/mainwindow.ui +++ b/src/gui/qt/mainwindow.ui @@ -1800,10 +1800,19 @@ - + + + + + 240 + 240 + 240 + + + @@ -1815,6 +1824,15 @@ + + + + 240 + 240 + 240 + + + @@ -1826,6 +1844,15 @@ + + + + 128 + 128 + 128 + + + @@ -5831,6 +5858,13 @@ + + + MyRightTabWidget + QTabWidget +
myrighttabwidget.h
+
+
spinBox_set diff --git a/src/gui/qt/mainwindow/chat/chat.cpp b/src/gui/qt/mainwindow/chat/chat.cpp index a949cb9d..c52ec9a7 100644 --- a/src/gui/qt/mainwindow/chat/chat.cpp +++ b/src/gui/qt/mainwindow/chat/chat.cpp @@ -26,7 +26,6 @@ using namespace std; Chat::Chat(mainWindowImpl* w, ConfigFile *c) : myW(w), myConfig(c) { - myW->setChat(this); } @@ -43,4 +42,18 @@ void Chat::sendMessage() { myW->lineEdit_ChatInput->setText(""); } -void Chat::receiveMessage(std::string message) { myW->textBrowser_Chat->append(QString::fromUtf8(message.c_str())); } \ No newline at end of file +void Chat::receiveMessage(std::string message) { + + myW->textBrowser_Chat->append(QString::fromUtf8(message.c_str())); + checkInvisible(); +} + +void Chat::checkInvisible() { + + switch (myW->tabWidget->currentIndex()) { + + case 1: { myW->tabWidget->stopBlinkChatTab(); } + break; + default: { myW->tabWidget->startBlinkChatTab(); } + } +} diff --git a/src/gui/qt/mainwindow/chat/chat.h b/src/gui/qt/mainwindow/chat/chat.h index ca8c294b..1fa4d6ac 100644 --- a/src/gui/qt/mainwindow/chat/chat.h +++ b/src/gui/qt/mainwindow/chat/chat.h @@ -27,6 +27,7 @@ #include + class mainWindowImpl; class Chat : public QObject @@ -42,12 +43,15 @@ public slots: void sendMessage(); void receiveMessage(std::string); - + void checkInvisible(); + private: mainWindowImpl *myW; ConfigFile *myConfig; + + friend class GuiWrapper; }; diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 44334f5d..39db24f9 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -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( setChatFocus() ) ); + connect( tabWidget, SIGNAL( currentChanged(int) ), this, SLOT( tabSwitchAction() ) ); connect( lineEdit_ChatInput, SIGNAL( returnPressed () ), this, SLOT( sendChatMessage() ) ); //Nachrichten Thread-Save @@ -2457,7 +2457,7 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) { if (event->key() == Qt::Key_F10) { switchLeftToolBox(); } if (event->key() == Qt::Key_F11) { switchRightToolBox(); } // if (event->key() == Qt::Key_F) { switchFullscreen(); } //f -// if (event->key() == Qt::Key_S) { showMyCards(); } //f +// if (event->key() == Qt::Key_S) { myChat->checkInvisible(); } //f if (event->key() == 16777249) { pushButton_break->click(); ctrlPressed = TRUE; @@ -2511,11 +2511,17 @@ void mainWindowImpl::blinkingStartButtonAnimationAction() { void mainWindowImpl::sendChatMessage() { myChat->sendMessage(); } -void mainWindowImpl::setChatFocus() { +void mainWindowImpl::tabSwitchAction() { - if(tabWidget->currentIndex() == 1) lineEdit_ChatInput->setFocus(); - else lineEdit_ChatInput->clearFocus(); + switch(tabWidget->currentIndex()) { + case 1: { lineEdit_ChatInput->setFocus(); + myChat->checkInvisible(); + } + break; + default: { lineEdit_ChatInput->clearFocus(); } + + } } void mainWindowImpl::closeEvent(QCloseEvent *event) { diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index a375afe3..cde025a7 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -237,7 +237,7 @@ public slots: void paintStartSplash(); void sendChatMessage(); - void setChatFocus(); + void tabSwitchAction(); void networkError(int, int); void networkStart(boost::shared_ptr game); diff --git a/src/gui/qt/mainwindow/myrighttabwidget.cpp b/src/gui/qt/mainwindow/myrighttabwidget.cpp new file mode 100644 index 00000000..2cd8bf17 --- /dev/null +++ b/src/gui/qt/mainwindow/myrighttabwidget.cpp @@ -0,0 +1,48 @@ +// +// C++ Implementation: MyRightTabWidget +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "myrighttabwidget.h" + +// using namespace std; + +MyRightTabWidget::MyRightTabWidget(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() )); +} + + +MyRightTabWidget::~MyRightTabWidget() +{ +} + +void MyRightTabWidget::startBlinkChatTab() { chatBlinkTimer->start(500); } +void MyRightTabWidget::stopBlinkChatTab() { chatBlinkTimer->stop(); } + +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) { + + QTabWidget::paintEvent(event); + +} + + + diff --git a/src/gui/qt/mainwindow/myrighttabwidget.h b/src/gui/qt/mainwindow/myrighttabwidget.h new file mode 100644 index 00000000..74c29b48 --- /dev/null +++ b/src/gui/qt/mainwindow/myrighttabwidget.h @@ -0,0 +1,44 @@ +// +// C++ Interface: MyRightTabWidget +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef MYRIGHTTABWIDGET_H +#define MYRIGHTTABWIDGET_H + +#include +#include + +#include + +class MyRightTabWidget : public QTabWidget +{ +Q_OBJECT +public: + MyRightTabWidget(QGroupBox*); + + ~MyRightTabWidget(); + + + void paintEvent(QPaintEvent * event); + void startBlinkChatTab(); + void stopBlinkChatTab(); + +public slots: + + void blinkChatTab(); + +private: + + QTimer *chatBlinkTimer; + QTabBar *myTabBar; + +}; + +#endif diff --git a/src/gui/qt/selectavatardialog.ui b/src/gui/qt/selectavatardialog.ui index dd7b323e..65b33b41 100644 --- a/src/gui/qt/selectavatardialog.ui +++ b/src/gui/qt/selectavatardialog.ui @@ -12,61 +12,32 @@ Please select an avatar - - - 9 + + + + 9 + 9 + 460 + 220 + - - 6 + + + + + 9 + 235 + 460 + 28 + - - - - Qt::ScrollBarAlwaysOff - - - - 50 - 50 - - - - QListView::TopToBottom - - - true - - - QListView::Adjust - - - QListView::Batched - - - - 70 - 70 - - - - QListView::IconMode - - - true - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - - - + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + +
diff --git a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp index afa12def..261c04cc 100644 --- a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp +++ b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp @@ -31,10 +31,14 @@ selectAvatarDialogImpl::selectAvatarDialogImpl(QWidget *parent, ConfigFile *c) // listWidget->setViewMode(QListView::IconMode); // listWidget->setIconSize(QSize(50,50)); -// listWidget->setSpacing(20); -// listWidget->setDragEnabled(FALSE); -// listWidget->setResizeMode(QListView::Adjust); // listWidget->setLayoutDirection(Qt::LeftToRight); + listWidget->setViewMode(QListView::IconMode); + listWidget->setIconSize(QSize(50, 50)); +// listWidget->setFlow(QListView::TopToBottom); +// listWidget->setWrapping(true); + listWidget->setSpacing(20); + listWidget->setDragEnabled(FALSE); + listWidget->setResizeMode(QListView::Adjust); int i; for (i=0; i<30; i++) {