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
72532068
Commit
72532068
authored
13 years ago
by
shibakaneki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
3bfc3ceb
5761ddb0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
68 deletions
+29
-68
UBDocumentController.cpp
src/document/UBDocumentController.cpp
+2
-3
UBGraphicsTextItemDelegate.cpp
src/domain/UBGraphicsTextItemDelegate.cpp
+6
-4
UBDockPalette.cpp
src/gui/UBDockPalette.cpp
+1
-1
UBDocumentNavigator.cpp
src/gui/UBDocumentNavigator.cpp
+3
-6
UBLibPathViewer.cpp
src/gui/UBLibPathViewer.cpp
+1
-1
UBResources.cpp
src/gui/UBResources.cpp
+1
-2
UBResources.h
src/gui/UBResources.h
+0
-1
UBThumbnailWidget.cpp
src/gui/UBThumbnailWidget.cpp
+15
-48
UBThumbnailWidget.h
src/gui/UBThumbnailWidget.h
+0
-2
No files found.
src/document/UBDocumentController.cpp
View file @
72532068
...
...
@@ -1150,11 +1150,10 @@ void UBDocumentController::moveSceneToIndex(UBDocumentProxy* proxy, int source,
UBMetadataDcSubsetAdaptor
::
persist
(
proxy
);
refreshDocumentThumbnailsView
();
// NOTE [Didier]: I think that selecting the thumbnail is not the role of the documentController
mDocumentUI
->
thumbnailWidget
->
selectItemAt
(
target
);
// Notify the move to anyone interested in knowing it
emit
movedToIndex
(
target
);
UBApplication
::
boardController
->
setActiveDocumentScene
(
proxy
,
target
);
}
...
...
This diff is collapsed.
Click to expand it.
src/domain/UBGraphicsTextItemDelegate.cpp
View file @
72532068
...
...
@@ -305,10 +305,11 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta)
bool
bEndofTheSameBlock
;
int
iBlockLen
;
int
iPointSize
;
int
i
new
PointSize
;
int
i
Next
PointSize
;
int
iCursorPos
=
startPos
;
// we search continuous blocks of the text with the same PointSize and allpy new settings for them.
cursor
.
setPosition
(
startPos
,
QTextCursor
::
MoveAnchor
);
while
(
iCursorPos
<
endPos
)
{
bEndofTheSameBlock
=
false
;
...
...
@@ -326,17 +327,18 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta)
iBlockLen
++
;
cursor
.
setPosition
(
iCursorPos
+
iBlockLen
+
1
,
QTextCursor
::
KeepAnchor
);
i
new
PointSize
=
cursor
.
charFormat
().
font
().
pointSize
();
i
Next
PointSize
=
cursor
.
charFormat
().
font
().
pointSize
();
cursor
.
setPosition
(
iCursorPos
+
iBlockLen
,
QTextCursor
::
KeepAnchor
);
if
((
iPointSize
!=
i
new
PointSize
)
||
(
iCursorPos
+
iBlockLen
>=
endPos
))
if
((
iPointSize
!=
i
Next
PointSize
)
||
(
iCursorPos
+
iBlockLen
>=
endPos
))
bEndofTheSameBlock
=
true
;
}
while
(
!
bEndofTheSameBlock
);
//setting new parameners
curFont
.
setPointSize
(
iPointSize
+
delta
);
int
iNewPointSize
=
iPointSize
+
delta
;
curFont
.
setPointSize
(
(
iNewPointSize
>
0
)
?
iNewPointSize
:
1
);
textFormat
.
setFont
(
curFont
);
cursor
.
mergeCharFormat
(
textFormat
);
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBDockPalette.cpp
View file @
72532068
...
...
@@ -697,7 +697,7 @@ void UBDockPalette::moveTabs()
void
UBDockPalette
::
resizeTabs
()
{
int
numTabs
=
mTabWidgets
.
size
();
mTabPalette
->
res
ize
(
2
*
border
(),
(
numTabs
*
TABSIZE
)
+
qMax
(
numTabs
-
1
,
0
)
*
tabSpacing
());
mTabPalette
->
setFixedS
ize
(
2
*
border
(),
(
numTabs
*
TABSIZE
)
+
qMax
(
numTabs
-
1
,
0
)
*
tabSpacing
());
}
QRect
UBDockPalette
::
getTabPaletteRect
()
{
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBDocumentNavigator.cpp
View file @
72532068
...
...
@@ -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
);
}
/**
...
...
@@ -448,7 +444,8 @@ void UBDocumentNavigator::onMovedToIndex(int index)
UBSceneThumbnailNavigPixmap
*
pItem
=
dynamic_cast
<
UBSceneThumbnailNavigPixmap
*>
(
mThumbnails
.
at
(
index
));
if
(
NULL
!=
pItem
)
{
mCrntItem
=
pItem
;
if
(
mCrntItem
)
mCrntItem
->
setSelected
(
false
);
//deselecting previous one
mCrntItem
=
pItem
;
mCrntItem
->
setSelected
(
true
);
centerOn
(
mCrntItem
);
}
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBLibPathViewer.cpp
View file @
72532068
...
...
@@ -284,7 +284,7 @@ void UBLibPathViewer::showBack()
if
(
NULL
!=
pLastElem
)
{
mpBackElem
->
setPath
(
pLastElem
->
element
()
->
path
());
mpBackElem
->
setType
(
eUBLibElementType_Folder
);
mpBackElem
->
setType
(
pLastElem
->
element
()
->
type
()
);
mpBackElem
->
setName
(
pLastElem
->
element
()
->
name
());
}
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBResources.cpp
View file @
72532068
...
...
@@ -51,7 +51,6 @@ void UBResources::init()
// Cursors
penCursor
=
QCursor
(
Qt
::
CrossCursor
);
eraserCursor
=
QCursor
(
QPixmap
(
":/images/cursors/eraser.png"
),
21
,
21
);
magnifierCursor
=
QCursor
(
QPixmap
(
":/images/cursors/magnifier.png"
),
9
,
9
);
markerCursor
=
QCursor
(
QPixmap
(
":/images/cursors/marker.png"
),
3
,
30
);
pointerCursor
=
QCursor
(
QPixmap
(
":/images/cursors/laser.png"
),
2
,
1
);
handCursor
=
QCursor
(
Qt
::
OpenHandCursor
);
...
...
@@ -60,5 +59,5 @@ void UBResources::init()
arrowCursor
=
QCursor
(
Qt
::
ArrowCursor
);
textCursor
=
QCursor
(
Qt
::
ArrowCursor
);
rotateCursor
=
QCursor
(
QPixmap
(
":/images/cursors/rotate.png"
),
16
,
16
);
drawLineRulerCursor
=
QCursor
(
QPixmap
(
":/images/cursors/drawRulerLine.png"
),
3
,
12
);
drawLineRulerCursor
=
QCursor
(
QPixmap
(
":/images/cursors/drawRulerLine.png"
),
3
,
12
);
}
This diff is collapsed.
Click to expand it.
src/gui/UBResources.h
View file @
72532068
...
...
@@ -37,7 +37,6 @@ class UBResources : public QObject
QCursor
penCursor
;
QCursor
eraserCursor
;
QCursor
magnifierCursor
;
QCursor
markerCursor
;
QCursor
pointerCursor
;
QCursor
handCursor
;
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBThumbnailWidget.cpp
View file @
72532068
...
...
@@ -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
;
}
This diff is collapsed.
Click to expand it.
src/gui/UBThumbnailWidget.h
View file @
72532068
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
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