sheepluva and unc0rr didn't like the idea of slider over preview.
authornemo
Sat, 08 Nov 2014 10:11:16 -0500
changeset 10471 d968b1ac130c
parent 10469 561b592183b0
child 10472 8d04cebedb16
sheepluva and unc0rr didn't like the idea of slider over preview.
QTfrontend/res/css/qt.css
QTfrontend/ui/widget/mapContainer.cpp
QTfrontend/ui/widget/mapContainer.h
--- a/QTfrontend/res/css/qt.css	Sat Nov 08 09:44:02 2014 -0500
+++ b/QTfrontend/res/css/qt.css	Sat Nov 08 10:11:16 2014 -0500
@@ -275,21 +275,27 @@
 height: 6px;
 border-radius: 3px;
 }
+/*
 #mapFeatureSize {
 margin-left: 3px;
 }
+*/
 
 #mapFeatureSize::groove::horizontal {
 /* background-color: #141250; 
 background-color: rgba(20, 18, 80, 50%);
 */
+/*
 background-color: rgba(0, 0, 0, 60%);
 }
 #mapFeatureSize::handle {
+*/
 /* background-color: #141250; */
+/*
 background-color: rgba(0, 0, 0, 60%);
 border-radius: 5px;
 }
+*/
 
 HatButton, ThemeButton {
 text-align: left;
--- a/QTfrontend/ui/widget/mapContainer.cpp	Sat Nov 08 09:44:02 2014 -0500
+++ b/QTfrontend/ui/widget/mapContainer.cpp	Sat Nov 08 10:11:16 2014 -0500
@@ -153,15 +153,6 @@
     leftLayout->addWidget(mapPreview, 0);
     connect(mapPreview, SIGNAL(clicked()), this, SLOT(previewClicked()));
 
-    mapFeatureSize = new QSlider(Qt::Horizontal, this);
-    mapFeatureSize->setObjectName("mapFeatureSize");
-    //mapFeatureSize->setTickPosition(QSlider::TicksBelow);
-    mapFeatureSize->setMaximum(100);
-    mapFeatureSize->setMinimum(1);
-    mapFeatureSize->setFixedWidth(259);
-    mapFeatureSize->setValue(50);
-    leftLayout->addWidget(mapFeatureSize, 0);
-
     /* Bottom-Left layout */
 
     QVBoxLayout * bottomLeftLayout = new QVBoxLayout();
@@ -230,6 +221,17 @@
     m_childWidgets << mazeStyles;
     rightLayout->addWidget(mazeStyles, 1);
 
+    mapFeatureSize = new QSlider(Qt::Horizontal, this);
+    mapFeatureSize->setObjectName("mapFeatureSize");
+    //mapFeatureSize->setTickPosition(QSlider::TicksBelow);
+    mapFeatureSize->setMaximum(100);
+    mapFeatureSize->setMinimum(1);
+    //mapFeatureSize->setFixedWidth(259);
+    mapFeatureSize->setValue(50);
+    mapFeatureSize->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+    bottomLeftLayout->addWidget(mapFeatureSize, 0);
+    connect(mapFeatureSize, SIGNAL(valueChanged(int)), this, SLOT(mapFeatureSizeChanged(int)));
+
     /* Mission description */
 
     lblDesc = new QLabel();
@@ -247,6 +249,8 @@
 
     btnTheme = new QPushButton(this);
     btnTheme->setFlat(true);
+    btnTheme->setIconSize(QSize(30, 30));
+    btnTheme->setFixedHeight(30);
     connect(btnTheme, SIGNAL(clicked()), this, SLOT(showThemePrompt()));
     m_childWidgets << btnTheme;
     bottomLeftLayout->addWidget(btnTheme, 0);
@@ -733,6 +737,7 @@
     lblDesc->hide();
     btnLoadMap->hide();
     btnEditMap->hide();
+    mapFeatureSize->show();
 
     switch (type)
     {
@@ -770,6 +775,7 @@
             lblMapList->setText(tr("Mission:"));
             lblMapList->show();
             missionMapList->show();
+	    mapFeatureSize->hide();
             lblDesc->setText(m_mapInfo.desc);
             lblDesc->show();
             emit mapChanged(m_curMap);
@@ -788,7 +794,7 @@
     }
 
     // Update theme button size
-    updateThemeButtonSize();
+    // updateThemeButtonSize();
 
     // Update cType combobox
     for (int i = 0; i < cType->count(); i++)
@@ -805,6 +811,11 @@
     emit mapgenChanged(mapgen);
 }
 
+void HWMapContainer::mapFeatureSizeChanged(int index)
+{
+}
+
+// unused because I needed the space for the slider
 void HWMapContainer::updateThemeButtonSize()
 {
     if (m_mapInfo.type == MapModel::MissionMap)
@@ -838,12 +849,12 @@
     m_theme = selectedTheme = current.data(ThemeModel::ActualNameRole).toString();
     m_themeID = current.row();
     QIcon icon = qVariantValue<QIcon>(current.data(Qt::DecorationRole));
-    QSize iconSize = icon.actualSize(QSize(65535, 65535));
-    btnTheme->setFixedHeight(64);
-    btnTheme->setIconSize(iconSize);
+    //QSize iconSize = icon.actualSize(QSize(65535, 65535));
+    //btnTheme->setFixedHeight(64);
+    //btnTheme->setIconSize(iconSize);
     btnTheme->setIcon(icon);
     btnTheme->setText(tr("Theme: %1").arg(current.data(Qt::DisplayRole).toString()));
-    updateThemeButtonSize();
+    // updateThemeButtonSize();
 }
 
 void HWMapContainer::staticMapChanged(const QModelIndex & map, const QModelIndex & old)
--- a/QTfrontend/ui/widget/mapContainer.h	Sat Nov 08 09:44:02 2014 -0500
+++ b/QTfrontend/ui/widget/mapContainer.h	Sat Nov 08 10:11:16 2014 -0500
@@ -103,6 +103,7 @@
         void addInfoToPreview(const QPixmap & image);
         void setNewSeed(const QString & newSeed);
         void mapTypeChanged(int);
+        void mapFeatureSizeChanged(int);
         void showThemePrompt();
         void updateTheme(const QModelIndex & current);
         void staticMapChanged(const QModelIndex & map, const QModelIndex & old = QModelIndex());