]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/controller_widget.cpp
Qt: SoundSlider: always emit valuechange on slider move (fix #4658)
[vlc] / modules / gui / qt4 / components / controller_widget.cpp
index 328ec14242ffb1d0a135dab129a405da72ae4c11..e77cdec08bd482def44cf5132bfae9218a75f973 100644 (file)
@@ -93,6 +93,7 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
     else
     {
         volumeSlider = new QSlider( NULL );
+        volumeSlider->setAttribute( Qt::WA_MacSmallSize);
         volumeSlider->setOrientation( b_special ? Qt::Vertical
                                                 : Qt::Horizontal );
         volumeSlider->setMaximum( var_InheritBool( p_intf, "qt-volume-complete" )
@@ -111,8 +112,8 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
     updateMuteStatus();
 
     /* Volume control connection */
-    CONNECT( volumeSlider, valueChanged( int ), this, refreshLabels( void ) );
-    CONNECT( volumeSlider, sliderMoved( int ), this, userUpdateVolume( int ) );
+    volumeSlider->setTracking( true );
+    CONNECT( volumeSlider, valueChanged( int ), this, userUpdateVolume( int ) );
     CONNECT( THEMIM, volumeChanged( void ), this, libUpdateVolume( void ) );
     CONNECT( THEMIM, soundMuteChanged( void ), this, updateMuteStatus( void ) );
 }
@@ -150,6 +151,7 @@ void SoundWidget::userUpdateVolume( int i_sliderVolume )
     playlist_t *p_playlist = pl_Get( p_intf );
     int i_res = i_sliderVolume  * (AOUT_VOLUME_MAX / 2) / VOLUME_MAX;
     aout_VolumeSet( p_playlist, i_res );
+    refreshLabels();
 }
 
 /* libvlc changed value event slot */
@@ -159,7 +161,7 @@ void SoundWidget::libUpdateVolume()
     audio_volume_t i_volume;
     playlist_t *p_playlist = pl_Get( p_intf );
 
-    aout_VolumeGet( p_playlist, &i_volume );
+    i_volume = aout_VolumeGet( p_playlist );
     i_volume = ( ( i_volume + 1 ) *  VOLUME_MAX )/ (AOUT_VOLUME_MAX/2);
     int i_gauge = volumeSlider->value();
     if ( !b_is_muted && /* do not show mute effect on volume (set to 0) */