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
c65efdee
Commit
c65efdee
authored
May 03, 2013
by
Ilia Ryabokon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Selection process changed
parent
a6ec6d7a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
15 deletions
+53
-15
UBBoardView.cpp
src/board/UBBoardView.cpp
+12
-2
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+1
-1
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+22
-10
UBGraphicsItemDelegate.h
src/domain/UBGraphicsItemDelegate.h
+2
-0
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+3
-0
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+3
-0
UBGraphicsStrokesGroup.cpp
src/domain/UBGraphicsStrokesGroup.cpp
+10
-2
No files found.
src/board/UBBoardView.cpp
View file @
c65efdee
...
...
@@ -1023,11 +1023,13 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
}
mUBRubberBand
->
setGeometry
(
QRect
(
mMouseDownPos
,
QSize
()));
mUBRubberBand
->
show
();
scene
()
->
setMultipleSelectionProcess
(
true
);
}
else
{
if
(
mUBRubberBand
)
mUBRubberBand
->
hide
();
scene
()
->
setMultipleSelectionProcess
(
false
);
}
handleItemMousePress
(
event
);
...
...
@@ -1061,6 +1063,7 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
mRubberBand
->
setGeometry
(
QRect
(
mMouseDownPos
,
QSize
()));
mRubberBand
->
show
();
mIsCreatingTextZone
=
true
;
scene
()
->
setMultipleSelectionProcess
(
true
);
event
->
accept
();
}
...
...
@@ -1075,6 +1078,7 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
mRubberBand
->
setGeometry
(
QRect
(
mMouseDownPos
,
QSize
()));
mRubberBand
->
show
();
mIsCreatingSceneGrabZone
=
true
;
scene
()
->
setMultipleSelectionProcess
(
true
);
event
->
accept
();
}
...
...
@@ -1283,6 +1287,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
if
(
mUBRubberBand
&&
mUBRubberBand
->
isVisible
())
{
mUBRubberBand
->
hide
();
scene
()
->
setMultipleSelectionProcess
(
false
);
}
if
(
bReleaseIsNeed
)
...
...
@@ -1316,8 +1321,11 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
}
else
if
(
currentTool
==
UBStylusTool
::
Text
)
{
if
(
mRubberBand
)
if
(
mRubberBand
)
{
mRubberBand
->
hide
();
scene
()
->
setMultipleSelectionProcess
(
false
);
}
if
(
scene
()
&&
mRubberBand
&&
mIsCreatingTextZone
)
{
...
...
@@ -1340,8 +1348,10 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
}
else
if
(
currentTool
==
UBStylusTool
::
Capture
)
{
if
(
mRubberBand
)
if
(
mRubberBand
)
{
mRubberBand
->
hide
();
scene
()
->
setMultipleSelectionProcess
(
false
);
}
if
(
scene
()
&&
mRubberBand
&&
mIsCreatingSceneGrabZone
&&
mRubberBand
->
geometry
().
width
()
>
16
)
{
...
...
src/board/UBFeaturesController.cpp
View file @
c65efdee
...
...
@@ -59,7 +59,7 @@ const QString UBFeaturesController::webSearchPath = rootPath + "/Web search";
void
UBFeaturesComputingThread
::
scanFS
(
const
QUrl
&
currentPath
,
const
QString
&
currVirtualPath
,
const
QSet
<
QUrl
>
&
pFavoriteSet
)
{
Q_ASSERT
(
QFileInfo
(
currentPath
.
toLocalFile
()).
exists
());
//
Q_ASSERT(QFileInfo(currentPath.toLocalFile()).exists());
QFileInfoList
fileInfoList
=
UBFileSystemUtils
::
allElementsInDirectory
(
currentPath
.
toLocalFile
());
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
c65efdee
...
...
@@ -226,6 +226,16 @@ void UBGraphicsItemDelegate::init()
setRotatable
(
false
);
}
void
UBGraphicsItemDelegate
::
createControls
()
{
}
void
UBGraphicsItemDelegate
::
freeControls
()
{
}
UBGraphicsItemDelegate
::~
UBGraphicsItemDelegate
()
{
...
...
@@ -242,9 +252,10 @@ QVariant UBGraphicsItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange ch
if
(
change
==
QGraphicsItem
::
ItemSelectedHasChanged
)
{
bool
ok
;
bool
selected
=
value
.
toUInt
(
&
ok
);
if
(
ok
)
{
UBGraphicsScene
*
ubScene
=
castUBGraphicsScene
();
if
(
ubScene
)
{
if
(
ubScene
&&
!
ubScene
->
multipleSelectionProcess
()
)
{
if
(
selected
)
{
ubScene
->
setSelectedZLevel
(
delegated
());
}
else
{
...
...
@@ -254,15 +265,16 @@ QVariant UBGraphicsItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange ch
}
}
if
((
change
==
QGraphicsItem
::
ItemSelectedHasChanged
||
change
==
QGraphicsItem
::
ItemPositionHasChanged
||
change
==
QGraphicsItem
::
ItemTransformHasChanged
)
&&
mDelegated
->
scene
()
&&
UBApplication
::
boardController
)
{
mAntiScaleRatio
=
1
/
(
UBApplication
::
boardController
->
systemScaleFactor
()
*
UBApplication
::
boardController
->
currentZoom
());
positionHandles
();
}
// if ((change == QGraphicsItem::ItemSelectedHasChanged
// || change == QGraphicsItem::ItemPositionHasChanged
// || change == QGraphicsItem::ItemTransformHasChanged)
// && mDelegated->scene()
// && UBApplication::boardController)
// {
// mAntiScaleRatio = 1 / (UBApplication::boardController->systemScaleFactor() * UBApplication::boardController->currentZoom());
// positionHandles();
// }
if
(
change
==
QGraphicsItem
::
ItemPositionHasChanged
||
change
==
QGraphicsItem
::
ItemTransformHasChanged
...
...
src/domain/UBGraphicsItemDelegate.h
View file @
c65efdee
...
...
@@ -220,6 +220,8 @@ class UBGraphicsItemDelegate : public QObject
virtual
~
UBGraphicsItemDelegate
();
void
init
();
void
createControls
();
void
freeControls
();
virtual
bool
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
bool
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
...
...
src/domain/UBGraphicsScene.cpp
View file @
c65efdee
...
...
@@ -287,6 +287,7 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent, bool enableUndoRedoSta
,
mZLayerController
(
new
UBZLayerController
(
this
))
,
mpLastPolygon
(
NULL
)
,
mCurrentPolygon
(
0
)
,
mMultipleSelectionProcess
(
false
)
{
UBCoreGraphicsScene
::
setObjectName
(
"BoardScene"
);
#ifdef __ppc__
...
...
@@ -295,6 +296,8 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent, bool enableUndoRedoSta
mShouldUseOMP
=
QSysInfo
::
MacintoshVersion
>=
QSysInfo
::
MV_10_5
;
#endif
setItemIndexMethod
(
QGraphicsScene
::
BspTreeIndex
);
setUuid
(
QUuid
::
createUuid
());
setDocument
(
parent
);
createEraiser
();
...
...
src/domain/UBGraphicsScene.h
View file @
c65efdee
...
...
@@ -310,6 +310,8 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
static
QUuid
getPersonalUuid
(
QGraphicsItem
*
item
);
UBGraphicsPolygonItem
*
polygonToPolygonItem
(
const
QPolygonF
pPolygon
);
void
setMultipleSelectionProcess
(
bool
pEnabled
)
{
mMultipleSelectionProcess
=
pEnabled
;}
bool
multipleSelectionProcess
()
const
{
return
mMultipleSelectionProcess
;}
public
slots
:
void
initStroke
();
...
...
@@ -427,6 +429,7 @@ public slots:
bool
mDrawWithCompass
;
UBGraphicsPolygonItem
*
mCurrentPolygon
;
bool
mMultipleSelectionProcess
;
};
...
...
src/domain/UBGraphicsStrokesGroup.cpp
View file @
c65efdee
...
...
@@ -181,9 +181,18 @@ void UBGraphicsStrokesGroup::paint(QPainter *painter, const QStyleOptionGraphics
{
// Never draw the rubber band, we draw our custom selection with the DelegateFrame
QStyleOptionGraphicsItem
styleOption
=
QStyleOptionGraphicsItem
(
*
option
);
bool
selectedState
=
false
;
if
(
styleOption
.
state
&
QStyle
::
State_Selected
)
{
selectedState
=
true
;
}
styleOption
.
state
&=
~
QStyle
::
State_Selected
;
QGraphicsItemGroup
::
paint
(
painter
,
&
styleOption
,
widget
);
if
(
selectedState
)
{
painter
->
save
();
painter
->
setBrush
(
QColor
(
0x88
,
0x88
,
0x88
,
0x77
));
painter
->
drawRect
(
boundingRect
());
painter
->
restore
();
}
}
QVariant
UBGraphicsStrokesGroup
::
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
)
...
...
@@ -192,7 +201,6 @@ QVariant UBGraphicsStrokesGroup::itemChange(GraphicsItemChange change, const QVa
return
QGraphicsItemGroup
::
itemChange
(
change
,
newValue
);
}
QPainterPath
UBGraphicsStrokesGroup
::
shape
()
const
{
QPainterPath
path
;
...
...
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