33 |
33 |
34 TeamShowWidget::TeamShowWidget(HWTeam team, bool isPlaying, QWidget * parent) : |
34 TeamShowWidget::TeamShowWidget(HWTeam team, bool isPlaying, QWidget * parent) : |
35 QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying), phhoger(0), |
35 QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying), phhoger(0), |
36 colorButt(0) |
36 colorButt(0) |
37 { |
37 { |
38 mainLayout.setSpacing(1); |
38 QPalette newPalette = palette(); |
39 mainLayout.setMargin(2); |
39 newPalette.setColor(QPalette::Window, QColor(0x13, 0x0f, 0x2c)); |
40 this->setMaximumHeight(35); |
40 setPalette(newPalette); |
41 QIcon difficultyIcon=team.isNetTeam() ? |
41 setAutoFillBackground(true); |
42 QIcon(QString(":/res/botlevels/net%1.png").arg(m_team.difficulty)) |
|
43 : QIcon(QString(":/res/botlevels/%1.png").arg(m_team.difficulty)); |
|
44 |
42 |
45 QPalette newPalette = palette(); |
43 mainLayout.setSpacing(0); |
46 newPalette.setColor(QPalette::Button, palette().color(backgroundRole())); |
44 mainLayout.setMargin(0); |
|
45 this->setMaximumHeight(30); |
|
46 QIcon difficultyIcon=team.isNetTeam() ? |
|
47 QIcon(QString(":/res/botlevels/net%1.png").arg(m_team.difficulty)) |
|
48 : QIcon(QString(":/res/botlevels/%1.png").arg(m_team.difficulty)); |
47 |
49 |
48 butt = new QPushButton(difficultyIcon, team.TeamName, this); |
50 butt = new QPushButton(difficultyIcon, team.TeamName, this); |
49 butt->setFlat(true); |
51 butt->setFlat(true); |
50 butt->setPalette(newPalette); |
|
51 mainLayout.addWidget(butt); |
52 mainLayout.addWidget(butt); |
52 butt->setStyleSheet("QPushButton{" |
53 butt->setStyleSheet("QPushButton{" |
53 "icon-size: 36px;" |
54 "icon-size: 36px;" |
54 "text-align: left;" |
55 "text-align: left;" |
55 "background-color: #0d0544;" |
56 "background-color: #0d0544;" |
56 "color: orange;" |
57 "color: orange;" |
57 "font: bold;" |
58 "font: bold;" |
|
59 "border-width: 2px;" |
58 "}"); |
60 "}"); |
59 |
61 |
60 if(m_isPlaying) { |
62 if(m_isPlaying) { |
61 // team color |
63 // team color |
62 colorButt=new QPushButton(this); |
64 colorButt = new QPushButton(this); |
63 colorButt->setMaximumWidth(30); |
65 colorButt->setMaximumWidth(26); |
64 colorButt->setMinimumHeight(30); |
66 colorButt->setMinimumHeight(26); |
65 colorButt->setGeometry(0, 0, 30, 30); |
67 colorButt->setGeometry(0, 0, 26, 26); |
66 |
68 |
67 changeTeamColor(); |
69 changeTeamColor(); |
68 connect(colorButt, SIGNAL(clicked()), this, SLOT(changeTeamColor())); |
70 connect(colorButt, SIGNAL(clicked()), this, SLOT(changeTeamColor())); |
69 mainLayout.addWidget(colorButt); |
71 mainLayout.addWidget(colorButt); |
70 |
72 |