fixed some bad behaviors on thumbnail views + deactivated moveDown and moveUp icons

preferencesAboutTextFull
Clément Fauconnier 7 years ago
parent cb2c435a61
commit 746382ef79
  1. 7
      src/gui/UBBoardThumbnailsView.cpp
  2. 12
      src/gui/UBThumbnailWidget.cpp

@ -186,12 +186,17 @@ void UBBoardThumbnailsView::mousePressEvent(QMouseEvent *event)
{ {
mLongPressTimer.start(); mLongPressTimer.start();
mLastPressedMousePos = event->pos(); mLastPressedMousePos = event->pos();
UBDraggableThumbnailView* item = dynamic_cast<UBDraggableThumbnailView*>(itemAt(event->pos()));
if (item)
UBApplication::boardController->setActiveDocumentScene(item->sceneIndex());
QGraphicsView::mousePressEvent(event); QGraphicsView::mousePressEvent(event);
} }
void UBBoardThumbnailsView::mouseMoveEvent(QMouseEvent *event) void UBBoardThumbnailsView::mouseMoveEvent(QMouseEvent *event)
{ {
mLastPressedMousePos = event->pos();
QGraphicsView::mouseMoveEvent(event); QGraphicsView::mouseMoveEvent(event);
} }

@ -836,6 +836,7 @@ void UBDraggableThumbnail::paint(QPainter *painter, const QStyleOptionGraphicsIt
draw(painter, *getIcon("duplicate")); draw(painter, *getIcon("duplicate"));
/*
if(movableUp()) if(movableUp())
draw(painter, *getIcon("moveUp")); draw(painter, *getIcon("moveUp"));
else else
@ -845,6 +846,7 @@ void UBDraggableThumbnail::paint(QPainter *painter, const QStyleOptionGraphicsIt
draw(painter, *getIcon("moveDown")); draw(painter, *getIcon("moveDown"));
else else
draw(painter, *getIcon("moveDownDisabled")); draw(painter, *getIcon("moveDownDisabled"));
*/
} }
} }
@ -888,11 +890,6 @@ void UBDraggableThumbnail::moveDownPage()
} }
void UBDraggableThumbnail::mousePressEvent(QGraphicsSceneMouseEvent *event) void UBDraggableThumbnail::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
event->accept();
}
void UBDraggableThumbnail::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{ {
QPointF p = event->pos(); QPointF p = event->pos();
@ -913,6 +910,11 @@ void UBDraggableThumbnail::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
event->accept(); event->accept();
} }
void UBDraggableThumbnail::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
event->accept();
}
void UBDraggableThumbnailView::updatePos(qreal width, qreal height) void UBDraggableThumbnailView::updatePos(qreal width, qreal height)
{ {

Loading…
Cancel
Save