diff --git a/resources/style.qss b/resources/style.qss index 8ce2d992..c542d934 100644 --- a/resources/style.qss +++ b/resources/style.qss @@ -27,7 +27,8 @@ QWidget#UBMediaVideoContainer border: 2px solid #999999; } -QWidget#UBTeacherBarPreviewWidget + +QWidget#UBTBPreviewWidget { background: #FFFFFF; border-radius: 10px; diff --git a/src/adaptors/UBExportFullPDF.cpp b/src/adaptors/UBExportFullPDF.cpp index c59a32ad..402ef9cb 100644 --- a/src/adaptors/UBExportFullPDF.cpp +++ b/src/adaptors/UBExportFullPDF.cpp @@ -46,7 +46,10 @@ using namespace merge_lib; UBExportFullPDF::UBExportFullPDF(QObject *parent) : UBExportAdaptor(parent) { - // NOOP + //need to calculate screen resolution + QDesktopWidget* desktop = UBApplication::desktop(); + int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2; + mScaleFactor = 72.0f / dpiCommon; } @@ -56,7 +59,7 @@ UBExportFullPDF::~UBExportFullPDF() } -void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString filename) +void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, const QString& filename) { if (!pDocumentProxy || filename.length() == 0 || pDocumentProxy->pageCount() == 0) return; @@ -70,9 +73,6 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString fi pdfPrinter.setOutputFileName(filename); pdfPrinter.setFullPage(true); - const qreal margin = UBSettings::settings()->pdfMargin->get().toDouble() * pdfPrinter.resolution() / 25.4; - mMargin = margin; - QPainter* pdfPainter = 0; for(int pageIndex = 0 ; pageIndex < pDocumentProxy->pageCount(); pageIndex++) @@ -87,54 +87,20 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString fi scene->setRenderingQuality(UBItem::RenderingQualityHigh); scene->setRenderingContext(UBGraphicsScene::PdfExport); - UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast(scene->backgroundObject()); - - if (pdfItem) - { - QSizeF sceneItemsBound = scene->itemsBoundingRect().size(); - qreal ratio = (qreal)pdfPrinter.resolution() / 72.0; - QSizeF scaled = sceneItemsBound * ratio; - - pdfPrinter.setPaperSize(scaled, QPrinter::DevicePixel); - - if (pageIndex != 0) - pdfPrinter.newPage(); - - if (!pdfPainter) - pdfPainter = new QPainter(&pdfPrinter); - - //render to PDF - scene->render(pdfPainter, QRectF(0, 0, sceneItemsBound.width() * ratio - , sceneItemsBound.height() * ratio), scene->itemsBoundingRect()); - - mHasPDFBackgrounds = true; - } - else - { - if (UBSettings::settings()->pdfPageFormat->get().toString() == "Letter") - pdfPrinter.setPageSize(QPrinter::Letter); - else - pdfPrinter.setPageSize(QPrinter::A4); + QSize pageSize = scene->nominalSize(); - QSize docSize = pDocumentProxy->defaultDocumentSize(); - if(docSize.width() > docSize.height()) - { - pdfPrinter.setOrientation(QPrinter::Landscape); - } + UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast(scene->backgroundObject()); - if (pageIndex != 0) - pdfPrinter.newPage(); + if (pdfItem) mHasPDFBackgrounds = true; + + pdfPrinter.setPaperSize(QSizeF(pageSize.width()*mScaleFactor, pageSize.height()*mScaleFactor), QPrinter::Point); - mDefaultPageRect = pdfPrinter.paperRect(); - QRectF paperRect = mDefaultPageRect.adjusted(margin, margin, -margin, -margin); - QRectF normalized = scene->normalizedSceneRect(paperRect.width() / paperRect.height()); + if (!pdfPainter) pdfPainter = new QPainter(&pdfPrinter); - if (!pdfPainter) - pdfPainter = new QPainter(&pdfPrinter); + if (pageIndex != 0) pdfPrinter.newPage(); - //render to PDF - scene->render(pdfPainter, paperRect, normalized); - } + //render to PDF + scene->render(pdfPainter); //restore screen rendering quality scene->setRenderingContext(UBGraphicsScene::Screen); @@ -144,8 +110,7 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString fi scene->setBackground(isDark, isCrossed); } - if (pdfPainter) - delete pdfPainter; + if (pdfPainter) delete pdfPainter; } @@ -171,12 +136,10 @@ void UBExportFullPDF::persist(UBDocumentProxy* pDocumentProxy) } -void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, QString filename) +void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QString& filename) { - QFile file(filename); - if (file.exists()) - file.remove(); + if (file.exists()) file.remove(); QString overlayName = filename; overlayName.replace(".pdf", "_overlay.pdf"); @@ -209,31 +172,27 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, QString UBGraphicsScene* scene = UBPersistenceManager::persistenceManager()->loadDocumentScene(pDocumentProxy, pageIndex); UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast(scene->backgroundObject()); - if (pdfItem) + QSize pageSize = scene->nominalSize(); + + if (pdfItem) { QString pdfName = UBPersistenceManager::objectDirectory + "/" + pdfItem->fileUuid().toString() + ".pdf"; QString backgroundPath = pDocumentProxy->persistencePath() + "/" + pdfName; QPointF boudingRectBottomLeft = scene->itemsBoundingRect().bottomLeft(); QPointF pdfItemBottomLeft = pdfItem->sceneBoundingRect().bottomLeft(); - QPointF offset = pdfItemBottomLeft - boudingRectBottomLeft; qDebug() << "scene->itemsBoundingRect()" << scene->itemsBoundingRect(); qDebug() << "pdfItem->boundingRect()" << pdfItem->boundingRect(); qDebug() << "pdfItem->sceneBoundingRect()" << pdfItem->sceneBoundingRect(); - qDebug() << offset; - - TransformationDescription baseTrans(offset.x(), offset.y() * -1, 1, 0); - //TransformationDescription baseTrans(0, 0, 1, 0); - TransformationDescription overlayTrans(0, 0, 1, 0); - MergePageDescription pageDescription(scene->itemsBoundingRect().width(), - scene->itemsBoundingRect().height(), + MergePageDescription pageDescription(pageSize.width() * mScaleFactor, + pageSize.height() * mScaleFactor, pdfItem->pageNumber(), QFile::encodeName(backgroundPath).constData(), - baseTrans, + TransformationDescription(), pageIndex + 1, - overlayTrans, + TransformationDescription(), false, false); mergeInfo.push_back(pageDescription); @@ -242,12 +201,8 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, QString } else { - QRectF paperRect = mDefaultPageRect.adjusted(mMargin, mMargin, -mMargin, -mMargin); - QRectF normalized = scene->normalizedSceneRect(paperRect.width() / paperRect.height()); - - - MergePageDescription pageDescription(normalized.width(), - normalized.height(), + MergePageDescription pageDescription(pageSize.width() * mScaleFactor, + pageSize.height() * mScaleFactor, 0, "", TransformationDescription(), diff --git a/src/adaptors/UBExportFullPDF.h b/src/adaptors/UBExportFullPDF.h index ecaf399b..af0f3574 100644 --- a/src/adaptors/UBExportFullPDF.h +++ b/src/adaptors/UBExportFullPDF.h @@ -33,14 +33,13 @@ class UBExportFullPDF : public UBExportAdaptor virtual QString exportExtention(); virtual void persist(UBDocumentProxy* pDocument); - virtual void persistsDocument(UBDocumentProxy* pDocument, QString filename); + virtual void persistsDocument(UBDocumentProxy* pDocument, const QString& filename); protected: - void saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString filename); + void saveOverlayPdf(UBDocumentProxy* pDocumentProxy, const QString& filename); private: - QRect mDefaultPageRect; - int mMargin; + float mScaleFactor; bool mHasPDFBackgrounds; }; diff --git a/src/adaptors/UBExportPDF.cpp b/src/adaptors/UBExportPDF.cpp index 927a2b56..ae13a541 100644 --- a/src/adaptors/UBExportPDF.cpp +++ b/src/adaptors/UBExportPDF.cpp @@ -101,7 +101,6 @@ void UBExportPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QStrin //setting page size to appropriate value pdfPrinter.setPaperSize(QSizeF(pageSize.width()*scaleFactor, pageSize.height()*scaleFactor), QPrinter::Point); - pdfPrinter.setOrientation((pageSize.width() > pageSize.height())? QPrinter::Landscape : QPrinter::Portrait); if(painterNeedsBegin) painterNeedsBegin = !pdfPainter.begin(&pdfPrinter); //render to PDF scene->render(&pdfPainter); diff --git a/src/adaptors/UBMetadataDcSubsetAdaptor.cpp b/src/adaptors/UBMetadataDcSubsetAdaptor.cpp index 0dbdd5c5..10ee3cc4 100644 --- a/src/adaptors/UBMetadataDcSubsetAdaptor.cpp +++ b/src/adaptors/UBMetadataDcSubsetAdaptor.cpp @@ -276,7 +276,6 @@ QMap UBMetadataDcSubsetAdaptor::load(QString pPath) qWarning() << "Document size not found, using default view size" << docSize; metadata.insert(UBSettings::documentSize, QVariant(docSize)); - } if (!updatedAtFound) @@ -284,6 +283,8 @@ QMap UBMetadataDcSubsetAdaptor::load(QString pPath) metadata.insert(UBSettings::documentUpdatedAt, date + "T00:00:00Z"); } + metadata.insert(UBSettings::documentDate, QVariant(date)); + return metadata; } diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index b9819d52..f218f22c 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -43,6 +43,7 @@ QString UBSettings::sessionKeywords = QString("sessionKeywords"); QString UBSettings::sessionLevel = QString("sessionLevel"); QString UBSettings::sessionTopic = QString("sessionTopic"); QString UBSettings::sessionAuthors = QString("sessionAuthors"); +QString UBSettings::documentDate = QString("date"); QString UBSettings::trashedDocumentGroupNamePrefix = QString("_Trash:"); diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index 21b4d4e1..fd25cd4b 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.h @@ -160,6 +160,7 @@ class UBSettings : public QObject static QString sessionLevel; static QString sessionTopic; static QString sessionAuthors; + static QString documentDate; static QString trashedDocumentGroupNamePrefix; diff --git a/src/customWidgets/UBWidgetList.cpp b/src/customWidgets/UBWidgetList.cpp index 6481acb4..8b099b5a 100644 --- a/src/customWidgets/UBWidgetList.cpp +++ b/src/customWidgets/UBWidgetList.cpp @@ -10,6 +10,8 @@ UBWidgetList::UBWidgetList(QWidget* parent, eWidgetListOrientation orientation, , mMargin(5) , mListElementsSpacing(10) , mpEmptyLabel(NULL) + , mCanRemove(true) + , mpCurrentWidget(NULL) { setObjectName(name); mOrientation = orientation; @@ -130,6 +132,13 @@ void UBWidgetList::resizeEvent(QResizeEvent *ev) updateSizes(); } +void UBWidgetList::mousePressEvent(QMouseEvent *ev) +{ + if(mCanRemove){ + + } +} + void UBWidgetList::updateSizes() { // Resize all the widgets diff --git a/src/customWidgets/UBWidgetList.h b/src/customWidgets/UBWidgetList.h index 865386ad..c4137178 100644 --- a/src/customWidgets/UBWidgetList.h +++ b/src/customWidgets/UBWidgetList.h @@ -41,7 +41,10 @@ public: int listElementsSpacing() {return mListElementsSpacing; } protected: + bool mCanRemove; + void resizeEvent(QResizeEvent* ev); + void mousePressEvent(QMouseEvent* ev); private: int scaleWidgets(QSize pSize); @@ -55,6 +58,7 @@ private: int mListElementsSpacing; QMap mWidgetInfo; QLabel* mpEmptyLabel; + QWidget* mpCurrentWidget; }; #endif // UBWIDGETLIST_H diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index a2a4eac0..70983bab 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -81,7 +81,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) mTransparentDrawingView->setMouseTracking(true); - mTransparentDrawingView->setAcceptDrops(false); + mTransparentDrawingView->setAcceptDrops(true); QString backgroundStyle = "QWidget {background-color: rgba(127, 127, 127, 0)}"; mTransparentDrawingView->setStyleSheet(backgroundStyle); diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 9d1f8d42..5aafded1 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -1150,11 +1150,10 @@ void UBDocumentController::moveSceneToIndex(UBDocumentProxy* proxy, int source, UBMetadataDcSubsetAdaptor::persist(proxy); refreshDocumentThumbnailsView(); - // NOTE [Didier]: I think that selecting the thumbnail is not the role of the documentController - mDocumentUI->thumbnailWidget->selectItemAt(target); - // Notify the move to anyone interested in knowing it emit movedToIndex(target); + + UBApplication::boardController->setActiveDocumentScene(proxy, target); } diff --git a/src/document/UBDocumentProxy.cpp b/src/document/UBDocumentProxy.cpp index aafcfeda..add97241 100644 --- a/src/document/UBDocumentProxy.cpp +++ b/src/document/UBDocumentProxy.cpp @@ -295,6 +295,15 @@ QString UBDocumentProxy::sessionAuthors() return QString(); } +QString UBDocumentProxy::documentDate() +{ + if(mMetaDatas.contains(UBSettings::documentDate)){ + return metaData(UBSettings::documentDate).toString(); + }else{ + return QString(); + } +} + bool UBDocumentProxy::isModified() const { return mIsModified; diff --git a/src/document/UBDocumentProxy.h b/src/document/UBDocumentProxy.h index a8ec9b3b..6686a4f3 100644 --- a/src/document/UBDocumentProxy.h +++ b/src/document/UBDocumentProxy.h @@ -59,6 +59,7 @@ class UBDocumentProxy : public QObject QString sessionTopic(); void setSessionAuthor(const QString& authors); QString sessionAuthors(); + QString documentDate(); QSize defaultDocumentSize() const; diff --git a/src/domain/UBGraphicsTextItemDelegate.cpp b/src/domain/UBGraphicsTextItemDelegate.cpp index c430d84d..ea031cf1 100644 --- a/src/domain/UBGraphicsTextItemDelegate.cpp +++ b/src/domain/UBGraphicsTextItemDelegate.cpp @@ -305,10 +305,11 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta) bool bEndofTheSameBlock; int iBlockLen; int iPointSize; - int inewPointSize; + int iNextPointSize; int iCursorPos = startPos; // we search continuous blocks of the text with the same PointSize and allpy new settings for them. + cursor.setPosition (startPos, QTextCursor::MoveAnchor); while(iCursorPos < endPos) { bEndofTheSameBlock = false; @@ -326,17 +327,18 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta) iBlockLen++; cursor.setPosition (iCursorPos+iBlockLen+1, QTextCursor::KeepAnchor); - inewPointSize = cursor.charFormat().font().pointSize(); + iNextPointSize = cursor.charFormat().font().pointSize(); cursor.setPosition (iCursorPos+iBlockLen, QTextCursor::KeepAnchor); - if ((iPointSize != inewPointSize)||(iCursorPos+iBlockLen >= endPos)) + if ((iPointSize != iNextPointSize)||(iCursorPos+iBlockLen >= endPos)) bEndofTheSameBlock = true; }while(!bEndofTheSameBlock); //setting new parameners - curFont.setPointSize(iPointSize + delta); + int iNewPointSize = iPointSize + delta; + curFont.setPointSize( (iNewPointSize > 0)?iNewPointSize:1); textFormat.setFont(curFont); cursor.mergeCharFormat(textFormat); diff --git a/src/gui/UBDockPalette.cpp b/src/gui/UBDockPalette.cpp index 82f28d76..b168663f 100644 --- a/src/gui/UBDockPalette.cpp +++ b/src/gui/UBDockPalette.cpp @@ -697,7 +697,7 @@ void UBDockPalette::moveTabs() void UBDockPalette::resizeTabs() { int numTabs = mTabWidgets.size(); - mTabPalette->resize(2 * border(), (numTabs * TABSIZE) + qMax(numTabs - 1, 0) * tabSpacing()); + mTabPalette->setFixedSize(2 * border(), (numTabs * TABSIZE) + qMax(numTabs - 1, 0) * tabSpacing()); } QRect UBDockPalette::getTabPaletteRect() { diff --git a/src/gui/UBDocumentNavigator.cpp b/src/gui/UBDocumentNavigator.cpp index 4efea020..0f6b6eff 100644 --- a/src/gui/UBDocumentNavigator.cpp +++ b/src/gui/UBDocumentNavigator.cpp @@ -391,17 +391,13 @@ void UBDocumentNavigator::mousePressEvent(QMouseEvent *event) mCrntItem = pCrntItem; } - // HACK: for an unknown reason, the mousePressEvent of the item is not - // called when a click occurs on it. So I created this method in - // order to handle the click. - mCrntItem->notifyClick(mapToScene(event->pos())); - // Then display the related page emit changeCurrentPage(); refreshScene(); } bNavig = false; } + QGraphicsView::mousePressEvent(event); } /** @@ -448,7 +444,8 @@ void UBDocumentNavigator::onMovedToIndex(int index) UBSceneThumbnailNavigPixmap* pItem = dynamic_cast(mThumbnails.at(index)); if(NULL != pItem) { - mCrntItem = pItem; + if(mCrntItem) mCrntItem->setSelected(false);//deselecting previous one + mCrntItem = pItem; mCrntItem->setSelected(true); centerOn(mCrntItem); } diff --git a/src/gui/UBLibPathViewer.cpp b/src/gui/UBLibPathViewer.cpp index 2dff5098..ca79f7c0 100644 --- a/src/gui/UBLibPathViewer.cpp +++ b/src/gui/UBLibPathViewer.cpp @@ -284,7 +284,7 @@ void UBLibPathViewer::showBack() if(NULL != pLastElem) { mpBackElem->setPath(pLastElem->element()->path()); - mpBackElem->setType(eUBLibElementType_Folder); + mpBackElem->setType(pLastElem->element()->type()); mpBackElem->setName(pLastElem->element()->name()); } diff --git a/src/gui/UBLibraryWidget.cpp b/src/gui/UBLibraryWidget.cpp index 31371a83..568b0c4d 100644 --- a/src/gui/UBLibraryWidget.cpp +++ b/src/gui/UBLibraryWidget.cpp @@ -361,15 +361,12 @@ void UBLibraryWidget::dropEvent(QDropEvent *event) QString filePath; QString crntPath = urlList.at(i).toString(); -#ifdef Q_WS_MACX - filePath = QUrl(urlList.at(i)).toString(); -#else if(crntPath.startsWith("file:") || crntPath.startsWith("/")){ filePath = QUrl(crntPath).toLocalFile(); }else{ filePath = crntPath; } -#endif + mLibraryController->importItemOnLibrary(filePath); bDropAccepted = true; } diff --git a/src/gui/UBResources.cpp b/src/gui/UBResources.cpp index be2e7dcc..f1eb64ab 100644 --- a/src/gui/UBResources.cpp +++ b/src/gui/UBResources.cpp @@ -51,7 +51,6 @@ void UBResources::init() // Cursors penCursor = QCursor(Qt::CrossCursor); eraserCursor = QCursor(QPixmap(":/images/cursors/eraser.png"), 21, 21); - magnifierCursor = QCursor(QPixmap(":/images/cursors/magnifier.png"), 9, 9); markerCursor = QCursor(QPixmap(":/images/cursors/marker.png"), 3, 30); pointerCursor = QCursor(QPixmap(":/images/cursors/laser.png"), 2, 1); handCursor = QCursor(Qt::OpenHandCursor); @@ -60,5 +59,5 @@ void UBResources::init() arrowCursor = QCursor(Qt::ArrowCursor); textCursor = QCursor(Qt::ArrowCursor); rotateCursor = QCursor(QPixmap(":/images/cursors/rotate.png"), 16, 16); - drawLineRulerCursor = QCursor(QPixmap(":/images/cursors/drawRulerLine.png"), 3, 12); + drawLineRulerCursor = QCursor(QPixmap(":/images/cursors/drawRulerLine.png"), 3, 12); } diff --git a/src/gui/UBResources.h b/src/gui/UBResources.h index fd32fa6d..bae4eee6 100644 --- a/src/gui/UBResources.h +++ b/src/gui/UBResources.h @@ -37,7 +37,6 @@ class UBResources : public QObject QCursor penCursor; QCursor eraserCursor; - QCursor magnifierCursor; QCursor markerCursor; QCursor pointerCursor; QCursor handCursor; diff --git a/src/gui/UBTBDocumentEditWidget.cpp b/src/gui/UBTBDocumentEditWidget.cpp index 30f3438e..4139a9d2 100644 --- a/src/gui/UBTBDocumentEditWidget.cpp +++ b/src/gui/UBTBDocumentEditWidget.cpp @@ -62,8 +62,8 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW mpKeywords->setObjectName("DockPaletteWidgetLineEdit"); mpLevel = new QComboBox(this); mpLevel->setObjectName("DockPaletteWidgetComboBox"); - mpTopic = new QComboBox(this); - mpTopic->setObjectName("DockPaletteWidgetComboBox"); + mpTopic = new QLineEdit(this); + mpTopic->setObjectName("DockPaletteWidgetLineEdit"); mpAuthor = new QLineEdit(this); mpAuthor->setObjectName("DockPaletteWidgetLineEdit"); mpKeywordLabel = new QLabel(tr("Keywords:"), this); @@ -120,7 +120,7 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW connect(mpLicenseCombox, SIGNAL(currentIndexChanged(int)), this, SLOT(onLicenseCurrentIndexChanged(int))); connect(mpKeywords, SIGNAL(textChanged(QString)), this, SLOT(onKeywordChanged(QString))); connect(mpLevel, SIGNAL(currentIndexChanged(QString)), this, SLOT(onLevelChanged(QString))); - connect(mpTopic, SIGNAL(currentIndexChanged(QString)), this, SLOT(onTopicChanged(QString))); + connect(mpTopic, SIGNAL(textChanged(QString)), this, SLOT(onTopicChanged(QString))); connect(mpAuthor, SIGNAL(textChanged(QString)), this, SLOT(onAuthorChanged(QString))); } @@ -179,7 +179,7 @@ void UBTBDocumentEditWidget::updateFields() mpTarget->setPlainText(mpDataMgr->sessionTarget()); mpKeywords->setText(mpDataMgr->keywords()); // TODO: retrieve the level - // TODO retrieve the topic + mpTopic->setText(mpDataMgr->topic()); mpAuthor->setText(mpDataMgr->authors()); } @@ -192,7 +192,6 @@ void UBTBDocumentEditWidget::clearFields() void UBTBDocumentEditWidget::onKeywordChanged(const QString &kw) { mpDataMgr->setKeywords(kw); - qDebug() << ">>> KEYWORD CHANGED: " << kw; emit valueChanged(); } diff --git a/src/gui/UBTBDocumentEditWidget.h b/src/gui/UBTBDocumentEditWidget.h index 7d782247..4b49a973 100644 --- a/src/gui/UBTBDocumentEditWidget.h +++ b/src/gui/UBTBDocumentEditWidget.h @@ -60,7 +60,7 @@ private: QComboBox* mpLicenseCombox; QLineEdit* mpKeywords; QComboBox* mpLevel; - QComboBox* mpTopic; + QLineEdit* mpTopic; QLineEdit* mpAuthor; QLabel* mpKeywordLabel; QLabel* mpLevelLabel; diff --git a/src/gui/UBTBDocumentPreviewWidget.cpp b/src/gui/UBTBDocumentPreviewWidget.cpp index 39d75199..81dbad2e 100644 --- a/src/gui/UBTBDocumentPreviewWidget.cpp +++ b/src/gui/UBTBDocumentPreviewWidget.cpp @@ -4,27 +4,119 @@ UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(UBTeacherBarDataMgr *pDataMgr, QWidget *parent, const char *name):QWidget(parent) , mpPageViewButton(NULL) , mpEditButton(NULL) + , mpSessionLabel(NULL) + , mpSessionTitle(NULL) + , mpAuthorLabel(NULL) + , mpAuthors(NULL) + , mpCreationDate(NULL) + , mpTargetLabel(NULL) + , mpTarget(NULL) + , mpMetadataLabel(NULL) + , mpKeywordLabel(NULL) + , mpKeyword(NULL) + , mpLevelLabel(NULL) + , mpLevel(NULL) + , mpTopicLabel(NULL) + , mpTopic(NULL) + , mpLicense(NULL) + , mpContainer(NULL) { setObjectName(name); mpDataMgr = pDataMgr; setLayout(&mLayout); + mLayout.setContentsMargins(0, 0, 0, 0); - mpPageViewButton = new QPushButton(tr("Page View"), this); - mpPageViewButton->setObjectName("DockPaletteWidgetButton"); - mPageLayout.addStretch(1); - mPageLayout.addWidget(mpPageViewButton, 0); - mPageLayout.addStretch(1); - mLayout.addLayout(&mPageLayout); + mpContainer = new QWidget(this); + mpContainer->setLayout(&mContainerLayout); + mpContainer->setObjectName("UBTBPreviewWidget"); + + // Session Title + mpSessionLabel = new QLabel(tr("Session"), mpContainer); + mpSessionLabel->setAlignment(Qt::AlignRight); + mpSessionLabel->setObjectName("UBTeacherBarPreviewSubtitle"); + mContainerLayout.addWidget(mpSessionLabel, 0); + mpSessionTitle = new QLabel(mpContainer); + mpSessionTitle->setWordWrap(true); + mpSessionTitle->setAlignment(Qt::AlignRight); + mpSessionTitle->setObjectName("UBTeacherBarPreviewTitle"); + mContainerLayout.addWidget(mpSessionTitle, 0); + mContainerLayout.addWidget(&mTitleSeparator, 0); + + // Author(s) + mpAuthorLabel = new QLabel(tr("Author(s)"), mpContainer); + mpAuthorLabel->setObjectName("UBTeacherBarPreviewSubtitle"); + mContainerLayout.addWidget(mpAuthorLabel, 0); + mpAuthors = new QLabel(mpContainer); + mpAuthors->setWordWrap(true); + mpAuthors->setStyleSheet("padding-left:5px;"); + mContainerLayout.addWidget(mpAuthors, 0); + mContainerLayout.addWidget(&mAuthorSeparator, 0); + + // Dates + mpCreationDate = new QLabel(tr("Created on: "), mpContainer); + mpCreationDate->setStyleSheet("padding-left:5px;"); + mContainerLayout.addWidget(mpCreationDate); + mContainerLayout.addWidget(&mDateSeparator, 0); + + // Target + mpTargetLabel = new QLabel(tr("Target"), mpContainer); + mpTargetLabel->setObjectName("UBTeacherBarPreviewSubtitle"); + mContainerLayout.addWidget(mpTargetLabel,0); + mpTarget = new QTextEdit(mpContainer); + mpTarget->setReadOnly(true); + mContainerLayout.addWidget(mpTarget, 1); + mContainerLayout.addWidget(&mTargetSeparator, 0); + + // Metadata + mpMetadataLabel = new QLabel(tr("Metadata"), mpContainer); + mpMetadataLabel->setObjectName("UBTeacherBarPreviewSubtitle"); + mContainerLayout.addWidget(mpMetadataLabel, 0); + + // Keyword + mpKeywordLabel = new QLabel(tr("Keywords:"), mpContainer); + mpKeywordLabel->setStyleSheet("padding-left:5px;"); + mpKeyword = new QLabel(mpContainer); + mpKeyword->setWordWrap(true); + mKeywordLayout.addWidget(mpKeywordLabel, 0); + mKeywordLayout.addWidget(mpKeyword, 1); + mContainerLayout.addLayout(&mKeywordLayout, 0); + + // Level + mpLevelLabel = new QLabel(tr("Level:"), mpContainer); + mpLevelLabel->setStyleSheet("padding-left:5px;"); + mpLevel = new QLabel(mpContainer); + mpLevel->setWordWrap(true); + mLevelLayout.addWidget(mpLevelLabel, 0); + mLevelLayout.addWidget(mpLevel, 1); + mContainerLayout.addLayout(&mLevelLayout, 0); - // TODO : Add the elements here + // Topic + mpTopicLabel = new QLabel(tr("Topic:"), mpContainer); + mpTopicLabel->setStyleSheet("padding-left:5px;"); + mpTopic = new QLabel(mpContainer); + mpTopic->setWordWrap(true); + mTopicLayout.addWidget(mpTopicLabel, 0); + mTopicLayout.addWidget(mpTopic, 1); + mContainerLayout.addLayout(&mTopicLayout, 0); + mContainerLayout.addWidget(&mMetadataSeparator, 0); + // License + mpLicense = new UBTBLicenseWidget(mpContainer); + mContainerLayout.addWidget(mpLicense, 0); + + mLayout.addWidget(mpContainer, 1); + + mpPageViewButton = new QPushButton(tr("Page View"), this); + mpPageViewButton->setObjectName("DockPaletteWidgetButton"); mpEditButton = new QPushButton(tr("Edit"), this); mpEditButton->setObjectName("DockPaletteWidgetButton"); - mPreviewLayout.addStretch(1); - mPreviewLayout.addWidget(mpEditButton, 0); - mPreviewLayout.addStretch(1); - mLayout.addLayout(&mPreviewLayout); + + mButtonsLayout.addWidget(mpPageViewButton, 0); + mButtonsLayout.addWidget(mpEditButton, 0); + mButtonsLayout.addStretch(1); + + mLayout.addLayout(&mButtonsLayout, 0); connect(mpPageViewButton, SIGNAL(clicked()), this, SLOT(onPageView())); connect(mpEditButton, SIGNAL(clicked()), this, SLOT(onEdit())); @@ -32,8 +124,7 @@ UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(UBTeacherBarDataMgr *pDataM UBTBDocumentPreviewWidget::~UBTBDocumentPreviewWidget() { - DELETEPTR(mpPageViewButton); - DELETEPTR(mpEditButton); + } void UBTBDocumentPreviewWidget::onEdit() @@ -48,10 +139,23 @@ void UBTBDocumentPreviewWidget::onPageView() void UBTBDocumentPreviewWidget::updateFields() { - + mpSessionTitle->setText(mpDataMgr->sessionTitle()); + mpAuthors->setText(mpDataMgr->authors()); + mpCreationDate->setText(tr("Creation Date: %0").arg(mpDataMgr->creationDate())); + mpTarget->setText(mpDataMgr->sessionTarget()); + mpLicense->setLicense(mpDataMgr->sessionLicence()); + mpKeyword->setText(mpDataMgr->keywords()); + mpLevel->setText(mpDataMgr->level()); + mpTopic->setText(mpDataMgr->topic()); } void UBTBDocumentPreviewWidget::clearFields() { - + mpSessionTitle->setText(""); + mpAuthors->setText(""); + mpCreationDate->setText(""); + mpTarget->setText(""); + mpKeyword->setText(""); + mpLevel->setText(""); + mpTopic->setText(""); } diff --git a/src/gui/UBTBDocumentPreviewWidget.h b/src/gui/UBTBDocumentPreviewWidget.h index 99959afa..f2115c72 100644 --- a/src/gui/UBTBDocumentPreviewWidget.h +++ b/src/gui/UBTBDocumentPreviewWidget.h @@ -24,10 +24,35 @@ private slots: private: QVBoxLayout mLayout; - QHBoxLayout mPageLayout; - QHBoxLayout mPreviewLayout; + QHBoxLayout mButtonsLayout; + + QWidget* mpContainer; + QVBoxLayout mContainerLayout; QPushButton* mpPageViewButton; QPushButton* mpEditButton; + QLabel* mpSessionLabel; + QLabel* mpSessionTitle; + UBTBSeparator mTitleSeparator; + QLabel* mpAuthorLabel; + QLabel* mpAuthors; + UBTBSeparator mAuthorSeparator; + QLabel* mpCreationDate; + UBTBSeparator mDateSeparator; + QLabel* mpTargetLabel; + QTextEdit* mpTarget; + UBTBSeparator mTargetSeparator; + QLabel* mpMetadataLabel; + QHBoxLayout mKeywordLayout; + QLabel* mpKeywordLabel; + QLabel* mpKeyword; + QHBoxLayout mLevelLayout; + QLabel* mpLevelLabel; + QLabel* mpLevel; + QHBoxLayout mTopicLayout; + QLabel* mpTopicLabel; + QLabel* mpTopic; + UBTBSeparator mMetadataSeparator; + UBTBLicenseWidget* mpLicense; UBTeacherBarDataMgr* mpDataMgr; }; diff --git a/src/gui/UBTBPageEditWidget.cpp b/src/gui/UBTBPageEditWidget.cpp index 39f6716c..e2142b13 100644 --- a/src/gui/UBTBPageEditWidget.cpp +++ b/src/gui/UBTBPageEditWidget.cpp @@ -320,7 +320,7 @@ QString UBUrlWidget::url() QString str; if(NULL != mpUrl){ - str = mpUrl->text() + ";" + mpTitle->text(); + str = mpUrl->text();// + ";" + mpTitle->text(); } return str; diff --git a/src/gui/UBTeacherBarDataMgr.cpp b/src/gui/UBTeacherBarDataMgr.cpp index 5d951d77..dd1f2b44 100644 --- a/src/gui/UBTeacherBarDataMgr.cpp +++ b/src/gui/UBTeacherBarDataMgr.cpp @@ -1,3 +1,5 @@ +#include + #include "UBTeacherBarDataMgr.h" #include "core/UBApplication.h" @@ -59,7 +61,6 @@ void UBTeacherBarDataMgr::saveContent() documentProxy->setSessionTitle(mSessionTitle); documentProxy->setSessionTarget(mSessionTarget); documentProxy->setSessionLicence(QString("%0").arg(mSessionLicence)); - qDebug() << "Saving keywords: " << mKeywords; documentProxy->setSessionKeywords(mKeywords); documentProxy->setSessionLevel(mLevel); documentProxy->setSessionTopic(mTopic); @@ -82,10 +83,15 @@ void UBTeacherBarDataMgr::loadContent(bool docChanged) mSessionTarget = documentProxy->sessionTarget(); mSessionLicence = (eLicense)documentProxy->sessionLicence().toInt(); mKeywords = documentProxy->sessionKeywords(); - qDebug() << "Keywords loaded: " << mKeywords << " (" << documentProxy->sessionKeywords() << ")"; mLevel = documentProxy->sessionLevel(); mTopic = documentProxy->sessionTopic(); mAuthors = documentProxy->sessionAuthors(); + if("" != documentProxy->documentDate()){ + mCreationDate = documentProxy->documentDate(); + }else{ + mCreationDate = QDate::currentDate().toString("yyyy-MM-dd"); + } + } // Page Title diff --git a/src/gui/UBTeacherBarDataMgr.h b/src/gui/UBTeacherBarDataMgr.h index b182e892..900dfb38 100644 --- a/src/gui/UBTeacherBarDataMgr.h +++ b/src/gui/UBTeacherBarDataMgr.h @@ -115,6 +115,13 @@ public: void setAuthors(const QString& authors){mAuthors = authors;} QString authors(){return mAuthors;} + // Creation Date + void setCreationDate(const QString& date){mCreationDate = date;} + QString creationDate(){return mCreationDate;} + + // Last Modification + void setLastModificationDate(const QString& date){mLastModif = date;} + QString lastModificationDate(){return mLastModif;} // Others void clearLists(); @@ -131,6 +138,8 @@ private: QString mLevel; QString mTopic; QString mAuthors; + QString mCreationDate; + QString mLastModif; QVector mActionList; QVector mUrlList; diff --git a/src/gui/UBTeacherBarPreviewWidget.cpp b/src/gui/UBTeacherBarPreviewWidget.cpp index 1a7feefc..a02794b8 100644 --- a/src/gui/UBTeacherBarPreviewWidget.cpp +++ b/src/gui/UBTeacherBarPreviewWidget.cpp @@ -134,6 +134,7 @@ void UBActionPreview::setContent(const QString &content) UBTBPreviewContainer::UBTBPreviewContainer(QWidget *parent, const char *name):UBWidgetList(parent) { setObjectName(name); + mCanRemove = false; } UBTBPreviewContainer::~UBTBPreviewContainer() @@ -144,6 +145,7 @@ UBTBPreviewContainer::~UBTBPreviewContainer() // ------------------------------------------------------------------------------------ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataMgr, QWidget *parent, const char *name):QWidget(parent) , mpEditButton(NULL) + , mpDocumentButton(NULL) , mpSessionTitle(NULL) , mpTitle(NULL) , mpTitleLabel(NULL) @@ -155,20 +157,27 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataM setObjectName(name); mpDataMgr = pDataMgr; setLayout(&mLayout); + mLayout.setContentsMargins(0, 0, 0, 0); setAttribute(Qt::WA_StyledBackground, true); setStyleSheet(UBApplication::globalStyleSheet()); // Build the Preview widget + mpContainer = new QWidget(this); + mpContainer->setObjectName("UBTBPreviewWidget"); + mpContainer->setLayout(&mContainerLayout); + mLayout.addWidget(mpContainer, 1); + + // Session Title - mpTitleContainer = new QWidget(this); + mpTitleContainer = new QWidget(mpContainer); mpTitleContainer->setLayout(&mTitleLayout); - mpSessionTitle = new QLabel(this); + mpSessionTitle = new QLabel(mpContainer); mpSessionTitle->setText(tr("Session: ")); mpSessionTitle->setWordWrap(true); mpSessionTitle->setAlignment(Qt::AlignRight); mpSessionTitle->setObjectName("UBTBPreviewSessionTitle"); - mLayout.addWidget(mpSessionTitle); + mContainerLayout.addWidget(mpSessionTitle); // Title mpTitleContainer->setLayout(&mTitleLayout); @@ -187,27 +196,32 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataM mpPageNbrLabel->setObjectName("UBTBPreviewSessionTitle"); mTitleLayout.addWidget(mpPageNbrLabel); mTitleLayout.addWidget(&mTitleSeparator); - mLayout.addWidget(mpTitleContainer); + mContainerLayout.addWidget(mpTitleContainer); // Content - mpContentContainer = new UBTBPreviewContainer(this); - mLayout.addWidget(mpContentContainer, 1); + mpContentContainer = new UBTBPreviewContainer(mpContainer); + mContainerLayout.addWidget(mpContentContainer, 1); // License - mLayout.addWidget(&mLicenseSeparator); - mpLicenseLabel = new UBTBLicenseWidget(this); - mLayout.addWidget(mpLicenseLabel); + mContainerLayout.addWidget(&mLicenseSeparator); + mpLicenseLabel = new UBTBLicenseWidget(mpContainer); + mContainerLayout.addWidget(mpLicenseLabel); - // Edit button - mpEditButton = new QPushButton(tr("Edit infos"), this); + // Document Button + mpDocumentButton = new QPushButton(tr("Document View"), this); + mpDocumentButton->setObjectName("DockPaletteWidgetButton"); + + // Edit Button + mpEditButton = new QPushButton(tr("Edit"), this); mpEditButton->setObjectName("DockPaletteWidgetButton"); - mEditLayout.addStretch(1); + mEditLayout.addWidget(mpDocumentButton, 0); mEditLayout.addWidget(mpEditButton, 0); mEditLayout.addStretch(1); mLayout.addLayout(&mEditLayout, 0); connect(mpEditButton, SIGNAL(clicked()), this, SLOT(onEdit())); + connect(mpDocumentButton, SIGNAL(clicked()), this, SLOT(onDocumentClicked())); connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged())); } @@ -225,6 +239,11 @@ void UBTeacherBarPreviewWidget::onEdit() emit showEditMode(); } +void UBTeacherBarPreviewWidget::onDocumentClicked() +{ + emit showDocumentPreview(); +} + void UBTeacherBarPreviewWidget::updateFields() { // Session Title diff --git a/src/gui/UBTeacherBarPreviewWidget.h b/src/gui/UBTeacherBarPreviewWidget.h index 7fb2f92b..61d4a892 100644 --- a/src/gui/UBTeacherBarPreviewWidget.h +++ b/src/gui/UBTeacherBarPreviewWidget.h @@ -62,6 +62,7 @@ public: signals: void showEditMode(); + void showDocumentPreview(); protected: void showEvent(QShowEvent* ev); @@ -69,6 +70,7 @@ protected: private slots: void onEdit(); void onActiveSceneChanged(); + void onDocumentClicked(); private: void generateActions(); @@ -77,8 +79,12 @@ private: void generateComments(); QVBoxLayout mLayout; + QVBoxLayout mContainerLayout; QHBoxLayout mEditLayout; QPushButton* mpEditButton; + QPushButton* mpDocumentButton; + + QWidget* mpContainer; // Titles QVBoxLayout mTitleLayout; @@ -95,7 +101,6 @@ private: // License UBTBSeparator mLicenseSeparator; - // TODO : replace the QLabel of the license by a widget done for that! UBTBLicenseWidget* mpLicenseLabel; diff --git a/src/gui/UBTeacherBarWidget.cpp b/src/gui/UBTeacherBarWidget.cpp index 5aeb80a4..1596b6b0 100644 --- a/src/gui/UBTeacherBarWidget.cpp +++ b/src/gui/UBTeacherBarWidget.cpp @@ -57,6 +57,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock connect(UBApplication::boardController, SIGNAL(activeDocumentChanged()), this, SLOT(onActiveDocumentChanged())); connect(mpPreview, SIGNAL(showEditMode()), this, SLOT(onShowEditMode())); + connect(mpPreview, SIGNAL(showDocumentPreview()), this, SLOT(onShowDocumentPreview())); connect(mpDocPreviewWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); connect(mpDocEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); connect(mpPageEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); @@ -150,6 +151,11 @@ void UBTeacherBarWidget::onShowEditMode() onTBStateChanged(eTeacherBarState_PageEdit); } +void UBTeacherBarWidget::onShowDocumentPreview() +{ + onTBStateChanged(eTeacherBarState_DocumentPreview); +} + void UBTeacherBarWidget::onTBStateChanged(eTeacherBarState state) { switch(state){ diff --git a/src/gui/UBTeacherBarWidget.h b/src/gui/UBTeacherBarWidget.h index 26831bfe..a97a4626 100644 --- a/src/gui/UBTeacherBarWidget.h +++ b/src/gui/UBTeacherBarWidget.h @@ -48,6 +48,7 @@ private slots: void onShowEditMode(); void onTBStateChanged(eTeacherBarState state); void onActiveDocumentChanged(); + void onShowDocumentPreview(); private: bool isEmpty(); diff --git a/src/gui/UBThumbnailWidget.cpp b/src/gui/UBThumbnailWidget.cpp index e589300b..c7821ab9 100644 --- a/src/gui/UBThumbnailWidget.cpp +++ b/src/gui/UBThumbnailWidget.cpp @@ -740,25 +740,21 @@ void UBSceneThumbnailNavigPixmap::paint(QPainter *painter, const QStyleOptionGra void UBSceneThumbnailNavigPixmap::mousePressEvent(QGraphicsSceneMouseEvent *event) { - // INFO: This implementation should work but this method is not called on a mousePressEvent, why? - // PLEASE DO NOT REMOVE THIS METHOD! We should reactivate this code when we will fix - // the mousePressEvent-not-called issue! - -// QPointF p = event->pos(); - -// // Here we check the position of the click and verify if it has to trig an action or not. -// if(bCanDelete && p.x() >= 0 && p.x() <= BUTTONSIZE && p.y() >= 0 && p.y() <= BUTTONSIZE) -// { -// deletePage(); -// } -// if(bCanMoveUp && p.x() >= BUTTONSIZE + BUTTONSPACING && p.x() <= 2*BUTTONSIZE + BUTTONSPACING && p.y() >= 0 && p.y() <= BUTTONSIZE) -// { -// moveUpPage(); -// } -// if(bCanMoveDown && p.x() >= 2*(BUTTONSIZE + BUTTONSPACING) && p.x() <= 2*(BUTTONSIZE + BUTTONSPACING) + BUTTONSIZE && p.y() >= 0 && p.y() <= BUTTONSIZE) -// { -// moveDownPage(); -// } + QPointF p = event->pos(); + + // Here we check the position of the click and verify if it has to trig an action or not. + if(bCanDelete && p.x() >= 0 && p.x() <= BUTTONSIZE && p.y() >= 0 && p.y() <= BUTTONSIZE) + { + deletePage(); + } + if(bCanMoveUp && p.x() >= BUTTONSIZE + BUTTONSPACING && p.x() <= 2*BUTTONSIZE + BUTTONSPACING && p.y() >= 0 && p.y() <= BUTTONSIZE) + { + moveUpPage(); + } + if(bCanMoveDown && p.x() >= 2*(BUTTONSIZE + BUTTONSPACING) && p.x() <= 2*(BUTTONSIZE + BUTTONSPACING) + BUTTONSIZE && p.y() >= 0 && p.y() <= BUTTONSIZE) + { + moveDownPage(); + } event->accept(); } @@ -809,32 +805,3 @@ void UBSceneThumbnailNavigPixmap::moveDownPage() { UBApplication::documentController->moveSceneToIndex(proxy(), sceneIndex(), sceneIndex() + 1); } - -void UBSceneThumbnailNavigPixmap::notifyClick(QPointF clickedScenePos) -{ - QPointF p = clickedPos(clickedScenePos); - - // Here we check the position of the click and verify if it has to trig an action or not. - if(bCanDelete && p.x() >= 0 && p.x() <= BUTTONSIZE/2 && p.y() >= 0 && p.y() <= BUTTONSIZE/2) - { - deletePage(); - } - if(bCanMoveUp && p.x() >= (BUTTONSIZE + BUTTONSPACING)/2 && p.x() <= BUTTONSIZE + BUTTONSPACING && p.y() >= 0 && p.y() <= BUTTONSIZE/2) - { - moveUpPage(); - } - if(bCanMoveDown && p.x() >= BUTTONSIZE + BUTTONSPACING && p.x() <= BUTTONSIZE + BUTTONSPACING + BUTTONSIZE/2 && p.y() >= 0 && p.y() <= BUTTONSIZE/2) - { - moveDownPage(); - } -} - -QPointF UBSceneThumbnailNavigPixmap::clickedPos(QPointF clickedScenePos) -{ - QPointF p; - - p.setX(clickedScenePos.x() - scenePos().x()); - p.setY(clickedScenePos.y() - scenePos().y()); - - return p; -} diff --git a/src/gui/UBThumbnailWidget.h b/src/gui/UBThumbnailWidget.h index f3f25d6a..ed47869b 100644 --- a/src/gui/UBThumbnailWidget.h +++ b/src/gui/UBThumbnailWidget.h @@ -292,7 +292,6 @@ class UBSceneThumbnailNavigPixmap : public UBSceneThumbnailPixmap public: UBSceneThumbnailNavigPixmap(const QPixmap& pix, UBDocumentProxy* proxy, int pSceneIndex); ~UBSceneThumbnailNavigPixmap(); - void notifyClick(QPointF clickedScenePos); protected: void hoverEnterEvent(QGraphicsSceneHoverEvent *event); @@ -305,7 +304,6 @@ class UBSceneThumbnailNavigPixmap : public UBSceneThumbnailPixmap void deletePage(); void moveUpPage(); void moveDownPage(); - QPointF clickedPos(QPointF clickedScenePos); bool bButtonsVisible; bool bCanDelete;