QTfrontend/mapContainer.cpp
changeset 1214 090f94cd663e
parent 1211 94c4f20abdda
child 1215 0c1c294c0f7e
--- a/QTfrontend/mapContainer.cpp	Fri Aug 15 03:59:36 2008 +0000
+++ b/QTfrontend/mapContainer.cpp	Fri Aug 15 06:33:50 2008 +0000
@@ -44,7 +44,7 @@
 #endif
   imageButt = new QPushButton(this);
   imageButt->setObjectName("imageButt");
-  imageButt->setFixedSize(256 + 8, 128 + 8);
+  imageButt->setFixedSize(256 + 6, 128 + 6);
   imageButt->setFlat(true);
   imageButt->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);//QSizePolicy::Minimum, QSizePolicy::Minimum);
   mainLayout.addWidget(imageButt, 0, 0, 1, 2);
@@ -80,7 +80,6 @@
 	gbTLayout->addWidget(lwThemes);
 	lwThemes->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
 	
-
   mainLayout.setSizeConstraint(QLayout::SetFixedSize);//SetMinimumSize
 }
 
@@ -136,10 +135,14 @@
 
 void HWMapContainer::changeImage()
 {
-  pMap = new HWMap();
-  connect(pMap, SIGNAL(ImageReceived(const QImage)), this, SLOT(setImage(const QImage)));
-  pMap->getImage(m_seed.toStdString());
-  theme = (Themes->size() > 0) ? Themes->at(rand() % Themes->size()) : "steel";
+	pMap = new HWMap();
+	connect(pMap, SIGNAL(ImageReceived(const QImage)), this, SLOT(setImage(const QImage)));
+	pMap->getImage(m_seed.toStdString());
+
+	if(!Themes->size()) return;
+	quint32 themeNum = rand() % Themes->size();
+	theme = Themes->at(themeNum);
+	lwThemes->setCurrentRow(themeNum);
 }
 
 QString HWMapContainer::getCurrentSeed() const