Commit e1ef1151 authored by Francois Cartegnie's avatar Francois Cartegnie

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

parent 4e9f9cc4
...@@ -341,7 +341,7 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event ) ...@@ -341,7 +341,7 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
/* Tooltip */ /* Tooltip */
if ( inputLength > 0 ) if ( inputLength > 0 )
{ {
int margin = handleLength() / 2; int margin = handleLength();
int posX = qMax( rect().left() + margin, qMin( rect().right() - margin, event->x() ) ); int posX = qMax( rect().left() + margin, qMin( rect().right() - margin, event->x() ) );
QString chapterLabel; QString chapterLabel;
...@@ -352,7 +352,7 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event ) ...@@ -352,7 +352,7 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
int i_selected = -1; int i_selected = -1;
for( int i = 0 ; i < points.count() ; i++ ) 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 ) if ( event->x() >= x )
i_selected = i; i_selected = i;
} }
......
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