Commit 3fd82b92 authored by Tobias Güntner's avatar Tobias Güntner Committed by Jean-Baptiste Kempf

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

Signed-off-by: default avatarLudovic Fauvet <etix@videolan.org>
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit d8ed5645a0835a2fa9b65513555cc958ccee6197)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent d6e7d451
...@@ -244,8 +244,6 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event ) ...@@ -244,8 +244,6 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
int posX = qMax( rect().left(), qMin( rect().right(), event->x() ) ); int posX = qMax( rect().left(), qMin( rect().right(), event->x() ) );
QString chapterLabel; 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 */ if ( orientation() == Qt::Horizontal ) /* TODO: vertical */
{ {
...@@ -266,6 +264,9 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event ) ...@@ -266,6 +264,9 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
secstotimestr( psz_length, ( posX * inputLength ) / size().width() ); secstotimestr( psz_length, ( posX * inputLength ) / size().width() );
mTimeTooltip->setText( psz_length, chapterLabel ); 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 ); mTimeTooltip->move( p );
} }
event->accept(); event->accept();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment