[vlc-commits] Qt4: Use the width of the new text to calculate the tooltip position.

Tobias Güntner git at videolan.org
Fri Jan 27 01:17:20 CET 2012


vlc/vlc-2.0 | branch: master | Tobias Güntner <fatbull at web.de> | Thu Jan 26 03:22:18 2012 +0100| [3fd82b92b438f76fa6509713fc24fc7aa1eb8471] | committer: Jean-Baptiste Kempf

Qt4: Use the width of the new text to calculate the tooltip position.

Signed-off-by: Ludovic Fauvet <etix at videolan.org>
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit d8ed5645a0835a2fa9b65513555cc958ccee6197)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/util/input_slider.cpp |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/util/input_slider.cpp b/modules/gui/qt4/util/input_slider.cpp
index 77494a6..a4a2c62 100644
--- a/modules/gui/qt4/util/input_slider.cpp
+++ b/modules/gui/qt4/util/input_slider.cpp
@@ -244,8 +244,6 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
         int posX = qMax( rect().left(), qMin( rect().right(), event->x() ) );
 
         QString chapterLabel;
-        QPoint p( event->globalX() - ( event->x() - posX ) - ( mTimeTooltip->width() / 2 ),
-                  QWidget::mapToGlobal( pos() ).y() - ( mTimeTooltip->height() + 2 ) );
 
         if ( orientation() == Qt::Horizontal ) /* TODO: vertical */
         {
@@ -266,6 +264,9 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
 
         secstotimestr( psz_length, ( posX * inputLength ) / size().width() );
         mTimeTooltip->setText( psz_length, chapterLabel );
+
+        QPoint p( event->globalX() - ( event->x() - posX ) - ( mTimeTooltip->width() / 2 ),
+                  QWidget::mapToGlobal( pos() ).y() - ( mTimeTooltip->height() + 2 ) );
         mTimeTooltip->move( p );
     }
     event->accept();



More information about the vlc-commits mailing list