]> git.sesse.net Git - vlc/commitdiff
Moves volume icon update in the timer
authorRafaël Carré <funman@videolan.org>
Sat, 8 Sep 2007 19:51:34 +0000 (19:51 +0000)
committerRafaël Carré <funman@videolan.org>
Sat, 8 Sep 2007 19:51:34 +0000 (19:51 +0000)
Sets default icon to high

modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp

index 51e31a0de94989b40d3f574dd447f4c09d139da8..13b3af4591c20ded593707aac32ad51c4db9e0f9 100644 (file)
@@ -6,6 +6,7 @@
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
+ *          Rafaël Carré <funman@videolanorg>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -469,7 +470,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
     VolumeClickHandler *h = new VolumeClickHandler( p_intf, this );
 
     volMuteLabel = new QLabel;
-    volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
+    volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) );
     volMuteLabel->setToolTip( qtr( "Mute" ) );
     volMuteLabel->installEventFilter( h );
 
@@ -560,11 +561,6 @@ void ControlsWidget::updateVolume( int i_sliderVolume )
         int i_res = i_sliderVolume * AOUT_VOLUME_MAX /
                             ( 2*volumeSlider->maximum() );
         aout_VolumeSet( p_intf, i_res );
-        if( i_sliderVolume == 0 )
-            volMuteLabel->setPixmap( QPixmap(":/pixmaps/volume-muted.png" ) );
-        else if( i_sliderVolume < volumeSlider->maximum()/2 )
-            volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
-        else volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) );
     }
 }
 
@@ -582,6 +578,11 @@ void ControlsWidget::updateOnTimer()
         volumeSlider->setValue( i_volume );
         b_my_volume = false;
     }
+    if( i_volume == 0 )
+        volMuteLabel->setPixmap( QPixmap(":/pixmaps/volume-muted.png" ) );
+    else if( i_volume < volumeSlider->maximum()/2 )
+        volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
+    else volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) );
 
     /* Activate the interface buttons according to the presence of the input */
     enableInput( THEMIM->getIM()->hasInput() );
index 0cdaf0efe0e8dd19156f127dbc105e623813e26f..cfbb1c7aa61e119b7e3e2edf4f0a6bed71ff6390 100644 (file)
@@ -6,6 +6,7 @@
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
+ *          Rafaël Carré <funman@videolanorg>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -184,9 +185,7 @@ public:
     {
         if (e->type() == QEvent::MouseButtonPress )
         {
-            /* Mute it */
             aout_VolumeMute( p_intf, NULL );
-            m->updateVolume( 0 );
             return true;
         }
         return false;