diff --git a/resources/images/toque.png b/resources/images/toque.png
new file mode 100644
index 00000000..a976e147
Binary files /dev/null and b/resources/images/toque.png differ
diff --git a/resources/sankore.qrc b/resources/sankore.qrc
index 425c21c5..8965e022 100644
--- a/resources/sankore.qrc
+++ b/resources/sankore.qrc
@@ -365,5 +365,6 @@
images/teacherGuide/pencil.svg
images/duplicateDisabled.svg
images/teacherGuide/flash_24x24.svg
+ images/toque.png
diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp
index 4be9ee0f..24d76fd6 100755
--- a/src/document/UBDocumentController.cpp
+++ b/src/document/UBDocumentController.cpp
@@ -363,25 +363,18 @@ void UBDocumentController::setupViews()
connect(mDocumentUI->thumbnailWidget, SIGNAL(sceneDropped(UBDocumentProxy*, int, int)), this, SLOT(moveSceneToIndex ( UBDocumentProxy*, int, int)));
connect(mDocumentUI->thumbnailWidget, SIGNAL(resized()), this, SLOT(thumbnailViewResized()));
- connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseDoubleClick(QGraphicsItem*, int)),
- this, SLOT(pageDoubleClicked(QGraphicsItem*, int)));
- connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseClick(QGraphicsItem*, int)),
- this, SLOT(pageClicked(QGraphicsItem*, int)));
+ connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseDoubleClick(QGraphicsItem*, int)), this, SLOT(pageDoubleClicked(QGraphicsItem*, int)));
+ connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseClick(QGraphicsItem*, int)), this, SLOT(pageClicked(QGraphicsItem*, int)));
- connect(mDocumentUI->thumbnailWidget->scene(), SIGNAL(selectionChanged()),
- this, SLOT(pageSelectionChanged()));
+ connect(mDocumentUI->thumbnailWidget->scene(), SIGNAL(selectionChanged()), this, SLOT(pageSelectionChanged()));
- connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentCreated(UBDocumentProxy*)),
- this, SLOT(addDocumentInTree(UBDocumentProxy*)));
+ connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentCreated(UBDocumentProxy*)), this, SLOT(addDocumentInTree(UBDocumentProxy*)));
- connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentMetadataChanged(UBDocumentProxy*)),
- this, SLOT(updateDocumentInTree(UBDocumentProxy*)));
+ connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentMetadataChanged(UBDocumentProxy*)), this, SLOT(updateDocumentInTree(UBDocumentProxy*)));
- connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneCreated(UBDocumentProxy*, int)),
- this, SLOT(documentSceneChanged(UBDocumentProxy*, int)));
+ connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneCreated(UBDocumentProxy*, int)), this, SLOT(documentSceneChanged(UBDocumentProxy*, int)));
- connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneWillBeDeleted(UBDocumentProxy*, int)),
- this, SLOT(documentSceneChanged(UBDocumentProxy*, int)));
+ connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneWillBeDeleted(UBDocumentProxy*, int)), this, SLOT(documentSceneChanged(UBDocumentProxy*, int)));
mDocumentUI->thumbnailWidget->setBackgroundBrush(UBSettings::documentViewLightColor);
@@ -996,7 +989,7 @@ void UBDocumentController::addFolderOfImages()
if (importedImageNumber == 0)
{
- showMessage(tr("Folder does not contain any image files!"));
+ showMessage(tr("Folder does not contain any image files"));
UBApplication::applicationController->showDocument();
}
else
diff --git a/src/gui/UBDocumentNavigator.cpp b/src/gui/UBDocumentNavigator.cpp
index e2de9970..90b45615 100644
--- a/src/gui/UBDocumentNavigator.cpp
+++ b/src/gui/UBDocumentNavigator.cpp
@@ -69,6 +69,9 @@ UBDocumentNavigator::~UBDocumentNavigator()
}
}
+#include "gui/UBDockTeacherGuideWidget.h"
+#include "gui/UBTeacherGuideWidget.h"
+
/**
* \brief Generate the thumbnails
*/
@@ -84,10 +87,31 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
for(int i = 0; i < source->selectedDocument()->pageCount(); i++)
{
+
const QPixmap* pix = source->pageAt(i);
- UBSceneThumbnailNavigPixmap* pixmapItem = new UBSceneThumbnailNavigPixmap(*pix, source->selectedDocument(), i);
+ QPixmap result(pix->width(),pix->height());
int pageIndex = UBDocumentContainer::pageFromSceneIndex(i);
- QString label = pageIndex == 0 ? tr("Title page") : tr("Page %0").arg(pageIndex);
+
+ QPainter composePainter;
+ composePainter.begin(&result);
+ composePainter.drawPixmap(QPoint(0,0),*pix);
+
+ if(pageIndex == UBApplication::boardController->currentPage() &&
+ ((pageIndex == 0 && UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool()) ||
+ (pageIndex && UBSettings::settings()->teacherGuideLessonPagesActivated->get().toBool()))
+ ) {
+ if(UBApplication::boardController->paletteManager()->teacherGuideDockWidget()->teacherGuideWidget()->isModified()){
+ QPixmap toque(":images/toque.png");
+ composePainter.setOpacity(0.6);
+ composePainter.drawPixmap(QPoint(pix->width() - toque.width(),0),toque);
+ }
+ }
+
+ composePainter.end();
+
+ UBSceneThumbnailNavigPixmap* pixmapItem = new UBSceneThumbnailNavigPixmap(result, source->selectedDocument(), i);
+
+ QString label = pageIndex == 0 ? tr("Title page") : tr("Page %0").arg(pageIndex);
UBThumbnailTextItem *labelItem = new UBThumbnailTextItem(label);
UBImgTextThumbnailElement thumbWithText(pixmapItem, labelItem);
@@ -104,7 +128,7 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
void UBDocumentNavigator::onScrollToSelectedPage(int index)
{
- qDebug() << "Selection in widet: " << index;
+ qDebug() << "Selection in widget: " << index;
int c = 0;
foreach(UBImgTextThumbnailElement el, mThumbsWithLabels)
{
@@ -118,7 +142,6 @@ void UBDocumentNavigator::onScrollToSelectedPage(int index)
}
c++;
}
-// centerOn(mThumbsWithLabels[index].getThumbnail());
}
/**
@@ -131,8 +154,7 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage)
//UBGraphicsScene* pScene = UBApplication::boardController->activeScene();
const QPixmap* pix = UBApplication::boardController->pageAt(iPage);
- UBSceneThumbnailNavigPixmap* newItem = new UBSceneThumbnailNavigPixmap(*pix,
- UBApplication::boardController->selectedDocument(), iPage);
+ UBSceneThumbnailNavigPixmap* newItem = new UBSceneThumbnailNavigPixmap(*pix, UBApplication::boardController->selectedDocument(), iPage);
// Get the old thumbnail
UBSceneThumbnailNavigPixmap* oldItem = mThumbsWithLabels.at(iPage).getThumbnail();
diff --git a/src/gui/UBTeacherGuideWidget.cpp b/src/gui/UBTeacherGuideWidget.cpp
index 77c692a5..ffe11cbd 100644
--- a/src/gui/UBTeacherGuideWidget.cpp
+++ b/src/gui/UBTeacherGuideWidget.cpp
@@ -1152,9 +1152,7 @@ bool UBTeacherGuidePageZeroWidget::isModified()
void UBTeacherGuidePageZeroWidget::resizeEvent(QResizeEvent* ev)
{
emit resized();
-/* mpScrollArea->resize(width(), height());
- mpContainerWidget->resize(width(), height());
-*/ QWidget::resizeEvent(ev);
+ QWidget::resizeEvent(ev);
}
/***************************************************************************