Fixed a thumbnail display issue

preferencesAboutTextFull
Didier 14 years ago
parent 2b856c4c15
commit caed6ffe53
  1. 4
      src/core/UBDisplayManager.cpp
  2. 2
      src/desktop/UBDesktopAnnotationController.cpp
  3. 2
      src/gui/UBDockPalette.cpp
  4. 4
      src/gui/UBFloatingPalette.cpp
  5. 13
      src/pdf/XPDFRenderer.cpp

@ -117,7 +117,7 @@ void UBDisplayManager::setAsControl(QWidget* pControlWidget )
mControlWidget->showFullScreen(); mControlWidget->showFullScreen();
// !!!! Should be included into Windows after QT recompilation // !!!! Should be included into Windows after QT recompilation
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
mControlWidget->setAttribute(Qt::WA_MacNoShadow); // mControlWidget->setAttribute(Qt::WA_MacNoShadow);
#endif #endif
} }
} }
@ -133,7 +133,7 @@ void UBDisplayManager::setAsDisplay(QWidget* pDisplayWidget)
mDisplayWidget->showFullScreen(); mDisplayWidget->showFullScreen();
// !!!! Should be included into Windows after QT recompilation // !!!! Should be included into Windows after QT recompilation
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
mDisplayWidget->setAttribute(Qt::WA_MacNoShadow); // mDisplayWidget->setAttribute(Qt::WA_MacNoShadow);
#endif #endif
} }
} }

@ -64,7 +64,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true); mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true);
// !!!! Should be included into Windows after QT recompilation // !!!! Should be included into Windows after QT recompilation
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true); //mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true);
#endif #endif
mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window); mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window);
mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone); mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone);

@ -38,7 +38,7 @@ UBDockPalette::UBDockPalette(QWidget *parent, const char *name)
// !!!! Should be included into Windows after QT recompilation // !!!! Should be included into Windows after QT recompilation
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
setAttribute(Qt::WA_MacNoShadow); //setAttribute(Qt::WA_MacNoShadow);
#endif #endif
} }

@ -33,8 +33,8 @@ UBFloatingPalette::UBFloatingPalette(Qt::Corner position, QWidget *parent)
setAttribute(Qt::WA_MacAlwaysShowToolWindow); setAttribute(Qt::WA_MacAlwaysShowToolWindow);
#endif #endif
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
setAttribute(Qt::WA_MacNonActivatingToolWindow); //setAttribute(Qt::WA_MacNonActivatingToolWindow);
setAttribute(Qt::WA_MacNoShadow); //setAttribute(Qt::WA_MacNoShadow);
#endif #endif
} }

@ -127,8 +127,9 @@ void XPDFRenderer::render(QPainter *p, int pageNumber, const QRectF &bounds)
qreal xscale = p->worldTransform().m11(); qreal xscale = p->worldTransform().m11();
qreal yscale = p->worldTransform().m22(); qreal yscale = p->worldTransform().m22();
bool bZoomChanged = false; bool bZoomChanged = false;
bool bFirstThumbnail = false;
if(mScaleX != xscale || mScaleY != yscale) if(fabs(mScaleX - xscale) > 0.1 || fabs(mScaleY - yscale) > 0.1)
{ {
mScaleX = xscale; mScaleX = xscale;
mScaleY = yscale; mScaleY = yscale;
@ -138,9 +139,14 @@ void XPDFRenderer::render(QPainter *p, int pageNumber, const QRectF &bounds)
// First verify if the thumbnails and the pages are generated // First verify if the thumbnails and the pages are generated
if(!bThumbGenerated) if(!bThumbGenerated)
{ {
if(pageNumber == 1)
{
bFirstThumbnail = true;
}
if(!mThumbMap[pageNumber - 1]) if(!mThumbMap[pageNumber - 1])
{ {
// Generate the thumbnail // Generate the thumbnail
mThumbs << *createPDFImage(pageNumber, xscale, yscale, bounds); mThumbs << *createPDFImage(pageNumber, xscale, yscale, bounds);
mThumbMap[pageNumber - 1] = true; mThumbMap[pageNumber - 1] = true;
@ -164,10 +170,9 @@ void XPDFRenderer::render(QPainter *p, int pageNumber, const QRectF &bounds)
} }
} }
// Warning: verify pagenumber
QImage pdfImage; QImage pdfImage;
if(!bThumbGenerated) if(!bThumbGenerated || bFirstThumbnail)
{ {
pdfImage = mThumbs.at(pageNumber - 1); pdfImage = mThumbs.at(pageNumber - 1);
} }
@ -176,8 +181,6 @@ void XPDFRenderer::render(QPainter *p, int pageNumber, const QRectF &bounds)
pdfImage = mNumPageToPageMap[pageNumber]; pdfImage = mNumPageToPageMap[pageNumber];
} }
pdfImage.rect();
QTransform savedTransform = p->worldTransform(); QTransform savedTransform = p->worldTransform();
p->resetTransform(); p->resetTransform();
p->drawImage(QPointF(savedTransform.dx() + mSliceX, savedTransform.dy() + mSliceY), pdfImage); p->drawImage(QPointF(savedTransform.dx() + mSliceX, savedTransform.dy() + mSliceY), pdfImage);

Loading…
Cancel
Save