fixed some bad behaviors around thumbnail views and document persistence

preferencesAboutTextFull
Clément Fauconnier 7 years ago
parent 746382ef79
commit 7a9b89694b
  1. 4
      src/board/UBBoardController.cpp
  2. 9
      src/gui/UBBoardThumbnailsView.cpp

@ -1539,10 +1539,10 @@ void UBBoardController::setActiveDocumentScene(UBDocumentProxy* pDocumentProxy,
mActiveScene = targetScene; mActiveScene = targetScene;
mActiveSceneIndex = index; mActiveSceneIndex = index;
persistCurrentScene();
setDocument(pDocumentProxy, forceReload); setDocument(pDocumentProxy, forceReload);
persistCurrentScene();
updateSystemScaleFactor(); updateSystemScaleFactor();
mControlView->setScene(mActiveScene); mControlView->setScene(mActiveScene);

@ -183,14 +183,17 @@ void UBBoardThumbnailsView::resizeEvent(QResizeEvent *event)
} }
void UBBoardThumbnailsView::mousePressEvent(QMouseEvent *event) void UBBoardThumbnailsView::mousePressEvent(QMouseEvent *event)
{ {
mLongPressTimer.start(); mLongPressTimer.start();
mLastPressedMousePos = event->pos(); mLastPressedMousePos = event->pos();
UBDraggableThumbnailView* item = dynamic_cast<UBDraggableThumbnailView*>(itemAt(event->pos())); UBDraggableThumbnailView* item = dynamic_cast<UBDraggableThumbnailView*>(itemAt(event->pos()));
if (item) if (item)
{
UBApplication::boardController->persistCurrentScene();
UBApplication::boardController->setActiveDocumentScene(item->sceneIndex()); UBApplication::boardController->setActiveDocumentScene(item->sceneIndex());
}
QGraphicsView::mousePressEvent(event); QGraphicsView::mousePressEvent(event);
} }
@ -202,7 +205,9 @@ void UBBoardThumbnailsView::mouseMoveEvent(QMouseEvent *event)
void UBBoardThumbnailsView::longPressTimeout() void UBBoardThumbnailsView::longPressTimeout()
{ {
emit mousePressAndHoldEventRequired(mLastPressedMousePos); if (QApplication::mouseButtons() != Qt::NoButton)
emit mousePressAndHoldEventRequired(mLastPressedMousePos);
mLongPressTimer.stop(); mLongPressTimer.stop();
} }

Loading…
Cancel
Save