- Some work on team select widget look
authorunc0rr
Sun, 26 Oct 2008 17:17:07 +0000
changeset 1424 2b45d88716b0
parent 1423 c23fa62f7c46
child 1425 7ee750565e2d
- Some work on team select widget look - Fix IconedGroupBox drawing logic
QTfrontend/frameTeam.cpp
QTfrontend/frameTeam.h
QTfrontend/igbox.cpp
QTfrontend/teamselect.cpp
QTfrontend/teamselhelper.cpp
--- a/QTfrontend/frameTeam.cpp	Sun Oct 26 15:02:55 2008 +0000
+++ b/QTfrontend/frameTeam.cpp	Sun Oct 26 17:17:07 2008 +0000
@@ -25,10 +25,10 @@
 #include "hwconsts.h"
 
 FrameTeams::FrameTeams(QWidget* parent) :
-  QWidget(parent), maxHedgehogsPerGame(18), overallHedgehogs(0), mainLayout(this), nonInteractive(false)
+  QFrame(parent), maxHedgehogsPerGame(18), overallHedgehogs(0), mainLayout(this), nonInteractive(false)
 {
 	QPalette newPalette = palette();
-	newPalette.setColor(QPalette::Window, QColor(0x13, 0x0f, 0x2c));
+	newPalette.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00));
 	setPalette(newPalette);
 	setAutoFillBackground(true);
 	
--- a/QTfrontend/frameTeam.h	Sun Oct 26 15:02:55 2008 +0000
+++ b/QTfrontend/frameTeam.h	Sun Oct 26 17:17:07 2008 +0000
@@ -19,13 +19,13 @@
 #ifndef _FRAME_TEAM_INCLUDED
 #define _FRAME_TEAM_INCLUDED
 
-#include <QWidget>
+#include <QFrame>
 #include <QList>
 #include <QColor>
 
 #include "teamselect.h"
 
-class FrameTeams : public QWidget
+class FrameTeams : public QFrame
 {
   Q_OBJECT
 
--- a/QTfrontend/igbox.cpp	Sun Oct 26 15:02:55 2008 +0000
+++ b/QTfrontend/igbox.cpp	Sun Oct 26 17:17:07 2008 +0000
@@ -30,22 +30,25 @@
 
 void IconedGroupBox::setIcon(const QIcon & icon)
 {
+	if (this->icon.isNull())
+		setStyleSheet(QString(
+			"IconedGroupBox{"
+				"margin-top: 46px;"
+				"margin-left: 12px;"
+				"padding: 22px 0px 0px 0px;"
+				"}"
+			"IconedGroupBox::title{"
+				"subcontrol-origin: margin;"
+				"subcontrol-position: top left;"
+				"padding-left: %1px;"
+				"padding-top: 26px;"
+				"text-align: left;"
+				"}"
+				).arg(padding)
+		);
+
 	this->icon = icon;
-	setStyleSheet(QString(
-		"IconedGroupBox{"
-			"margin-top: 46px;"
-			"margin-left: 12px;"
-			"padding: 22px 0px 0px 0px;"
-			"}"
-		"IconedGroupBox::title{"
-			"subcontrol-origin: margin;"
-			"subcontrol-position: top left;"
-			"padding-left: %1px;"
-			"padding-top: 26px;"
-			"text-align: left;"
-			"}"
-			).arg(padding)
-	);
+	repaint();
 }
 
 void IconedGroupBox::paintEvent(QPaintEvent * event)
--- a/QTfrontend/teamselect.cpp	Sun Oct 26 15:02:55 2008 +0000
+++ b/QTfrontend/teamselect.cpp	Sun Oct 26 17:17:07 2008 +0000
@@ -214,17 +214,31 @@
 TeamSelWidget::TeamSelWidget(QWidget* parent) :
   QGroupBox(parent), mainLayout(this), m_acceptOuter(false)
 {
-  setTitle(QGroupBox::tr("Playing teams"));
-  framePlaying = new FrameTeams();
-  frameDontPlaying = new FrameTeams();
-  QPalette p;
-  p.setColor(QPalette::Window, QColor(0x13, 0x0f, 0x2c));
-  addScrArea(framePlaying, p.color(QPalette::Window).light(105), 200);
-  addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 0);
-  QPushButton * btnSetup = new QPushButton(this);
-  btnSetup->setText(QPushButton::tr("Setup"));
-  connect(btnSetup, SIGNAL(clicked()), this, SIGNAL(SetupClicked()));
-  mainLayout.addWidget(btnSetup);
+	setTitle(QGroupBox::tr("Playing teams"));
+	framePlaying = new FrameTeams();
+	framePlaying->setStyleSheet(
+			"FrameTeams{"
+				"border: solid;"
+				"border-width: 1px;"
+				"border-radius: 16px;"
+				"border-color: #ffcc00;"
+				"}"
+	);
+	frameDontPlaying = new FrameTeams();
+	frameDontPlaying->setStyleSheet(
+			"FrameTeams{"
+				"background-image: url(\":/res/panelbg.png\");"
+				"}"
+	);
+	
+	QPalette p;
+	p.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00));
+	addScrArea(framePlaying, p.color(QPalette::Window).light(105), 200);
+	addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 0);
+	QPushButton * btnSetup = new QPushButton(this);
+	btnSetup->setText(QPushButton::tr("Setup"));
+	connect(btnSetup, SIGNAL(clicked()), this, SIGNAL(SetupClicked()));
+	mainLayout.addWidget(btnSetup);
 }
 
 void TeamSelWidget::setAcceptOuter(bool acceptOuter)
--- a/QTfrontend/teamselhelper.cpp	Sun Oct 26 15:02:55 2008 +0000
+++ b/QTfrontend/teamselhelper.cpp	Sun Oct 26 17:17:07 2008 +0000
@@ -36,7 +36,7 @@
   colorButt(0)
 {
 	QPalette newPalette = palette();
-	newPalette.setColor(QPalette::Window, QColor(0x13, 0x0f, 0x2c));
+	newPalette.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00));
 	setPalette(newPalette);
 	setAutoFillBackground(true);