add button to randomize theme only
authorsheepluva
Sun, 01 May 2016 14:32:47 +0200
changeset 11790 947e2d53afc1
parent 11789 b1bf4c93f7ce
child 11793 0327d20fa4a1
add button to randomize theme only
QTfrontend/ui/widget/mapContainer.cpp
QTfrontend/ui/widget/mapContainer.h
--- a/QTfrontend/ui/widget/mapContainer.cpp	Sun May 01 12:36:59 2016 +0200
+++ b/QTfrontend/ui/widget/mapContainer.cpp	Sun May 01 14:32:47 2016 +0200
@@ -127,6 +127,7 @@
     btnRandomize->setFlat(true);
     btnRandomize->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
     connect(btnRandomize, SIGNAL(clicked()), this, SLOT(setRandomMap()));
+
     m_childWidgets << btnRandomize;
     btnRandomize->setStyleSheet("padding: 5px;");
     btnRandomize->setFixedHeight(cType->height());
@@ -251,14 +252,27 @@
     bottomLeftLayout->addStretch(1);
 
     /* Theme chooser */
+    QHBoxLayout * themeHBox = new QHBoxLayout(this);
+
+    btnRandTheme = new QPushButton();
+    btnRandTheme->setIcon(lp);
+    btnRandTheme->setIconSize(QSize(24, 24));
+    btnRandTheme->setFixedHeight(30);
+    btnRandTheme->setFixedWidth(30);
+    connect(btnRandTheme, SIGNAL(clicked()), this, SLOT(setRandomTheme()));
+    m_childWidgets << btnTheme;
+    themeHBox->addWidget(btnRandTheme, 0);
 
     btnTheme = new QPushButton(this);
     btnTheme->setFlat(true);
     btnTheme->setIconSize(QSize(30, 30));
     btnTheme->setFixedHeight(30);
+    btnTheme->setMaximumWidth(222);
     connect(btnTheme, SIGNAL(clicked()), this, SLOT(showThemePrompt()));
     m_childWidgets << btnTheme;
-    bottomLeftLayout->addWidget(btnTheme, 0);
+    themeHBox->addWidget(btnTheme, 1);
+
+    bottomLeftLayout->addLayout(themeHBox);
 
     /* Add everything to main layout */
 
@@ -895,12 +909,16 @@
     {
         btnTheme->setIconSize(QSize(30, 30));
         btnTheme->setFixedHeight(30);
+        btnRandTheme->setFixedHeight(30);
+        btnRandTheme->setIconSize(QSize(24, 24));
     }
     else
     {
         QSize iconSize = btnTheme->icon().actualSize(QSize(65535, 65535));
+        btnRandTheme->setFixedHeight(64);
         btnTheme->setFixedHeight(64);
         btnTheme->setIconSize(iconSize);
+        btnRandTheme->setIconSize(QSize(32, 32));
     }
 
     repaint();
--- a/QTfrontend/ui/widget/mapContainer.h	Sun May 01 12:36:59 2016 +0200
+++ b/QTfrontend/ui/widget/mapContainer.h	Sun May 01 14:32:47 2016 +0200
@@ -155,6 +155,7 @@
         QPushButton * btnLoadMap;
         QPushButton * btnEditMap;
         QPushButton * btnRandomize;
+        QPushButton * btnRandTheme;
         QString selectedTheme;
         QPushButton * btnSeed;
         bool m_master;