Commit a41462f3 authored by Aleksei Kanash's avatar Aleksei Kanash

Fixed behavior for Tools and W3C_tools.

Fixed creation of transparent drawing view.
parent 1b3a3a61
...@@ -533,7 +533,12 @@ Here we determines cases when items should to get mouse press event at pressing ...@@ -533,7 +533,12 @@ Here we determines cases when items should to get mouse press event at pressing
return false; return false;
break; break;
case UBToolWidget::Type:
return true;
case QGraphicsWebView::Type: case QGraphicsWebView::Type:
return true;
case UBGraphicsWidgetItem::Type: case UBGraphicsWidgetItem::Type:
if (currentTool == UBStylusTool::Selector && item->parentItem() && item->parentItem()->isSelected()) if (currentTool == UBStylusTool::Selector && item->parentItem() && item->parentItem()->isSelected())
return true; return true;
...@@ -541,9 +546,13 @@ Here we determines cases when items should to get mouse press event at pressing ...@@ -541,9 +546,13 @@ Here we determines cases when items should to get mouse press event at pressing
return true; return true;
if (currentTool == UBStylusTool::Play) if (currentTool == UBStylusTool::Play)
return true; return true;
return false;
break; break;
} }
if ((UBGraphicsItemType::UserTypesCount > item->type()) && (item->type() > QGraphicsItem::UserType))
return true;
else
return false; return false;
} }
...@@ -559,6 +568,8 @@ bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item) ...@@ -559,6 +568,8 @@ bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item)
switch(item->type()) switch(item->type())
{ {
case QGraphicsWebView::Type:
return false;
case UBGraphicsPixmapItem::Type: case UBGraphicsPixmapItem::Type:
case UBGraphicsTextItem::Type: case UBGraphicsTextItem::Type:
case UBGraphicsWidgetItem::Type: case UBGraphicsWidgetItem::Type:
...@@ -1094,6 +1105,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event) ...@@ -1094,6 +1105,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
if (QGraphicsSvgItem::Type != movingItem->type() && if (QGraphicsSvgItem::Type != movingItem->type() &&
UBGraphicsDelegateFrame::Type != movingItem->type() && UBGraphicsDelegateFrame::Type != movingItem->type() &&
UBToolWidget::Type != movingItem->type() && UBToolWidget::Type != movingItem->type() &&
UBGraphicsCache::Type != movingItem->type() &&
QGraphicsWebView::Type != movingItem->type() && // for W3C widgets as Tools. QGraphicsWebView::Type != movingItem->type() && // for W3C widgets as Tools.
!(!isMultipleSelectionEnabled() && movingItem->parentItem() && UBGraphicsWidgetItem::Type == movingItem->type() && UBGraphicsGroupContainerItem::Type == movingItem->parentItem()->type())) !(!isMultipleSelectionEnabled() && movingItem->parentItem() && UBGraphicsWidgetItem::Type == movingItem->type() && UBGraphicsGroupContainerItem::Type == movingItem->parentItem()->type()))
{ {
......
...@@ -66,7 +66,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) ...@@ -66,7 +66,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mDesktopStylusTool(UBDrawingController::drawingController()->stylusTool()) , mDesktopStylusTool(UBDrawingController::drawingController()->stylusTool())
{ {
mTransparentDrawingView = new UBBoardView(UBApplication::boardController, NULL, true); // deleted in UBDesktopAnnotationController::destructor mTransparentDrawingView = new UBBoardView(UBApplication::boardController, static_cast<QWidget*>(NULL), true); // deleted in UBDesktopAnnotationController::destructor
mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true); mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true);
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment