vlc/vlc-2.0 | branch: master | Tobias Güntner <[email protected]> | 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 <[email protected]> Signed-off-by: Jean-Baptiste Kempf <[email protected]> (cherry picked from commit d8ed5645a0835a2fa9b65513555cc958ccee6197) Signed-off-by: Jean-Baptiste Kempf <[email protected]> > 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(); _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
