Some button reorganization on net game page
authorunc0rr
Mon, 12 Jan 2009 16:42:13 +0000
changeset 1649 938a0fda0206
parent 1648 32d99a3c7998
child 1650 a65681cc27c2
Some button reorganization on net game page
QTfrontend/hwform.cpp
QTfrontend/pages.cpp
QTfrontend/pages.h
--- a/QTfrontend/hwform.cpp	Mon Jan 12 16:38:52 2009 +0000
+++ b/QTfrontend/hwform.cpp	Mon Jan 12 16:42:13 2009 +0000
@@ -767,7 +767,7 @@
 
 void HWForm::NetGameMaster()
 {
-	ui.pageNetGame->BtnMaster->setVisible(true);
+	ui.pageNetGame->setMasterMode(true);
 	ui.pageNetGame->restrictJoins->setChecked(false);
 	ui.pageNetGame->restrictTeamAdds->setChecked(false);
 	
@@ -781,7 +781,7 @@
 
 void HWForm::NetGameSlave()
 {
-	ui.pageNetGame->BtnMaster->setVisible(false);
+	ui.pageNetGame->setMasterMode(false);
 }
 
 void HWForm::NetLeftRoom()
--- a/QTfrontend/pages.cpp	Mon Jan 12 16:38:52 2009 +0000
+++ b/QTfrontend/pages.cpp	Mon Jan 12 16:42:13 2009 +0000
@@ -554,16 +554,23 @@
 	pNetTeamsWidget->setAcceptOuter(true);
 	pageLayout->addWidget(pNetTeamsWidget, 0, 1);
 
+
+	QHBoxLayout * bottomLayout = new QHBoxLayout;
+	pageLayout->addLayout(bottomLayout, 3, 0, 1, 2);
+
+	BtnBack = addButton(":/res/Exit.png", bottomLayout, 0, true);
+	
 	BtnGo = new QPushButton(this);
 	BtnGo->setFont(*font14);
 	//BtnGo->setText(QPushButton::tr("Ready"));
 	BtnGo->setIcon(QIcon(":/res/lightbulb_off.png"));
 	BtnGo->setIconSize(QSize(25, 34));
-	pageLayout->addWidget(BtnGo, 3, 1);
+	BtnGo->setMinimumWidth(50);
+	BtnGo->setMinimumHeight(50);
+	bottomLayout->addWidget(BtnGo, 2);
 
-	BtnBack = addButton(":/res/Exit.png", pageLayout, 3, 0, true);
 
-	BtnMaster = addButton(tr("Control"), pageLayout, 2, 1);
+	BtnMaster = addButton(tr("Control"), bottomLayout, 3);
 	QMenu * menu = new QMenu(BtnMaster);
 	startGame = new QAction(QAction::tr("Start"), menu);
 	restrictJoins = new QAction(QAction::tr("Restrict Joins"), menu);
@@ -575,6 +582,8 @@
 	menu->addAction(restrictTeamAdds);
 	
 	BtnMaster->setMenu(menu);
+
+	bottomLayout->insertStretch(1, 100);
 }
 
 void PageNetGame::setReadyStatus(bool isReady)
@@ -585,6 +594,11 @@
 		BtnGo->setIcon(QIcon(":/res/lightbulb_off.png"));
 }
 
+void PageNetGame::setMasterMode(bool isMaster)
+{
+	BtnMaster->setVisible(isMaster);
+}
+
 PageInfo::PageInfo(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
--- a/QTfrontend/pages.h	Mon Jan 12 16:38:52 2009 +0000
+++ b/QTfrontend/pages.h	Mon Jan 12 16:42:13 2009 +0000
@@ -282,6 +282,7 @@
 
 public slots:
 	void setReadyStatus(bool isReady);
+	void setMasterMode(bool isMaster);
 };
 
 class PageInfo : public AbstractPage