Commit 878ef962 authored by Albert Astals Cid's avatar Albert Astals Cid

Merge remote-tracking branch 'origin/Applications/17.08'

parents b3e941e7 e31bea04
......@@ -232,26 +232,21 @@ void MouseAnnotation::routeKeyPressEvent( const QKeyEvent * e )
void MouseAnnotation::routeTooltipEvent( const QHelpEvent * helpEvent )
{
/* qDebug() << "MouseAnnotation::routeTooltipEvent, event " << helpEvent; */
const QPoint eventPos = m_pageView->contentAreaPoint( helpEvent->pos() );
if ( m_mouseOverAnnotation.isValid() &&
m_mouseOverAnnotation.annotation->subType() != Okular::Annotation::AWidget )
{
const ResizeHandle handle = getHandleAt( eventPos - m_mouseOverAnnotation.pageViewItem->uncroppedGeometry().topLeft(), m_mouseOverAnnotation );
if ( handle != RH_None )
{
/* get boundingRect in uncropped page coordinates */
QRect boundingRect = Okular::AnnotationUtils::annotationGeometry(
m_mouseOverAnnotation.annotation, m_mouseOverAnnotation.pageViewItem->uncroppedWidth(),
m_mouseOverAnnotation.pageViewItem->uncroppedHeight() );
/* uncropped page to content area */
boundingRect.translate( m_mouseOverAnnotation.pageViewItem->uncroppedGeometry().topLeft() );
/* content area to viewport */
boundingRect.translate( -m_pageView->contentAreaPosition() );
QString tip = GuiUtils::prettyToolTip( m_mouseOverAnnotation.annotation );
QToolTip::showText( helpEvent->globalPos(), tip, m_pageView->viewport(), boundingRect );
}
/* get boundingRect in uncropped page coordinates */
QRect boundingRect = Okular::AnnotationUtils::annotationGeometry(
m_mouseOverAnnotation.annotation, m_mouseOverAnnotation.pageViewItem->uncroppedWidth(),
m_mouseOverAnnotation.pageViewItem->uncroppedHeight() );
/* uncropped page to content area */
boundingRect.translate( m_mouseOverAnnotation.pageViewItem->uncroppedGeometry().topLeft() );
/* content area to viewport */
boundingRect.translate( -m_pageView->contentAreaPosition() );
const QString tip = GuiUtils::prettyToolTip( m_mouseOverAnnotation.annotation );
QToolTip::showText( helpEvent->globalPos(), tip, m_pageView->viewport(), boundingRect );
}
}
......
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