Merge branch 'master' of github.com:Sankore/Sankore-3.1

Conflicts:
	src/board/UBBoardView.cpp
	src/domain/UBGraphicsScene.cpp
preferencesAboutTextFull
Claudio Valerio 13 years ago
commit 9e16923cfd
  1. 36
      src/board/UBBoardView.cpp
  2. 3
      src/domain/UBGraphicsScene.cpp

@ -481,9 +481,9 @@ bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item)
case UBGraphicsPixmapItem::Type:
case UBGraphicsTextItem::Type:
case UBGraphicsW3CWidgetItem::Type:
if (currentTool != UBStylusTool::Play && !item->isSelected() && item->parentItem())
if (currentTool == UBStylusTool::Selector && !item->isSelected() && item->parentItem())
return true;
if (currentTool != UBStylusTool::Play && !item->isSelected())
if (currentTool == UBStylusTool::Selector && item->isSelected())
return true;
break;
@ -580,12 +580,21 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
if (itemShouldReceiveMousePressEvent(movingItem))
QGraphicsView::mousePressEvent (event);
else
if (itemShouldReceiveSuspendedMousePressEvent(movingItem))
{
if (movingItem)
movingItem->clearFocus();
if (suspendedMousePressEvent)
{
delete suspendedMousePressEvent;
suspendedMousePressEvent = NULL;
}
if (itemShouldReceiveSuspendedMousePressEvent(movingItem))
{
suspendedMousePressEvent = new QMouseEvent(event->type(), event->pos(), event->button(), event->buttons(), event->modifiers());
}
}
}
void UBBoardView::handleItemMouseMove(QMouseEvent *event)
@ -933,6 +942,10 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
delete suspendedMousePressEvent;
suspendedMousePressEvent = NULL;
}
else
{
movingItem->setSelected(true);
}
}
if (mUBRubberBand && mUBRubberBand->isVisible()) {
@ -1163,6 +1176,7 @@ void UBBoardView::dropEvent (QDropEvent *event)
UBGraphicsWidgetItem* graphicsWidget = dynamic_cast<UBGraphicsWidgetItem*>(graphicsItemAtPos);
if (graphicsWidget && graphicsWidget->acceptDrops()) {
graphicsWidget->processDropEvent(event);
event->acceptProposedAction();
@ -1295,20 +1309,16 @@ void UBBoardView::virtualKeyboardActivated(bool b)
bool UBBoardView::isAbsurdPoint(QPoint point)
{
#ifdef Q_WS_MACX
QDesktopWidget *desktop = qApp->desktop();
QDesktopWidget *desktop = qApp->desktop ();
bool isValidPoint = false;
for (int i = 0; i < desktop->numScreens() && !isValidPoint; i++){
QRect screenRect = desktop->screenGeometry(i);
screenRect=QRect(QPoint(0,0),screenRect.size());
isValidPoint = isValidPoint || screenRect.contains(point);
for (int i = 0; i < desktop->numScreens (); i++)
{
QRect screenRect = desktop->screenGeometry (i);
isValidPoint = isValidPoint || screenRect.contains (point);
}
return !isValidPoint;
#else
Q_UNUSED(point);
return false;
#endif
}
void

@ -43,6 +43,7 @@
#include "board/UBBoardController.h"
#include "board/UBDrawingController.h"
#include "board/UBBoardView.h"
#include "UBGraphicsItemUndoCommand.h"
#include "UBGraphicsTextItemUndoCommand.h"
@ -1454,6 +1455,8 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co
{
UBApplication::boardController->moveGraphicsWidgetToControlView(graphicsWidget);
}
UBApplication::boardController->controlView()->setFocus();
}
UBGraphicsW3CWidgetItem* UBGraphicsScene::addOEmbed(const QUrl& pContentUrl, const QPointF& pPos)

Loading…
Cancel
Save