|
|
@ -52,6 +52,7 @@ UBDocumentNavigator::UBDocumentNavigator(QWidget *parent, const char *name):QGra |
|
|
|
mThumbnailWidth = width() - 2*border(); |
|
|
|
mThumbnailWidth = width() - 2*border(); |
|
|
|
|
|
|
|
|
|
|
|
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(addNewPage())); |
|
|
|
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(addNewPage())); |
|
|
|
|
|
|
|
connect(UBApplication::boardController, SIGNAL(setDocOnPageNavigator(UBDocumentProxy*)), this, SLOT(generateThumbnails())); |
|
|
|
connect(mScene, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); |
|
|
|
connect(mScene, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -116,7 +117,6 @@ void UBDocumentNavigator::generateThumbnails() |
|
|
|
|
|
|
|
|
|
|
|
items << pixmapItem; |
|
|
|
items << pixmapItem; |
|
|
|
labels << tr("Page %0").arg(i + 1); |
|
|
|
labels << tr("Page %0").arg(i + 1); |
|
|
|
//itemsPath.append(QUrl::fromLocalFile(mCrntDoc->persistencePath() + QString("/pages/%0").arg(i + 1)));
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Draw the items
|
|
|
|
// Draw the items
|
|
|
@ -345,12 +345,12 @@ void UBDocumentNavigator::resizeEvent(QResizeEvent *event) |
|
|
|
mThumbnailWidth = (width() > mThumbnailMinWidth) ? width() - 2*border() : mThumbnailMinWidth; |
|
|
|
mThumbnailWidth = (width() > mThumbnailMinWidth) ? width() - 2*border() : mThumbnailMinWidth; |
|
|
|
|
|
|
|
|
|
|
|
// Update the scene rect
|
|
|
|
// Update the scene rect
|
|
|
|
// QRect sceneRect;
|
|
|
|
// QRect sceneRect;
|
|
|
|
// sceneRect.setWidth(width() - 2*border());
|
|
|
|
// sceneRect.setWidth(width() - 2*border());
|
|
|
|
// sceneRect.setHeight(height() - 2*border());
|
|
|
|
// sceneRect.setHeight(height() - 2*border());
|
|
|
|
// sceneRect.moveLeft(border());
|
|
|
|
// sceneRect.moveLeft(border());
|
|
|
|
// sceneRect.moveTop(border());
|
|
|
|
// sceneRect.moveTop(border());
|
|
|
|
// scene()->setSceneRect(sceneRect);
|
|
|
|
// scene()->setSceneRect(sceneRect);
|
|
|
|
|
|
|
|
|
|
|
|
// Refresh the scene
|
|
|
|
// Refresh the scene
|
|
|
|
refreshScene(); |
|
|
|
refreshScene(); |
|
|
@ -430,6 +430,6 @@ UBDocumentProxy* UBDocumentNavigator::currentDoc() |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void UBDocumentNavigator::onSelectionChanged() |
|
|
|
void UBDocumentNavigator::onSelectionChanged() |
|
|
|
{ |
|
|
|
{ |
|
|
|
// QList<QGraphicsItem*> qlItems = mScene->selectedItems();
|
|
|
|
// QList<QGraphicsItem*> qlItems = mScene->selectedItems();
|
|
|
|
// qDebug() << "The number of selected items is " << qlItems.count();
|
|
|
|
// qDebug() << "The number of selected items is " << qlItems.count();
|
|
|
|
} |
|
|
|
} |
|
|
|