Take the margin into account in mouse{Press,Release}Event

svn path=/trunk/KDE/kdegraphics/okular/; revision=718756
This commit is contained in:
Pascal Létourneau 2007-09-29 16:36:14 +00:00
parent 44dd16d127
commit d0fd4b6f26

View file

@ -582,7 +582,7 @@ void ThumbnailWidget::mousePressEvent( QMouseEvent * e )
{
QRect r = m_visibleRect.geometry( m_pixmapWidth, m_pixmapHeight );
if ( e->button() != Qt::RightButton && r.contains( e->pos() ) )
if ( e->button() != Qt::RightButton && r.contains( e->pos() - QPoint( m_margin / 2, m_margin / 2 ) ) )
{
mouseGrabPos = e->pos();
}
@ -596,7 +596,7 @@ void ThumbnailWidget::mousePressEvent( QMouseEvent * e )
void ThumbnailWidget::mouseReleaseEvent( QMouseEvent * e )
{
QRect r = m_visibleRect.geometry( m_pixmapWidth, m_pixmapHeight );
if ( r.contains( e->pos() ) )
if ( r.contains( e->pos() - QPoint( m_margin / 2, m_margin / 2 ) ) )
{
setCursor( Qt::OpenHandCursor );
}