Author: mir3x
Date: Fri Jul 22 20:25:04 2016
New Revision: 33298

URL: http://svn.gna.org/viewcvs/freeciv?rev=33298&view=rev
Log:
Qt client - use QFormLayout instead of QGridLayout in PAGE_START
Patch by Louis Moureaux <louis94> 

See patch #7485


Modified:
    trunk/client/gui-qt/fc_client.cpp

Modified: trunk/client/gui-qt/fc_client.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/fc_client.cpp?rev=33298&r1=33297&r2=33298&view=diff
==============================================================================
--- trunk/client/gui-qt/fc_client.cpp   (original)
+++ trunk/client/gui-qt/fc_client.cpp   Fri Jul 22 20:25:04 2016
@@ -17,6 +17,7 @@
 
 // Qt
 #include <QApplication>
+#include <QFormLayout>
 #include <QCompleter>
 #include <QMainWindow>
 #include <QLineEdit>
@@ -912,15 +913,11 @@
 ****************************************************************************/
 void pregame_options::init()
 {
-  QGridLayout *layout;
-  QLabel *l1, *l2, *l3;
+  QFormLayout *layout;
   QPushButton *but;
   int level;
 
-  l1 = new QLabel(_("Number of Players\n(including AI):"));
-  l2 = new QLabel(_("AI Skill Level:"));
-  l3 = new QLabel(_("Ruleset:"));
-  layout = new QGridLayout(this);
+  layout = new QFormLayout(this);
   max_players = new QSpinBox(this);
   ailevel = new QComboBox(this);
   cruleset = new QComboBox(this);
@@ -947,13 +944,12 @@
   but->setIcon(fc_icons::instance()->get_icon("preferences-other"));
   QObject::connect(but, SIGNAL(clicked()), this,
                    SLOT(popup_server_options()));
-  layout->addWidget(l1, 0, 1);
-  layout->addWidget(l2, 1, 1);
-  layout->addWidget(l3, 2, 1);
-  layout->addWidget(max_players, 0, 2);
-  layout->addWidget(ailevel, 1, 2);
-  layout->addWidget(cruleset, 2, 2);
-  layout->addWidget(but, 3, 1);
+
+  layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
+  layout->addRow(_("Number of Players (including AI):"), max_players);
+  layout->addRow(_("AI Skill Level:"), ailevel);
+  layout->addRow(_("Ruleset"), cruleset);
+  layout->addWidget(but);
   setLayout(layout);
 }
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to