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. 5
      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);

@ -190,7 +190,10 @@ void UBBoardThumbnailsView::mousePressEvent(QMouseEvent *event)
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()
{ {
if (QApplication::mouseButtons() != Qt::NoButton)
emit mousePressAndHoldEventRequired(mLastPressedMousePos); emit mousePressAndHoldEventRequired(mLastPressedMousePos);
mLongPressTimer.stop(); mLongPressTimer.stop();
} }

Loading…
Cancel
Save