fix layout of net page
authorsheepluva
Fri, 21 Oct 2011 19:17:08 +0200
changeset 6171 8627698134b6
parent 6170 2b1748161278
child 6172 809e1076ffe2
fix layout of net page
QTfrontend/ui/page/pagemultiplayer.cpp
QTfrontend/ui/page/pagenet.cpp
QTfrontend/ui/page/pagenet.h
QTfrontend/ui/page/pagenetgame.cpp
QTfrontend/ui/page/pagenetserver.cpp
--- a/QTfrontend/ui/page/pagemultiplayer.cpp	Fri Oct 21 18:53:36 2011 +0200
+++ b/QTfrontend/ui/page/pagemultiplayer.cpp	Fri Oct 21 19:17:08 2011 +0200
@@ -21,6 +21,7 @@
  * @brief PageMultiplayer class implementation
  */
 
+#include <QGridLayout>
 #include <QHBoxLayout>
 #include <QPushButton>
 
--- a/QTfrontend/ui/page/pagenet.cpp	Fri Oct 21 18:53:36 2011 +0200
+++ b/QTfrontend/ui/page/pagenet.cpp	Fri Oct 21 19:17:08 2011 +0200
@@ -17,6 +17,7 @@
  */
 
 #include <QGridLayout>
+#include <QHBoxLayout>
 #include <QPushButton>
 #include <QGroupBox>
 #include <QTableView>
@@ -35,12 +36,6 @@
     pageLayout->setColumnStretch(1, 1);
     pageLayout->setColumnStretch(2, 1);
 
-    BtnNetSvrStart = new QPushButton(this);
-    BtnNetSvrStart->setFont(*font14);
-    BtnNetSvrStart->setText(QPushButton::tr("Start server"));
-    BtnNetSvrStart->setVisible(haveServer);
-    pageLayout->addWidget(BtnNetSvrStart, 4, 2);
-
     ConnGroupBox = new QGroupBox(this);
     ConnGroupBox->setTitle(QGroupBox::tr("Net game"));
     pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3);
@@ -71,6 +66,20 @@
     return pageLayout;
 }
 
+QLayout * PageNet::footerLayoutDefinition()
+{
+    QHBoxLayout * footerLayout = new QHBoxLayout();
+
+    BtnNetSvrStart = formattedButton(QPushButton::tr("Start server"));
+    BtnNetSvrStart->setMinimumWidth(180);
+    BtnNetSvrStart->setVisible(haveServer);
+
+    footerLayout->addStretch();
+    footerLayout->addWidget(BtnNetSvrStart);
+
+    return footerLayout;
+}
+
 void PageNet::connectSignals()
 {
     connect(BtnNetConnect, SIGNAL(clicked()), this, SLOT(slotConnect()));
--- a/QTfrontend/ui/page/pagenet.h	Fri Oct 21 18:53:36 2011 +0200
+++ b/QTfrontend/ui/page/pagenet.h	Fri Oct 21 19:17:08 2011 +0200
@@ -42,6 +42,7 @@
 
 private:
     QLayout * bodyLayoutDefinition();
+    QLayout * footerLayoutDefinition();
     void connectSignals();
 
     QGroupBox * ConnGroupBox;
--- a/QTfrontend/ui/page/pagenetgame.cpp	Fri Oct 21 18:53:36 2011 +0200
+++ b/QTfrontend/ui/page/pagenetgame.cpp	Fri Oct 21 19:17:08 2011 +0200
@@ -17,6 +17,7 @@
  */
 
 #include <QGridLayout>
+#include <QHBoxLayout>
 #include <QPushButton>
 #include <QAction>
 #include <QMenu>
--- a/QTfrontend/ui/page/pagenetserver.cpp	Fri Oct 21 18:53:36 2011 +0200
+++ b/QTfrontend/ui/page/pagenetserver.cpp	Fri Oct 21 19:17:08 2011 +0200
@@ -74,9 +74,8 @@
 {
     QHBoxLayout * bottomLayout = new QHBoxLayout();
 
-    BtnStart = new QPushButton(this);
-    BtnStart->setFont(*font14);
-    BtnStart->setText(QPushButton::tr("Start"));
+    BtnStart = formattedButton(QPushButton::tr("Start"));
+    BtnStart->setMinimumWidth(180);
 
     bottomLayout->addStretch();
     bottomLayout->addWidget(BtnStart);