author | displacer |
Sun, 20 Aug 2006 15:22:26 +0000 | |
changeset 120 | 87264c35b09a |
parent 118 | fac200ee771c |
child 123 | 6987769ced3d |
permissions | -rw-r--r-- |
80 | 1 |
#include "teamselhelper.h" |
2 |
||
3 |
#include <QPixmap> |
|
4 |
#include <QPushButton> |
|
5 |
||
6 |
void TeamLabel::teamButtonClicked() |
|
7 |
{ |
|
8 |
emit teamActivated(text()); |
|
9 |
} |
|
10 |
||
117 | 11 |
TeamShowWidget::TeamShowWidget(HWTeam team, QWidget * parent) : |
80 | 12 |
QWidget(parent), mainLayout(this), m_team(team) |
13 |
{ |
|
86
664b536a1c27
Predefined teams, 'simple game' doesn't need to create team
unc0rr
parents:
84
diff
changeset
|
14 |
this->setMaximumHeight(40); |
120 | 15 |
QPixmap* px=new QPixmap(QPixmap(QString("../share/hedgewars/Data/Forts/")+m_team.Fort+"L.png").scaled(40, 40)); |
80 | 16 |
|
120 | 17 |
QPushButton* butt=new QPushButton(*px, "", this); |
18 |
butt->setFlat(true); |
|
19 |
butt->setGeometry(0, 0, 30, 30); |
|
86
664b536a1c27
Predefined teams, 'simple game' doesn't need to create team
unc0rr
parents:
84
diff
changeset
|
20 |
butt->setMaximumWidth(30); |
80 | 21 |
mainLayout.addWidget(butt); |
120 | 22 |
butt->setIconSize(butt->size()); |
23 |
||
24 |
QPushButton* bText=new QPushButton(team.TeamName, this); |
|
25 |
QPalette newPalette = palette(); |
|
26 |
newPalette.setColor(QPalette::Button, palette().color(backgroundRole())); |
|
27 |
bText->setPalette(newPalette); |
|
28 |
bText->setFlat(true); |
|
29 |
mainLayout.addWidget(bText); |
|
80 | 30 |
|
31 |
QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam())); |
|
120 | 32 |
QObject::connect(bText, SIGNAL(clicked()), this, SLOT(activateTeam())); |
80 | 33 |
} |
34 |
||
35 |
void TeamShowWidget::activateTeam() |
|
36 |
{ |
|
37 |
emit teamStatusChanged(m_team); |
|
38 |
} |