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;
mActiveSceneIndex = index;
persistCurrentScene();
setDocument(pDocumentProxy, forceReload);
persistCurrentScene();
updateSystemScaleFactor();
mControlView->setScene(mActiveScene);

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

Loading…
Cancel
Save