Remake gamecfgwidget
authorunc0rr
Fri, 15 Aug 2008 07:50:31 +0000
changeset 1217 d6d91eec00f2
parent 1216 df1b19976e28
child 1218 ada50f82ea53
Remake gamecfgwidget
QTfrontend/gamecfgwidget.cpp
QTfrontend/gamecfgwidget.h
QTfrontend/main.cpp
--- a/QTfrontend/gamecfgwidget.cpp	Fri Aug 15 07:49:52 2008 +0000
+++ b/QTfrontend/gamecfgwidget.cpp	Fri Aug 15 07:50:31 2008 +0000
@@ -22,27 +22,20 @@
 #include <QGridLayout>
 #include <QSpinBox>
 #include <QLabel>
+
 #include "gamecfgwidget.h"
+#include "igbox.h"
 
 GameCFGWidget::GameCFGWidget(QWidget* parent, bool externalControl) :
-  QWidget(parent), mainLayout(this)
+  QGroupBox(parent), mainLayout(this)
 {
 	mainLayout.setMargin(0);
-	mainLayout.setSizeConstraint(QLayout::SetMinimumSize);
-	QGroupBox *GBoxMap = new QGroupBox(this);
-	//GBoxMap->setTitle(QGroupBox::tr("Landscape"));
-	GBoxMap->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
-	mainLayout.addWidget(GBoxMap);
+//	mainLayout.setSizeConstraint(QLayout::SetMinimumSize);
 
-	QHBoxLayout *GBoxMapLayout = new QHBoxLayout(GBoxMap);
-	GBoxMapLayout->setMargin(0);
-	pMapContainer = new HWMapContainer(GBoxMap);
-	GBoxMapLayout->addStretch();
-	GBoxMapLayout->addWidget(pMapContainer);
-	GBoxMapLayout->addStretch();
+	pMapContainer = new HWMapContainer(this);
+	mainLayout.addWidget(pMapContainer, 0, 0);
 
-	QGroupBox *GBoxOptions = new QGroupBox(this);
-	GBoxOptions->setTitle(QGroupBox::tr("Game scheme"));
+	IconedGroupBox *GBoxOptions = new IconedGroupBox(this);
 	GBoxOptions->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
 	mainLayout.addWidget(GBoxOptions);
 
@@ -70,7 +63,7 @@
 	WeaponsName = new QComboBox(GBoxOptions);
 	GBoxOptionsLayout->addWidget(WeaponsName, 3, 1);
 
-	mainLayout.addWidget(new QWidget(this), 100);
+	mainLayout.addWidget(new QWidget(this), 5, 0);
 
 	connect(SB_InitHealth, SIGNAL(valueChanged(int)), this, SLOT(onInitHealthChanged(int)));
 	connect(SB_TurnTime, SIGNAL(valueChanged(int)), this, SLOT(onTurnTimeChanged(int)));
--- a/QTfrontend/gamecfgwidget.h	Fri Aug 15 07:49:52 2008 +0000
+++ b/QTfrontend/gamecfgwidget.h	Fri Aug 15 07:50:31 2008 +0000
@@ -21,6 +21,7 @@
 
 #include <QWidget>
 #include <QStringList>
+#include <QGroupBox>
 
 #include "mapContainer.h"
 
@@ -29,7 +30,7 @@
 class QSpinBox;
 class QLabel;
 
-class GameCFGWidget : public QWidget
+class GameCFGWidget : public QGroupBox
 {
 	Q_OBJECT
 
@@ -67,7 +68,7 @@
 
 private:
 	QCheckBox * CB_mode_Forts;
-	QVBoxLayout mainLayout;
+	QGridLayout mainLayout;
 	HWMapContainer* pMapContainer;
 	QSpinBox * SB_TurnTime;
 	QSpinBox * SB_InitHealth;
--- a/QTfrontend/main.cpp	Fri Aug 15 07:49:52 2008 +0000
+++ b/QTfrontend/main.cpp	Fri Aug 15 07:50:31 2008 +0000
@@ -188,7 +188,7 @@
 				"font: bold 14px;"
 				"padding: 12px;"
 				"}"
-			".QGroupBox{"
+			".QGroupBox,GameCFGWidget,TeamSelWidget{"
 				"background-image: url(\":/res/panelbg.png\");"
 				"background-position: bottom center;"
 				"background-repeat: repeat-x;"