Qt4 - Add a "medium" volume icon as requested on IRC, ( by Quovodis?)
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 22 Dec 2007 19:21:17 +0000 (19:21 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 22 Dec 2007 19:21:17 +0000 (19:21 +0000)
modules/gui/qt4/Modules.am
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/pixmaps/volume-medium.png [new file with mode: 0644]
modules/gui/qt4/res.qrc

index 69b4b6b..cf73db2 100644 (file)
@@ -224,6 +224,7 @@ EXTRA_DIST += \
        pixmaps/type_playlist.png \
        pixmaps/type_unknown.xpm \
        pixmaps/volume-high.png \
+       pixmaps/volume-medium.png \
        pixmaps/volume-low.png \
        pixmaps/volume-muted.png \
        pixmaps/volume-slider.svg \
index f5bc042..cd5ffc6 100644 (file)
@@ -596,7 +596,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
     VolumeClickHandler *hVolLabel = new VolumeClickHandler( p_intf, this );
 
     volMuteLabel = new QLabel;
-    volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) );
+    volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-medium.png" ) );
     volMuteLabel->setToolTip( qtr( "Mute" ) );
     volMuteLabel->installEventFilter( hVolLabel );
     controlLayout->addWidget( volMuteLabel, 3, 15, Qt::AlignBottom );
@@ -690,9 +690,11 @@ void ControlsWidget::updateVolume( int i_sliderVolume )
     }
     if( i_sliderVolume == 0 )
         volMuteLabel->setPixmap( QPixmap(":/pixmaps/volume-muted.png" ) );
-    else if( i_sliderVolume < VOLUME_MAX / 2 )
+    else if( i_sliderVolume < VOLUME_MAX / 3 )
         volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
-    else volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) );
+    else if( i_sliderVolume > (VOLUME_MAX * 2 / 3 ) )
+        volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) );
+    else volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-medium.png" ) );
 }
 
 void ControlsWidget::updateOnTimer()
diff --git a/modules/gui/qt4/pixmaps/volume-medium.png b/modules/gui/qt4/pixmaps/volume-medium.png
new file mode 100644 (file)
index 0000000..3d042f5
Binary files /dev/null and b/modules/gui/qt4/pixmaps/volume-medium.png differ
index 4c16f9c..1857650 100644 (file)
@@ -60,6 +60,7 @@
   <file>pixmaps/type_node.png</file>
   <file>pixmaps/type_playlist.png</file>
   <file>pixmaps/volume-high.png</file>
+  <file>pixmaps/volume-medium.png</file>
   <file>pixmaps/volume-low.png</file>
   <file>pixmaps/volume-muted.png</file>
   <file>pixmaps/volume-slider-inside.png</file>