[vlc-commits] Qt4: Use the width of the new text to calculate the tooltip position.
Tobias Güntner
git at videolan.org
Thu Jan 26 15:17:16 CET 2012
vlc | branch: master | Tobias Güntner <fatbull at web.de> | Thu Jan 26 03:22:18 2012 +0100| [d8ed5645a0835a2fa9b65513555cc958ccee6197] | 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>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d8ed5645a0835a2fa9b65513555cc958ccee6197
---
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