|
|
|
@ -85,7 +85,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB |
|
|
|
|
#ifdef Q_OS_OSX |
|
|
|
|
mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true); |
|
|
|
|
#endif |
|
|
|
|
mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window | Qt::NoDropShadowWindowHint); |
|
|
|
|
mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window | Qt::NoDropShadowWindowHint | Qt::X11BypassWindowManagerHint); |
|
|
|
|
mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone); |
|
|
|
|
mTransparentDrawingView->resize(UBApplication::desktop()->width(), UBApplication::desktop()->height()); |
|
|
|
|
|
|
|
|
@ -945,9 +945,20 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent) |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// Remove the mask
|
|
|
|
|
QPixmap noMask(mTransparentDrawingView->width(), mTransparentDrawingView->height()); |
|
|
|
|
mTransparentDrawingView->setMask(noMask.mask()); |
|
|
|
|
mMask = QPixmap(mTransparentDrawingView->width(), mTransparentDrawingView->height()); |
|
|
|
|
mMask.fill(Qt::transparent); |
|
|
|
|
|
|
|
|
|
QPainter p; |
|
|
|
|
|
|
|
|
|
p.begin(&mMask); |
|
|
|
|
|
|
|
|
|
p.setPen(Qt::red); |
|
|
|
|
p.setBrush(QBrush(Qt::red)); |
|
|
|
|
|
|
|
|
|
p.drawRect(mTransparentDrawingView->geometry().x(), mTransparentDrawingView->geometry().y(), mTransparentDrawingView->width(), mTransparentDrawingView->height()); |
|
|
|
|
p.end(); |
|
|
|
|
|
|
|
|
|
mTransparentDrawingView->setMask(mMask.mask()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|