Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Andi Sardina Ramos
Okular
Commits
db5522e1
Commit
db5522e1
authored
Sep 15, 2003
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now we can move page with mouse
svn path=/trunk/kdegraphics/kpdf/; revision=251251
parent
7178b231
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
9 deletions
+29
-9
kpdf/kpdf_pagewidget.cc
kpdf/kpdf_pagewidget.cc
+28
-8
kpdf/kpdf_pagewidget.h
kpdf/kpdf_pagewidget.h
+1
-1
No files found.
kpdf/kpdf_pagewidget.cc
View file @
db5522e1
...
...
@@ -46,7 +46,12 @@ namespace KPDF
{
if
(
m_doc
==
0
)
return
;
if
(
e
->
button
()
&
RightButton
)
if
(
e
->
button
()
&
LeftButton
)
{
m_dragGrabPos
=
e
->
globalPos
();
setCursor
(
sizeAllCursor
);
}
else
if
(
e
->
button
()
&
RightButton
)
{
emit
rightClick
();
}
...
...
@@ -60,22 +65,37 @@ namespace KPDF
if
(
m_doc
==
0
)
return
;
if
(
e
->
button
()
&
LeftButton
)
{
setCursor
(
arrowCursor
);
}
else
{
LinkAction
*
action
=
m_doc
->
findLink
(
e
->
x
()
/
m_ppp
,
e
->
y
()
/
m_ppp
);
if
(
action
==
m_pressedAction
)
emit
linkClicked
(
action
);
m_pressedAction
=
0
;
}
}
void
PageWidget
::
contentsMouseMoveEvent
(
QMouseEvent
*
e
)
{
if
(
m_doc
==
0
)
return
;
if
(
e
->
state
()
&
LeftButton
)
{
QPoint
delta
=
m_dragGrabPos
-
e
->
globalPos
();
scrollBy
(
delta
.
x
(),
delta
.
y
()
);
m_dragGrabPos
=
e
->
globalPos
();
}
else
{
LinkAction
*
action
=
m_doc
->
findLink
(
e
->
x
()
/
m_ppp
,
e
->
y
()
/
m_ppp
);
setCursor
(
action
!=
0
?
Qt
::
PointingHandCursor
:
Qt
::
ArrowCursor
);
}
}
void
PageWidget
::
drawContents
(
QPainter
*
p
,
int
clipx
,
int
clipy
,
int
clipw
,
int
cliph
)
{
...
...
kpdf/kpdf_pagewidget.h
View file @
db5522e1
...
...
@@ -79,7 +79,7 @@ namespace KPDF
ZoomMode
m_zoomMode
;
int
m_currentPage
;
QPoint
m_dragGrabPos
;
LinkAction
*
m_pressedAction
;
};
}
...
...
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