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
ead5cff1
Commit
ead5cff1
authored
Feb 03, 2012
by
Anatoly Mihalchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enhancements for document navigator
parent
a2ee87b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
55 deletions
+16
-55
UBDocumentNavigator.cpp
src/gui/UBDocumentNavigator.cpp
+1
-5
UBThumbnailWidget.cpp
src/gui/UBThumbnailWidget.cpp
+15
-48
UBThumbnailWidget.h
src/gui/UBThumbnailWidget.h
+0
-2
No files found.
src/gui/UBDocumentNavigator.cpp
View file @
ead5cff1
...
...
@@ -391,17 +391,13 @@ void UBDocumentNavigator::mousePressEvent(QMouseEvent *event)
mCrntItem
=
pCrntItem
;
}
// HACK: for an unknown reason, the mousePressEvent of the item is not
// called when a click occurs on it. So I created this method in
// order to handle the click.
mCrntItem
->
notifyClick
(
mapToScene
(
event
->
pos
()));
// Then display the related page
emit
changeCurrentPage
();
refreshScene
();
}
bNavig
=
false
;
}
QGraphicsView
::
mousePressEvent
(
event
);
}
/**
...
...
src/gui/UBThumbnailWidget.cpp
View file @
ead5cff1
...
...
@@ -740,25 +740,21 @@ void UBSceneThumbnailNavigPixmap::paint(QPainter *painter, const QStyleOptionGra
void
UBSceneThumbnailNavigPixmap
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
// INFO: This implementation should work but this method is not called on a mousePressEvent, why?
// PLEASE DO NOT REMOVE THIS METHOD! We should reactivate this code when we will fix
// the mousePressEvent-not-called issue!
// QPointF p = event->pos();
// // Here we check the position of the click and verify if it has to trig an action or not.
// if(bCanDelete && p.x() >= 0 && p.x() <= BUTTONSIZE && p.y() >= 0 && p.y() <= BUTTONSIZE)
// {
// deletePage();
// }
// if(bCanMoveUp && p.x() >= BUTTONSIZE + BUTTONSPACING && p.x() <= 2*BUTTONSIZE + BUTTONSPACING && p.y() >= 0 && p.y() <= BUTTONSIZE)
// {
// moveUpPage();
// }
// if(bCanMoveDown && p.x() >= 2*(BUTTONSIZE + BUTTONSPACING) && p.x() <= 2*(BUTTONSIZE + BUTTONSPACING) + BUTTONSIZE && p.y() >= 0 && p.y() <= BUTTONSIZE)
// {
// moveDownPage();
// }
QPointF
p
=
event
->
pos
();
// Here we check the position of the click and verify if it has to trig an action or not.
if
(
bCanDelete
&&
p
.
x
()
>=
0
&&
p
.
x
()
<=
BUTTONSIZE
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
{
deletePage
();
}
if
(
bCanMoveUp
&&
p
.
x
()
>=
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
x
()
<=
2
*
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
{
moveUpPage
();
}
if
(
bCanMoveDown
&&
p
.
x
()
>=
2
*
(
BUTTONSIZE
+
BUTTONSPACING
)
&&
p
.
x
()
<=
2
*
(
BUTTONSIZE
+
BUTTONSPACING
)
+
BUTTONSIZE
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
{
moveDownPage
();
}
event
->
accept
();
}
...
...
@@ -809,32 +805,3 @@ void UBSceneThumbnailNavigPixmap::moveDownPage()
{
UBApplication
::
documentController
->
moveSceneToIndex
(
proxy
(),
sceneIndex
(),
sceneIndex
()
+
1
);
}
void
UBSceneThumbnailNavigPixmap
::
notifyClick
(
QPointF
clickedScenePos
)
{
QPointF
p
=
clickedPos
(
clickedScenePos
);
// Here we check the position of the click and verify if it has to trig an action or not.
if
(
bCanDelete
&&
p
.
x
()
>=
0
&&
p
.
x
()
<=
BUTTONSIZE
/
2
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
/
2
)
{
deletePage
();
}
if
(
bCanMoveUp
&&
p
.
x
()
>=
(
BUTTONSIZE
+
BUTTONSPACING
)
/
2
&&
p
.
x
()
<=
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
/
2
)
{
moveUpPage
();
}
if
(
bCanMoveDown
&&
p
.
x
()
>=
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
x
()
<=
BUTTONSIZE
+
BUTTONSPACING
+
BUTTONSIZE
/
2
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
/
2
)
{
moveDownPage
();
}
}
QPointF
UBSceneThumbnailNavigPixmap
::
clickedPos
(
QPointF
clickedScenePos
)
{
QPointF
p
;
p
.
setX
(
clickedScenePos
.
x
()
-
scenePos
().
x
());
p
.
setY
(
clickedScenePos
.
y
()
-
scenePos
().
y
());
return
p
;
}
src/gui/UBThumbnailWidget.h
View file @
ead5cff1
...
...
@@ -292,7 +292,6 @@ class UBSceneThumbnailNavigPixmap : public UBSceneThumbnailPixmap
public
:
UBSceneThumbnailNavigPixmap
(
const
QPixmap
&
pix
,
UBDocumentProxy
*
proxy
,
int
pSceneIndex
);
~
UBSceneThumbnailNavigPixmap
();
void
notifyClick
(
QPointF
clickedScenePos
);
protected
:
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
...
...
@@ -305,7 +304,6 @@ class UBSceneThumbnailNavigPixmap : public UBSceneThumbnailPixmap
void
deletePage
();
void
moveUpPage
();
void
moveDownPage
();
QPointF
clickedPos
(
QPointF
clickedScenePos
);
bool
bButtonsVisible
;
bool
bCanDelete
;
...
...
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