Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
09c1ba37
Commit
09c1ba37
authored
Feb 15, 2013
by
Ilia Ryabokon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved #1380 #1370 and #1369 from 2.10.00
parent
8abe5e77
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
5 deletions
+43
-5
UBBoardView.cpp
src/board/UBBoardView.cpp
+17
-1
UBDesktopAnnotationController.cpp
src/desktop/UBDesktopAnnotationController.cpp
+25
-4
UBDesktopAnnotationController.h
src/desktop/UBDesktopAnnotationController.h
+1
-0
No files found.
src/board/UBBoardView.cpp
View file @
09c1ba37
...
...
@@ -52,6 +52,11 @@
#include "board/UBBoardController.h"
#include "board/UBBoardPaletteManager.h"
#ifdef Q_WS_MAC
#include "core/UBApplicationController.h"
#include "desktop/UBDesktopAnnotationController.h"
#endif
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBGraphicsPixmapItem.h"
#include "domain/UBGraphicsWidgetItem.h"
...
...
@@ -379,6 +384,17 @@ void UBBoardView::tabletEvent (QTabletEvent * event)
bool
acceptEvent
=
true
;
#ifdef Q_WS_MAC
//Work around #1388. After selecting annotation tool in desktop mode, annotation view appears on top when
//using Mac OS X. In this case tablet event should send mouse event so as to let user interact with
//stylus palette.
Q_ASSERT
(
UBApplication
::
applicationController
->
uninotesController
());
if
(
UBApplication
::
applicationController
->
uninotesController
()
->
drawingView
()
==
this
)
{
if
(
UBApplication
::
applicationController
->
uninotesController
()
->
desktopPalettePath
().
contains
(
event
->
pos
()))
{
acceptEvent
=
false
;
}
}
#endif
switch
(
event
->
type
())
{
case
QEvent
:
:
TabletPress
:
{
...
...
@@ -1161,7 +1177,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
movingItem
=
NULL
;
}
else
if
(
movingItem
&&
!
isCppTool
(
movingItem
))
if
(
movingItem
&&
(
!
isCppTool
(
movingItem
)
||
UBGraphicsCurtainItem
::
Type
==
movingItem
->
type
()
))
{
if
(
suspendedMousePressEvent
)
{
...
...
src/desktop/UBDesktopAnnotationController.cpp
View file @
09c1ba37
...
...
@@ -42,6 +42,7 @@
#include "board/UBBoardPaletteManager.h"
#include "domain/UBGraphicsScene.h"
#include "domain/UBGraphicsPolygonItem.h"
#include "UBCustomCaptureWindow.h"
#include "UBWindowCapture.h"
...
...
@@ -179,6 +180,25 @@ UBDesktopPalette* UBDesktopAnnotationController::desktopPalette()
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
* @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
// consuming but for the moment this is the only solution that I found.
mMask
=
QPixmap
(
mTransparentDrawingView
->
width
(),
mTransparentDrawingView
->
height
());
mMask
.
fill
(
Qt
::
transparent
);
QPainter
p
;
...
...
@@ -836,8 +857,8 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
}
if
(
UBApplication
::
boardController
->
paletteManager
()
->
mKeyboardPalette
->
isVisible
())
{
p
.
drawRect
(
UBApplication
::
boardController
->
paletteManager
()
->
mKeyboardPalette
->
geometry
().
x
(),
UBApplication
::
boardController
->
paletteManager
()
->
mKeyboardPalette
->
geometry
().
y
(),
UBApplication
::
boardController
->
paletteManager
()
->
mKeyboardPalette
->
width
(),
UBApplication
::
boardController
->
paletteManager
()
->
mKeyboardPalette
->
height
());
p
.
drawRect
(
UBApplication
::
boardController
->
paletteManager
()
->
mKeyboardPalette
->
geometry
().
x
(),
UBApplication
::
boardController
->
paletteManager
()
->
mKeyboardPalette
->
geometry
().
y
(),
UBApplication
::
boardController
->
paletteManager
()
->
mKeyboardPalette
->
width
(),
UBApplication
::
boardController
->
paletteManager
()
->
mKeyboardPalette
->
height
());
}
if
(
UBApplication
::
boardController
->
paletteManager
()
->
leftPalette
()
->
isVisible
())
...
...
@@ -897,7 +918,7 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
{
QGraphicsItem
*
pCrntItem
=
allItems
.
at
(
i
);
if
(
pCrntItem
->
isVisible
())
if
(
pCrntItem
->
isVisible
()
&&
pCrntItem
->
type
()
==
UBGraphicsPolygonItem
::
Type
)
{
QPainterPath
crntPath
=
pCrntItem
->
shape
();
QRectF
rect
=
crntPath
.
boundingRect
();
...
...
@@ -908,7 +929,7 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
annotationPainter
.
end
();
mTransparentDrawingView
->
setMask
(
mMask
.
createMaskFromColor
(
Qt
::
black
));
mTransparentDrawingView
->
setMask
(
mMask
.
mask
(
));
}
else
{
...
...
src/desktop/UBDesktopAnnotationController.h
View file @
09c1ba37
...
...
@@ -61,6 +61,7 @@ class UBDesktopAnnotationController : public QObject
void
hideWindow
();
UBDesktopPalette
*
desktopPalette
();
QPainterPath
desktopPalettePath
()
const
;
UBBoardView
*
drawingView
();
void
TransparentWidgetResized
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment