diff widgets/PropertyBox.cpp @ 168:d4be66d61c04

* Make audio dial remember its more accurate mapped value as well as its display position * Add tool tip support to audio dial to show values
author Chris Cannam
date Tue, 17 Oct 2006 13:04:49 +0000
parents 53b9c7656798
children bdba24db0446
line wrap: on
line diff
--- a/widgets/PropertyBox.cpp	Mon Oct 16 20:42:23 2006 +0000
+++ b/widgets/PropertyBox.cpp	Tue Oct 17 13:04:49 2006 +0000
@@ -181,11 +181,12 @@
 	gainDial->setFixedWidth(24);
 	gainDial->setFixedHeight(24);
 	gainDial->setNotchesVisible(false);
-	gainDial->setToolTip(tr("Playback Level"));
+//!!!	gainDial->setToolTip(tr("Playback Level"));
 	gainDial->setDefaultValue(0);
-        gainDial->setObjectName(tr("Playback Level"));
+        gainDial->setObjectName(tr("Playback Gain"));
         gainDial->setRangeMapper(new LinearRangeMapper
                                  (-50, 50, -25, 25, tr("dB")));
+        gainDial->setShowToolTip(true);
 	connect(gainDial, SIGNAL(valueChanged(int)),
 		this, SLOT(playGainDialChanged(int)));
 	connect(params, SIGNAL(playGainChanged(float)),
@@ -207,7 +208,8 @@
 	panDial->setNotchesVisible(false);
 	panDial->setToolTip(tr("Playback Pan / Balance"));
 	panDial->setDefaultValue(0);
-        gainDial->setObjectName(tr("Playback Pan / Balance"));
+        panDial->setObjectName(tr("Playback Pan / Balance"));
+        panDial->setShowToolTip(true);
 	connect(panDial, SIGNAL(valueChanged(int)),
 		this, SLOT(playPanDialChanged(int)));
 	connect(params, SIGNAL(playPanChanged(float)),
@@ -324,13 +326,14 @@
 	    dial->setNotchesVisible((max - min) <= 12);
 	    dial->setDefaultValue(value);
             dial->setRangeMapper(m_container->getNewPropertyRangeMapper(name));
+            dial->setShowToolTip(true);
 	    connect(dial, SIGNAL(valueChanged(int)),
 		    this, SLOT(propertyControllerChanged(int)));
 
 	    if (inGroup) {
 		dial->setFixedWidth(24);
 		dial->setFixedHeight(24);
-		dial->setToolTip(propertyLabel);
+//!!!		dial->setToolTip(propertyLabel);
 		m_groupLayouts[groupName]->addWidget(dial);
 	    } else {
 		dial->setFixedWidth(32);
@@ -485,13 +488,13 @@
 	m_container->setPropertyWithCommand(name, value);
     }
 
-    if (type == PropertyContainer::RangeProperty) {
-	AudioDial *dial = dynamic_cast<AudioDial *>(m_propertyControllers[name]);
-	if (dial) {
-	    dial->setToolTip(QString("%1: %2").arg(name).arg(value));
-	    //!!! unfortunately this doesn't update an already-visible tooltip
-	}
-    }
+//    if (type == PropertyContainer::RangeProperty) {
+//	AudioDial *dial = dynamic_cast<AudioDial *>(m_propertyControllers[name]);
+//!!!	if (dial) {
+//	    dial->setToolTip(QString("%1: %2").arg(name).arg(value));
+//	    //!!! unfortunately this doesn't update an already-visible tooltip
+//	}
+//    }
 }
     
 void