[vlc-commits] Qt: align tooltip to slider groove (fix #14277)

Francois Cartegnie git at videolan.org
Sun Apr 5 22:20:37 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Apr  5 22:19:33 2015 +0200| [e1ef115131f8fb78806cdddc266bbf5cb21b2158] | committer: Francois Cartegnie

Qt: align tooltip to slider groove (fix #14277)

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

 modules/gui/qt4/util/input_slider.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/util/input_slider.cpp b/modules/gui/qt4/util/input_slider.cpp
index d67f2b8..5819e47 100644
--- a/modules/gui/qt4/util/input_slider.cpp
+++ b/modules/gui/qt4/util/input_slider.cpp
@@ -341,7 +341,7 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
     /* Tooltip */
     if ( inputLength > 0 )
     {
-        int margin = handleLength() / 2;
+        int margin = handleLength();
         int posX = qMax( rect().left() + margin, qMin( rect().right() - margin, event->x() ) );
 
         QString chapterLabel;
@@ -352,7 +352,7 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
             int i_selected = -1;
             for( int i = 0 ; i < points.count() ; i++ )
             {
-                int x = points.at(i).time / 1000000.0 / inputLength * size().width();
+                int x = margin + points.at(i).time / 1000000.0 / inputLength * (size().width() - 2*margin);
                 if ( event->x() >= x )
                     i_selected = i;
             }



More information about the vlc-commits mailing list