QTfrontend/ui/widget/mapContainer.cpp
changeset 13233 d23742ccf92b
parent 13217 e9e4cc867b6e
child 13251 0c98d3b249f7
--- a/QTfrontend/ui/widget/mapContainer.cpp	Fri Mar 16 16:35:08 2018 +0100
+++ b/QTfrontend/ui/widget/mapContainer.cpp	Fri Mar 16 19:05:11 2018 +0100
@@ -98,10 +98,15 @@
     twoColumnLayout->addLayout(rightLayout, 0);
     QVBoxLayout * drawnControls = new QVBoxLayout();
 
+    /* Map type label */
+
+    QLabel* lblMapType = new QLabel(tr("Map type:"));
+    topLayout->setSpacing(10);
+    topLayout->addWidget(lblMapType, 0);
+    m_childWidgets << lblMapType;
+
     /* Map type combobox */
 
-    topLayout->setSpacing(10);
-    topLayout->addWidget(new QLabel(tr("Map type:")), 0);
     cType = new QComboBox(this);
     topLayout->addWidget(cType, 1);
     cType->insertItem(0, tr("Image map"), MapModel::StaticMap);
@@ -148,6 +153,7 @@
     QLabel * lblMapPreviewText = new QLabel(this);
     lblMapPreviewText->setText(tr("Map preview:"));
     leftLayout->addWidget(lblMapPreviewText, 0);
+    m_childWidgets << lblMapPreviewText;
 
     /* Map Preview */
 
@@ -158,6 +164,7 @@
     mapPreview->setContentsMargins(0, 0, 0, 0);
     leftLayout->addWidget(mapPreview, 0);
     connect(mapPreview, SIGNAL(clicked()), this, SLOT(previewClicked()));
+    m_childWidgets << mapPreview;
 
     /* Bottom-Left layout */
 
@@ -168,6 +175,7 @@
 
     lblMapList = new QLabel(this);
     rightLayout->addWidget(lblMapList, 0);
+    m_childWidgets << lblMapList;
 
     /* Static maps list */
 
@@ -329,7 +337,12 @@
     pc.fillRect(centered.rect(), linearGrad);
     pc.drawPixmap(-3, -3, finalImage);*/
 
-    mapPreview->setIcon(QIcon(finalImage));
+    // Set the map preview image. Make sure it is always colored the same,
+    // no matter if disabled or not.
+    QIcon mapPreviewIcon = QIcon();
+    mapPreviewIcon.addPixmap(finalImage, QIcon::Normal);
+    mapPreviewIcon.addPixmap(finalImage, QIcon::Disabled);
+    mapPreview->setIcon(mapPreviewIcon);
     mapPreview->setIconSize(finalImage.size());
 }