# HG changeset patch # User sheepluva # Date 1462105967 -7200 # Node ID 947e2d53afc17b5db1a7684f5a1a3f7552eeae12 # Parent b1bf4c93f7ce990216902ad1f92b2db44b3079de add button to randomize theme only diff -r b1bf4c93f7ce -r 947e2d53afc1 QTfrontend/ui/widget/mapContainer.cpp --- 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(); diff -r b1bf4c93f7ce -r 947e2d53afc1 QTfrontend/ui/widget/mapContainer.h --- 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;