[vlc-devel] commit: Small Sound Slider issue fixed. (Jean-Baptiste Kempf )

git version control git at videolan.org
Tue Aug 19 01:56:28 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Aug 18 16:04:42 2008 -0700| [b50c1cab2b03a292c969828822cf2045c1938f9e] | committer: Jean-Baptiste Kempf 

Small Sound Slider issue fixed.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b50c1cab2b03a292c969828822cf2045c1938f9e
---

 .../qt4/pixmaps/toolbar/volume-slider-inside.png   |  Bin 273 -> 276 bytes
 .../qt4/pixmaps/toolbar/volume-slider-outside.png  |  Bin 988 -> 757 bytes
 modules/gui/qt4/util/input_slider.cpp              |    8 +++-----
 modules/gui/qt4/util/input_slider.hpp              |    2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt4/pixmaps/toolbar/volume-slider-inside.png b/modules/gui/qt4/pixmaps/toolbar/volume-slider-inside.png
index 5bbd300..7b2a3cd 100644
Binary files a/modules/gui/qt4/pixmaps/toolbar/volume-slider-inside.png and b/modules/gui/qt4/pixmaps/toolbar/volume-slider-inside.png differ
diff --git a/modules/gui/qt4/pixmaps/toolbar/volume-slider-outside.png b/modules/gui/qt4/pixmaps/toolbar/volume-slider-outside.png
index fbbf892..9105b08 100644
Binary files a/modules/gui/qt4/pixmaps/toolbar/volume-slider-outside.png and b/modules/gui/qt4/pixmaps/toolbar/volume-slider-outside.png differ
diff --git a/modules/gui/qt4/util/input_slider.cpp b/modules/gui/qt4/util/input_slider.cpp
index 767cef7..cb85822 100644
--- a/modules/gui/qt4/util/input_slider.cpp
+++ b/modules/gui/qt4/util/input_slider.cpp
@@ -215,7 +215,7 @@ void SoundSlider::mouseMoveEvent( QMouseEvent *event )
     }
     else
     {
-        int i = ( event->x() - paddingL ) * maximum() / WLENGTH;
+        int i = ( ( event->x() - paddingL ) * maximum() + 40 ) / WLENGTH;
         i = __MIN( __MAX( 0, i ), maximum() );
         setToolTip( QString("%1  \%" ).arg( i ) );
     }
@@ -223,15 +223,13 @@ void SoundSlider::mouseMoveEvent( QMouseEvent *event )
 
 void SoundSlider::changeValue( int x )
 {
-    setValue( x * maximum() / WLENGTH );
+    setValue( (x * maximum() + 40 ) / WLENGTH );
 }
 
 void SoundSlider::paintEvent(QPaintEvent *e)
 {
     QPainter painter( this );
-    const int offset = int(
-            double( WLENGTH * value() ) /
-            double( maximum() ) ) + paddingL;
+    const int offset = int( ( WLENGTH * value() + 100 ) / maximum() ) + paddingL;
 
     const QRectF boundsG( 0, 0, offset , pixGradient.height() );
     painter.drawPixmap( boundsG, pixGradient, boundsG );
diff --git a/modules/gui/qt4/util/input_slider.hpp b/modules/gui/qt4/util/input_slider.hpp
index 8e20df7..39b5066 100644
--- a/modules/gui/qt4/util/input_slider.hpp
+++ b/modules/gui/qt4/util/input_slider.hpp
@@ -65,7 +65,7 @@ public:
     virtual ~SoundSlider() {};
 
 protected:
-    const static int paddingL = 4;
+    const static int paddingL = 3;
     const static int paddingR = 2;
     virtual void paintEvent(QPaintEvent *);
     virtual void wheelEvent( QWheelEvent *event );




More information about the vlc-devel mailing list