@ -240,8 +240,6 @@ void UBDocumentNavigator::updateThumbnail(int index)
oldItem = NULL ;
oldItem = NULL ;
}
}
ensureVisible ( 0 , 0 , 10 , 10 ) ;
refreshScene ( ) ;
refreshScene ( ) ;
}
}
@ -259,6 +257,7 @@ void UBDocumentNavigator::removeThumbnail(int index)
//update thumbs page number accordingly
//update thumbs page number accordingly
for ( int i = 0 ; i < mThumbsWithLabels . length ( ) ; i + + )
for ( int i = 0 ; i < mThumbsWithLabels . length ( ) ; i + + )
{
{
mThumbsWithLabels . at ( i ) . getThumbnail ( ) - > setSceneIndex ( i ) ;
mThumbsWithLabels . at ( i ) . getCaption ( ) - > setText ( tr ( " Page %0 " ) . arg ( i + 1 ) ) ;
mThumbsWithLabels . at ( i ) . getCaption ( ) - > setText ( tr ( " Page %0 " ) . arg ( i + 1 ) ) ;
}
}
@ -372,11 +371,11 @@ void UBDocumentNavigator::resizeEvent(QResizeEvent *event)
// Update the thumbnails width
// Update the thumbnails width
mThumbnailWidth = ( width ( ) > mThumbnailMinWidth ) ? width ( ) - 2 * border ( ) : mThumbnailMinWidth ;
mThumbnailWidth = ( width ( ) > mThumbnailMinWidth ) ? width ( ) - 2 * border ( ) : mThumbnailMinWidth ;
if ( mSelectedThumbnail )
ensureVisible ( mSelectedThumbnail ) ;
// Refresh the scene
// Refresh the scene
refreshScene ( ) ;
refreshScene ( ) ;
if ( mSelectedThumbnail )
ensureVisible ( mSelectedThumbnail ) ;
}
}
/**
/**
@ -617,8 +616,6 @@ void UBDocumentNavigator::dragMoveEvent(QDragMoveEvent *event)
int thumbnailHeight = mThumbnailWidth / UBSettings : : minScreenRatio ;
int thumbnailHeight = mThumbnailWidth / UBSettings : : minScreenRatio ;
QRectF thumbnailArea ( 0 , scenePos . y ( ) - thumbnailHeight / 2 , mThumbnailWidth , thumbnailHeight ) ;
QRectF thumbnailArea ( 0 , scenePos . y ( ) - thumbnailHeight / 2 , mThumbnailWidth , thumbnailHeight ) ;
ensureVisible ( thumbnailArea ) ;
UBSceneThumbnailNavigPixmap * item = dynamic_cast < UBSceneThumbnailNavigPixmap * > ( itemAt ( position . toPoint ( ) ) ) ;
UBSceneThumbnailNavigPixmap * item = dynamic_cast < UBSceneThumbnailNavigPixmap * > ( itemAt ( position . toPoint ( ) ) ) ;
if ( item )
if ( item )
{
{
@ -642,7 +639,7 @@ void UBDocumentNavigator::dragMoveEvent(QDragMoveEvent *event)
{
{
y = item - > pos ( ) . y ( ) - UBSettings : : thumbnailSpacing / 2 ;
y = item - > pos ( ) . y ( ) - UBSettings : : thumbnailSpacing / 2 ;
if ( mDropBar - > y ( ) ! = y )
if ( mDropBar - > y ( ) ! = y )
mDropBar - > setRect ( QRectF ( item - > pos ( ) . x ( ) , y , mThumbnailWidth - verticalScrollBar ( ) - > width ( ) , 3 ) ) ;
mDropBar - > setRect ( QRectF ( item - > pos ( ) . x ( ) , y , ( item - > boundingRect ( ) . width ( ) - verticalScrollBar ( ) - > width ( ) ) * scale , 3 ) ) ;
}
}
}
}
else
else
@ -651,11 +648,14 @@ void UBDocumentNavigator::dragMoveEvent(QDragMoveEvent *event)
{
{
y = item - > pos ( ) . y ( ) + item - > boundingRect ( ) . height ( ) * scale + UBSettings : : thumbnailSpacing / 2 ;
y = item - > pos ( ) . y ( ) + item - > boundingRect ( ) . height ( ) * scale + UBSettings : : thumbnailSpacing / 2 ;
if ( mDropBar - > y ( ) ! = y )
if ( mDropBar - > y ( ) ! = y )
mDropBar - > setRect ( QRectF ( item - > pos ( ) . x ( ) , y , mThumbnailWidth - verticalScrollBar ( ) - > width ( ) , 3 ) ) ;
mDropBar - > setRect ( QRectF ( item - > pos ( ) . x ( ) , y , ( item - > boundingRect ( ) . width ( ) - verticalScrollBar ( ) - > width ( ) ) * scale , 3 ) ) ;
}
}
}
}
}
}
}
}
ensureVisible ( thumbnailArea ) ;
event - > acceptProposedAction ( ) ;
event - > acceptProposedAction ( ) ;
}
}