# HG changeset patch # User displacer # Date 1139143715 0 # Node ID 505691a09dee2b8d1e51312e39e618170466073b # Parent 7fbfa2f13f6f6473951b3a69f58b4b010464b185 colors added to teamselwidget diff -r 7fbfa2f13f6f -r 505691a09dee QTfrontend/teamselect.cpp --- a/QTfrontend/teamselect.cpp Sun Feb 05 12:48:02 2006 +0000 +++ b/QTfrontend/teamselect.cpp Sun Feb 05 12:48:35 2006 +0000 @@ -11,7 +11,7 @@ { curDontPlayingTeams.push_back(team); TeamShowWidget* pTeamShowWidget =new TeamShowWidget(team); - dontPlayingLayout.addWidget(pTeamShowWidget); + dontPlayingLayout->addWidget(pTeamShowWidget); teamToWidget.insert(make_pair(team, pTeamShowWidget)); @@ -38,20 +38,38 @@ curDontPlayingTeams.erase(itDontPlay); } - QGridLayout* pRemoveGrid = itDontPlay==curDontPlayingTeams.end() ? &playingLayout : &dontPlayingLayout; - QGridLayout* pAddGrid = itDontPlay==curDontPlayingTeams.end() ? &dontPlayingLayout : &playingLayout; + QGridLayout* pRemoveGrid; + QGridLayout* pAddGrid; + QWidget* newParent; + if(itDontPlay==curDontPlayingTeams.end()) { + pRemoveGrid=playingLayout; + pAddGrid=dontPlayingLayout; + newParent=dontPlayingColorFrame; + } else { + pRemoveGrid=dontPlayingLayout; + pAddGrid=playingLayout; + newParent=playingColorFrame; + } pRemoveGrid->removeWidget(teamToWidget[team]); + teamToWidget[team]->setParent(newParent); pAddGrid->addWidget(teamToWidget[team]); } -TeamSelWidget::TeamSelWidget(const vector& teams, QWidget* parent) : +TeamSelWidget::TeamSelWidget(QWidget* parent) : QWidget(parent), mainLayout(this) { - mainLayout.addLayout(&playingLayout); - mainLayout.addLayout(&dontPlayingLayout); + playingColorFrame = new QFrame; + QPalette newPalette = palette(); + newPalette.setColor(QPalette::Background, QColor("DarkTurquoise")); + playingColorFrame->setPalette(newPalette); + mainLayout.addWidget(playingColorFrame); - for(vector::const_iterator it=teams.begin(); it!=teams.end(); ++it) { - addTeam(*it); - } + dontPlayingColorFrame = new QFrame; + newPalette.setColor(QPalette::Background, QColor("LightGoldenrodYellow")); //BlanchedAlmond MistyRose honeydew PeachPuff LightCoral + dontPlayingColorFrame->setPalette(newPalette); + mainLayout.addWidget(dontPlayingColorFrame); + + playingLayout = new QGridLayout(playingColorFrame); + dontPlayingLayout = new QGridLayout(dontPlayingColorFrame); } diff -r 7fbfa2f13f6f -r 505691a09dee QTfrontend/teamselect.h --- a/QTfrontend/teamselect.h Sun Feb 05 12:48:02 2006 +0000 +++ b/QTfrontend/teamselect.h Sun Feb 05 12:48:35 2006 +0000 @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -27,7 +28,7 @@ Q_OBJECT public: - TeamSelWidget(const vector& teams, QWidget* parent=0); + TeamSelWidget(QWidget* parent=0); void addTeam(tmprop team); void removeTeam(tmprop team); @@ -36,8 +37,11 @@ private: QVBoxLayout mainLayout; - QGridLayout playingLayout; - QGridLayout dontPlayingLayout; + + QFrame* playingColorFrame; + QFrame* dontPlayingColorFrame; + QGridLayout* playingLayout; + QGridLayout* dontPlayingLayout; list curPlayingTeams; list curDontPlayingTeams; diff -r 7fbfa2f13f6f -r 505691a09dee QTfrontend/teamselhelper.cpp --- a/QTfrontend/teamselhelper.cpp Sun Feb 05 12:48:02 2006 +0000 +++ b/QTfrontend/teamselhelper.cpp Sun Feb 05 12:48:35 2006 +0000 @@ -8,8 +8,8 @@ emit teamActivated(text()); } -TeamShowWidget::TeamShowWidget(tmprop team) : - mainLayout(this), m_team(team) +TeamShowWidget::TeamShowWidget(tmprop team, QWidget * parent) : + QWidget(parent), mainLayout(this), m_team(team) { QLabel* pixlbl=new QLabel(); pixlbl->setPixmap(QPixmap("./Data/Graphics/thinking.png")); diff -r 7fbfa2f13f6f -r 505691a09dee QTfrontend/teamselhelper.h --- a/QTfrontend/teamselhelper.h Sun Feb 05 12:48:02 2006 +0000 +++ b/QTfrontend/teamselhelper.h Sun Feb 05 12:48:35 2006 +0000 @@ -30,7 +30,7 @@ void activateTeam(); public: - TeamShowWidget(tmprop team); + TeamShowWidget(tmprop team, QWidget * parent = 0); private: QHBoxLayout mainLayout;