Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Okular
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joao Oliveira
Okular
Commits
f4d70641
Commit
f4d70641
authored
Jul 04, 2019
by
Oliver Sander
Committed by
Albert Astals Cid
Aug 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn cursor to cross-hair when stylus is near the screen
parent
4f297e34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
ui/presentationwidget.cpp
ui/presentationwidget.cpp
+28
-0
ui/presentationwidget.h
ui/presentationwidget.h
+3
-0
No files found.
ui/presentationwidget.cpp
View file @
f4d70641
...
...
@@ -283,6 +283,9 @@ PresentationWidget::PresentationWidget( QWidget * parent, Okular::Document * doc
// setFocus() so KCursor::setAutoHideCursor() goes into effect if it's enabled
setFocus
(
Qt
::
OtherFocusReason
);
// Catch TabletEnterProximity and TabletLeaveProximity events from the QApplication
qApp
->
installEventFilter
(
this
);
}
PresentationWidget
::~
PresentationWidget
()
...
...
@@ -312,6 +315,8 @@ PresentationWidget::~PresentationWidget()
// delete frames
qDeleteAll
(
m_frames
);
qApp
->
removeEventFilter
(
this
);
}
...
...
@@ -531,6 +536,29 @@ void PresentationWidget::setPlayPauseIcon()
}
}
bool
PresentationWidget
::
eventFilter
(
QObject
*
o
,
QEvent
*
e
)
{
if
(
o
==
qApp
)
{
if
(
e
->
type
()
==
QTabletEvent
::
TabletEnterProximity
)
{
setCursor
(
QCursor
(
Qt
::
CrossCursor
)
);
}
if
(
e
->
type
()
==
QTabletEvent
::
TabletLeaveProximity
)
{
if
(
Okular
::
Settings
::
slidesCursor
()
==
Okular
::
Settings
::
EnumSlidesCursor
::
Visible
)
{
setCursor
(
QCursor
(
Qt
::
ArrowCursor
)
);
}
else
{
setCursor
(
QCursor
(
Qt
::
BlankCursor
)
);
}
}
}
return
false
;
}
// <widget events>
bool
PresentationWidget
::
event
(
QEvent
*
e
)
{
...
...
ui/presentationwidget.h
View file @
f4d70641
...
...
@@ -74,6 +74,9 @@ class PresentationWidget : public QWidget, public Okular::DocumentObserver
void
leaveEvent
(
QEvent
*
e
)
override
;
bool
gestureEvent
(
QGestureEvent
*
e
);
// Catch TabletEnterProximity and TabletLeaveProximity events from the QApplication
bool
eventFilter
(
QObject
*
o
,
QEvent
*
ev
)
override
;
private:
const
void
*
getObjectRect
(
Okular
::
ObjectRect
::
ObjectType
type
,
int
x
,
int
y
,
QRect
*
geometry
=
nullptr
)
const
;
const
Okular
::
Action
*
getLink
(
int
x
,
int
y
,
QRect
*
geometry
=
nullptr
)
const
;
...
...
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