|
|
@ -42,6 +42,7 @@ |
|
|
|
#include "board/UBBoardPaletteManager.h" |
|
|
|
#include "board/UBBoardPaletteManager.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "domain/UBGraphicsScene.h" |
|
|
|
#include "domain/UBGraphicsScene.h" |
|
|
|
|
|
|
|
#include "domain/UBGraphicsPolygonItem.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "UBCustomCaptureWindow.h" |
|
|
|
#include "UBCustomCaptureWindow.h" |
|
|
|
#include "UBWindowCapture.h" |
|
|
|
#include "UBWindowCapture.h" |
|
|
@ -179,6 +180,25 @@ UBDesktopPalette* UBDesktopAnnotationController::desktopPalette() |
|
|
|
return mDesktopPalette; |
|
|
|
return mDesktopPalette; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QPainterPath UBDesktopAnnotationController::desktopPalettePath() const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QPainterPath result; |
|
|
|
|
|
|
|
if (mDesktopPalette && mDesktopPalette->isVisible()) { |
|
|
|
|
|
|
|
result.addRect(mDesktopPalette->geometry()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mDesktopPenPalette && mDesktopPenPalette->isVisible()) { |
|
|
|
|
|
|
|
result.addRect(mDesktopPenPalette->geometry()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mDesktopMarkerPalette && mDesktopMarkerPalette->isVisible()) { |
|
|
|
|
|
|
|
result.addRect(mDesktopMarkerPalette->geometry()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mDesktopEraserPalette && mDesktopEraserPalette->isVisible()) { |
|
|
|
|
|
|
|
result.addRect(mDesktopEraserPalette->geometry()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* \brief Toggle the visibility of the pen associated palette |
|
|
|
* \brief Toggle the visibility of the pen associated palette |
|
|
|
* @param checked as the visibility state |
|
|
|
* @param checked as the visibility state |
|
|
@ -821,6 +841,7 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent) |
|
|
|
// Here we have to generate a new mask This method is certainly resource
|
|
|
|
// Here we have to generate a new mask This method is certainly resource
|
|
|
|
// consuming but for the moment this is the only solution that I found.
|
|
|
|
// consuming but for the moment this is the only solution that I found.
|
|
|
|
mMask = QPixmap(mTransparentDrawingView->width(), mTransparentDrawingView->height()); |
|
|
|
mMask = QPixmap(mTransparentDrawingView->width(), mTransparentDrawingView->height()); |
|
|
|
|
|
|
|
mMask.fill(Qt::transparent); |
|
|
|
|
|
|
|
|
|
|
|
QPainter p; |
|
|
|
QPainter p; |
|
|
|
|
|
|
|
|
|
|
@ -897,7 +918,7 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QGraphicsItem* pCrntItem = allItems.at(i); |
|
|
|
QGraphicsItem* pCrntItem = allItems.at(i); |
|
|
|
|
|
|
|
|
|
|
|
if(pCrntItem->isVisible()) |
|
|
|
if(pCrntItem->isVisible() && pCrntItem->type() == UBGraphicsPolygonItem::Type) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QPainterPath crntPath = pCrntItem->shape(); |
|
|
|
QPainterPath crntPath = pCrntItem->shape(); |
|
|
|
QRectF rect = crntPath.boundingRect(); |
|
|
|
QRectF rect = crntPath.boundingRect(); |
|
|
@ -908,7 +929,7 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent) |
|
|
|
|
|
|
|
|
|
|
|
annotationPainter.end(); |
|
|
|
annotationPainter.end(); |
|
|
|
|
|
|
|
|
|
|
|
mTransparentDrawingView->setMask(mMask.createMaskFromColor(Qt::black)); |
|
|
|
mTransparentDrawingView->setMask(mMask.mask()); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|