changeset 1445:8e4e598a8c25 3.0-integration

Add swatches to colour map combo (optionally, as it turns out they are quite visually distracting)
author Chris Cannam
date Fri, 16 Dec 2016 15:55:59 +0000
parents 90189d1383e3
children c88ddb8aae21
files .hgsubstate main/PreferencesDialog.cpp
diffstat 2 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Fri Dec 16 14:16:06 2016 +0000
+++ b/.hgsubstate	Fri Dec 16 15:55:59 2016 +0000
@@ -9,5 +9,5 @@
 5f67a29f0fc7f1b908f7cde4866173a7af337862 sv-dependency-builds
 be83e81d915603712fb32b434f19945b7694811b svapp
 576be7933ec70cd7a24327536c6ad5e315c51bde svcore
-69ff93e0c6243be3990604adcfb2a24938448a6e svgui
+73d43e410a6b78d5ec029f29a3d912142046617a svgui
 0eebd22a081a824067bf3d5de65326696feab653 vamp-plugin-sdk
--- a/main/PreferencesDialog.cpp	Fri Dec 16 14:16:06 2016 +0000
+++ b/main/PreferencesDialog.cpp	Fri Dec 16 15:55:59 2016 +0000
@@ -38,6 +38,7 @@
 
 #include "widgets/WindowTypeSelector.h"
 #include "widgets/IconLoader.h"
+#include "widgets/ColourMapComboBox.h"
 #include "base/Preferences.h"
 #include "base/ResourceFinder.h"
 #include "layer/ColourMapper.h"
@@ -145,22 +146,21 @@
     m_colour3DColour = (settings.value("colour-3d-plot-colour",
                                        int(ColourMapper::Green)).toInt());
     settings.endGroup();
-    QComboBox *spectrogramGColour = new QComboBox;
-    QComboBox *spectrogramMColour = new QComboBox;
-    QComboBox *colour3DColour = new QComboBox;
-    for (i = 0; i < ColourMapper::getColourMapCount(); ++i) {
-        spectrogramGColour->addItem(ColourMapper::getColourMapName(i));
-        spectrogramMColour->addItem(ColourMapper::getColourMapName(i));
-        colour3DColour->addItem(ColourMapper::getColourMapName(i));
-        if (i == m_spectrogramGColour) spectrogramGColour->setCurrentIndex(i);
-        if (i == m_spectrogramMColour) spectrogramMColour->setCurrentIndex(i);
-        if (i == m_colour3DColour) colour3DColour->setCurrentIndex(i);
-    }
-    connect(spectrogramGColour, SIGNAL(currentIndexChanged(int)),
+
+    ColourMapComboBox *spectrogramGColour = new ColourMapComboBox(true);
+    spectrogramGColour->setCurrentIndex(m_spectrogramGColour);
+
+    ColourMapComboBox *spectrogramMColour = new ColourMapComboBox(true);
+    spectrogramMColour->setCurrentIndex(m_spectrogramMColour);
+
+    ColourMapComboBox *colour3DColour = new ColourMapComboBox(true);
+    colour3DColour->setCurrentIndex(m_colour3DColour);
+
+    connect(spectrogramGColour, SIGNAL(colourMapChanged(int)),
             this, SLOT(spectrogramGColourChanged(int)));
-    connect(spectrogramMColour, SIGNAL(currentIndexChanged(int)),
+    connect(spectrogramMColour, SIGNAL(colourMapChanged(int)),
             this, SLOT(spectrogramMColourChanged(int)));
-    connect(colour3DColour, SIGNAL(currentIndexChanged(int)),
+    connect(colour3DColour, SIGNAL(colourMapChanged(int)),
             this, SLOT(colour3DColourChanged(int)));
 
     m_tuningFrequency = prefs->getTuningFrequency();