diff --git a/plugins/Eq/EqParameterWidget.cpp b/plugins/Eq/EqParameterWidget.cpp index e65dc9c3d..1525877ee 100644 --- a/plugins/Eq/EqParameterWidget.cpp +++ b/plugins/Eq/EqParameterWidget.cpp @@ -48,6 +48,8 @@ EqParameterWidget::EqParameterWidget( QWidget *parent, EqControls * controls ) : m_scale = 1.5; m_pixelsPerOctave = freqToXPixel( 10000 ) - freqToXPixel( 5000 ); m_controls = controls; + tf = new TextFloat(); + tf->hide(); } @@ -154,6 +156,8 @@ void EqParameterWidget::mouseReleaseEvent( QMouseEvent *event ) { m_controls->m_analyseOut = !m_controls->m_analyseOut; } + + tf->hide(); } @@ -181,6 +185,15 @@ void EqParameterWidget::mouseMoveEvent( QMouseEvent *event ) break; } } + if( m_oldX > 0 && m_oldX < width() && m_oldY > 0 && m_oldY < height() ) + { + tf->setText( QString::number(xPixelToFreq( m_oldX )) + tr( "Hz ") ); + tf->show(); + const int x = event->x() > width() * 0.5 ? + m_oldX - tf->width() : + m_oldX; + tf->moveGlobal(this, QPoint( x, m_oldY - tf->height() ) ); + } } diff --git a/plugins/Eq/EqParameterWidget.h b/plugins/Eq/EqParameterWidget.h index b553ce6f2..eb83ec962 100644 --- a/plugins/Eq/EqParameterWidget.h +++ b/plugins/Eq/EqParameterWidget.h @@ -27,6 +27,7 @@ #define EQPARAMETERWIDGET_H #include #include "EffectControls.h" +#include "TextFloat.h" class EqControls; @@ -121,6 +122,7 @@ private: float m_pixelsPerOctave; float m_scale; EqBand* m_selectedBand; + TextFloat *tf; EqBand* selectNearestHandle( const int x, const int y );