QTfrontend/teamselect.cpp
changeset 311 b8905423f19f
parent 244 b37ca2295b73
child 322 e7175ae57945
equal deleted inserted replaced
310:b95fd124cb09 311:b8905423f19f
    79     pAddTeams->resize(pAddTeams->size().width(), szh.height());
    79     pAddTeams->resize(pAddTeams->size().width(), szh.height());
    80     pRemoveTeams->resize(pRemoveTeams->size().width(), szh1.height());
    80     pRemoveTeams->resize(pRemoveTeams->size().width(), szh1.height());
    81   }
    81   }
    82 }
    82 }
    83 
    83 
    84 void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color)
    84 void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color, int maxHeight)
    85 {
    85 {
    86   VertScrArea* area=new VertScrArea(color);
    86   VertScrArea* area=new VertScrArea(color);
    87   area->setWidget(pfteams);
    87   area->setWidget(pfteams);
    88   mainLayout.addWidget(area, 30);
    88   mainLayout.addWidget(area, 30);
       
    89   if (maxHeight > 0)
       
    90   	area->setMaximumHeight(maxHeight);
    89 }
    91 }
    90 
    92 
    91 TeamSelWidget::TeamSelWidget(QWidget* parent) :
    93 TeamSelWidget::TeamSelWidget(QWidget* parent) :
    92   QGroupBox(parent), mainLayout(this)
    94   QGroupBox(parent), mainLayout(this)
    93 {
    95 {
    95   framePlaying=new FrameTeams();
    97   framePlaying=new FrameTeams();
    96   frameDontPlaying=new FrameTeams();
    98   frameDontPlaying=new FrameTeams();
    97 //  addScrArea(framePlaying, QColor("DarkTurquoise"));
    99 //  addScrArea(framePlaying, QColor("DarkTurquoise"));
    98 //  addScrArea(frameDontPlaying, QColor("LightGoldenrodYellow"));
   100 //  addScrArea(frameDontPlaying, QColor("LightGoldenrodYellow"));
    99   QPalette p;
   101   QPalette p;
   100   addScrArea(framePlaying, p.color(QPalette::Window).light(105));
   102   addScrArea(framePlaying, p.color(QPalette::Window).light(105), 200);
   101   addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105));
   103   addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 0);
       
   104   newTeam = new QPushButton(this);
       
   105   newTeam->setText(QPushButton::tr("New team"));
       
   106   connect(newTeam, SIGNAL(clicked()), this, SLOT(newTeamClicked()));
       
   107   mainLayout.addWidget(newTeam);
   102 }
   108 }
   103 
   109 
   104 void TeamSelWidget::resetPlayingTeams(const QList<HWTeam>& teamslist)
   110 void TeamSelWidget::resetPlayingTeams(const QList<HWTeam>& teamslist)
   105 {
   111 {
   106   list<HWTeam>::iterator it;
   112   list<HWTeam>::iterator it;
   133 {
   139 {
   134   const TeamShowWidget* tsw=dynamic_cast<TeamShowWidget*>(framePlaying->getTeamWidget(team));
   140   const TeamShowWidget* tsw=dynamic_cast<TeamShowWidget*>(framePlaying->getTeamWidget(team));
   135   if(!tsw) throw;
   141   if(!tsw) throw;
   136   return tsw->getTeamParams();
   142   return tsw->getTeamParams();
   137 }
   143 }
       
   144 
       
   145 void TeamSelWidget::newTeamClicked()
       
   146 {
       
   147 	emit NewTeam();
       
   148 }