Fixed map preview overlap on certain locales (Fixes issue 549).
authordag10
Sun, 07 Apr 2013 19:42:02 -0400
changeset 8886 5c521d1fdd63
parent 8884 08fe08651130
child 8889 74abe69d8569
Fixed map preview overlap on certain locales (Fixes issue #549). Fixed overlapping of team selection widget and game cfg widget.
QTfrontend/ui/page/pagemultiplayer.cpp
QTfrontend/ui/widget/mapContainer.cpp
QTfrontend/ui/widget/teamselect.cpp
--- a/QTfrontend/ui/page/pagemultiplayer.cpp	Sun Apr 07 16:35:48 2013 -0400
+++ b/QTfrontend/ui/page/pagemultiplayer.cpp	Sun Apr 07 19:42:02 2013 -0400
@@ -31,15 +31,13 @@
 
 QLayout * PageMultiplayer::bodyLayoutDefinition()
 {
-    QGridLayout * pageLayout = new QGridLayout();
+    QHBoxLayout * pageLayout = new QHBoxLayout();
 
     gameCFG = new GameCFGWidget(this);
-    pageLayout->addWidget(gameCFG, 0, 0, 1, 2);
-
-    pageLayout->setRowStretch(2, 1);
+    pageLayout->addWidget(gameCFG, 3, Qt::AlignTop);
 
     teamsSelect = new TeamSelWidget(this);
-    pageLayout->addWidget(teamsSelect, 0, 2, 3, 2);
+    pageLayout->addWidget(teamsSelect, 2, Qt::AlignTop);
 
     return pageLayout;
 }
--- a/QTfrontend/ui/widget/mapContainer.cpp	Sun Apr 07 16:35:48 2013 -0400
+++ b/QTfrontend/ui/widget/mapContainer.cpp	Sun Apr 07 19:42:02 2013 -0400
@@ -75,8 +75,11 @@
 
     /* Layouts */
 
-    QHBoxLayout * typeLayout = new QHBoxLayout();
-    QHBoxLayout * seedLayout = new QHBoxLayout();
+    QWidget * topWidget = new QWidget();
+    QHBoxLayout * topLayout = new QHBoxLayout(topWidget);
+    topWidget->setContentsMargins(0, 0, 0, 0);
+    topLayout->setContentsMargins(0, 0, 0, 0);
+
     QHBoxLayout * twoColumnLayout = new QHBoxLayout();
     QVBoxLayout * leftLayout = new QVBoxLayout();
     QVBoxLayout * rightLayout = new QVBoxLayout();
@@ -84,15 +87,13 @@
     twoColumnLayout->addStretch(1);
     twoColumnLayout->addLayout(rightLayout, 0);
     QVBoxLayout * drawnControls = new QVBoxLayout();
-    leftLayout->addLayout(typeLayout, 0);
-    rightLayout->addLayout(seedLayout, 0);
 
     /* Map type combobox */
 
-    typeLayout->setSpacing(10);
-    typeLayout->addWidget(new QLabel(tr("Map type:")), 0);
+    topLayout->setSpacing(10);
+    topLayout->addWidget(new QLabel(tr("Map type:")), 0);
     cType = new QComboBox(this);
-    typeLayout->addWidget(cType, 1);
+    topLayout->addWidget(cType, 1);
     cType->insertItem(0, tr("Image map"), MapModel::StaticMap);
     cType->insertItem(1, tr("Mission map"), MapModel::MissionMap);
     cType->insertItem(2, tr("Hand-drawn"), MapModel::HandDrawnMap);
@@ -103,7 +104,7 @@
 
     /* Randomize button */
 
-    seedLayout->addStretch(1);
+    topLayout->addStretch(1);
     const QIcon& lp = QIcon(":/res/dice.png");
     QSize sz = lp.actualSize(QSize(65535, 65535));
     btnRandomize = new QPushButton();
@@ -117,15 +118,16 @@
     m_childWidgets << btnRandomize;
     btnRandomize->setStyleSheet("padding: 5px;");
     btnRandomize->setFixedHeight(cType->height());
-    seedLayout->addWidget(btnRandomize, 1);
+    topLayout->addWidget(btnRandomize, 1);
 
     /* Seed button */
+
     btnSeed = new QPushButton(parentWidget()->parentWidget());
     btnSeed->setText(tr("Seed"));
     btnSeed->setStyleSheet("padding: 5px;");
     btnSeed->setFixedHeight(cType->height());
     connect(btnSeed, SIGNAL(clicked()), this, SLOT(showSeedPrompt()));
-    seedLayout->addWidget(btnSeed, 0);
+    topLayout->addWidget(btnSeed, 0);
 
     /* Map preview label */
 
@@ -137,6 +139,7 @@
 
     mapPreview = new QPushButton(this);
     mapPreview->setObjectName("mapPreview");
+    mapPreview->setFlat(true);
     mapPreview->setFixedSize(256, 128);
     mapPreview->setContentsMargins(0, 0, 0, 0);
     leftLayout->addWidget(mapPreview, 0);
@@ -240,13 +243,15 @@
     /* Theme chooser */
 
     btnTheme = new QPushButton();
+    btnTheme->setFlat(true);
     connect(btnTheme, SIGNAL(clicked()), this, SLOT(showThemePrompt()));
     m_childWidgets << btnTheme;
     bottomLeftLayout->addWidget(btnTheme, 0);
 
     /* Add everything to main layout */
 
-    mainLayout.addLayout(twoColumnLayout, 0);
+    mainLayout.addWidget(topWidget, 0);
+    mainLayout.addLayout(twoColumnLayout, 1);
 
     /* Set defaults */
 
--- a/QTfrontend/ui/widget/teamselect.cpp	Sun Apr 07 16:35:48 2013 -0400
+++ b/QTfrontend/ui/widget/teamselect.cpp	Sun Apr 07 19:42:02 2013 -0400
@@ -258,12 +258,16 @@
 
     // Add notice about number of required teams.
     numTeamNotice = new QLabel(tr("At least two teams are required to play!"));
+    numTeamNotice->setWordWrap(true);
     mainLayout.addWidget(numTeamNotice);
 
     QPalette p;
     p.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00));
     addScrArea(framePlaying, p.color(QPalette::Window).light(105), 150);
     addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 0);
+
+    this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+    this->setMinimumWidth(200);
 }
 
 void TeamSelWidget::setAcceptOuter(bool acceptOuter)