Find a file
Tobias Deiminger 0957abc39a Add annotation resize functionality
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.

Feature is only applicable for annotation types AText, AStamp and AGeom.

Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.

Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.

Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)

Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed

Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.

Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".

REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060
2017-03-19 23:18:17 +01:00
autotests Remove dependency on KActivities on Windows. 2017-03-18 01:58:47 +01:00
cmake/modules Support SetOCGState links 2016-11-26 16:00:46 +01:00
conf Allow to disable automatic search while typing 2017-03-14 00:31:42 +01:00
core Add annotation resize functionality 2017-03-19 23:18:17 +01:00
doc replace common settings + help menu items with link to fundamentals 2016-11-29 02:22:59 +01:00
generators Add annotation resize functionality 2017-03-19 23:18:17 +01:00
interfaces Fix build with MinGW on Windows. 2016-03-16 10:57:34 +01:00
mobile Add override 2017-03-02 20:38:50 +01:00
shell Remove dependency on KActivities on Windows. 2017-03-18 01:58:47 +01:00
ui Add annotation resize functionality 2017-03-19 23:18:17 +01:00
.gitignore Add .gitignore 2014-09-17 23:55:42 +02:00
.krazy synctex is "external code", make krazy stay away from it 2010-02-08 23:15:24 +00:00
aboutdata.h I don't consider myself the maintainer 2017-02-08 20:23:38 +01:00
AUTHORS oKular goes poppler 2006-03-19 18:03:43 +00:00
CMakeLists.txt Add annotation resize functionality 2017-03-19 23:18:17 +01:00
config-okular.h.cmake Drop libkscreen dependency 2016-01-30 18:15:07 +01:00
COPYING - MERGE KPDF 3.5 CHANGES 2005-11-04 11:59:51 +00:00
COPYING.DOC Add copies of the GFDL-1.2 and LGPL-2 2011-07-07 18:22:06 +02:00
COPYING.LIB Add copies of the GFDL-1.2 and LGPL-2 2011-07-07 18:22:06 +02:00
extensions.cpp Fix build without implicit cast to/from ascii 2016-07-11 22:11:43 +02:00
extensions.h Add override 2017-03-02 20:38:50 +01:00
kdocumentviewer.h Merge remote-tracking branch 'origin/master' into frameworks 2015-08-03 09:44:50 +02:00
Mainpage.dox Merge remote-tracking branch 'origin/master' into frameworks 2016-10-29 11:13:24 +02:00
Messages.sh Make the drawing tools be actions instead of tool buttons 2015-08-22 22:17:40 +02:00
metainfo.yaml dox: the 'interfaces' subdir contains public API as well 2016-12-04 19:04:53 +01:00
okular.categories Add logging categories file for kdebugsettings 2016-01-03 09:13:06 +01:00
okular.upd Separate settings in core and non core 2012-10-16 00:28:29 +02:00
Okular5Config.cmake.in Install Okular5Config.cmake instead of OkularConfig.cmake 2015-07-20 14:17:38 +01:00
okular_part.desktop SVN_SILENT made messages (.desktop file) 2014-12-26 04:18:45 +00:00
OkularConfigureChecks.cmake SVN_SILENT simplify 2007-11-25 14:10:18 +00:00
part-viewermode.rc Add "Trim To Selection" feature 2015-08-27 22:09:02 +02:00
part.cpp Avoid warning when opening GotoPageDialog 2017-02-03 00:29:43 +01:00
part.h Q_DECL_OVERRIDE -> override 2017-03-02 20:39:24 +01:00
part.rc Add "Trim To Selection" feature 2015-08-27 22:09:02 +02:00
README.internals.png Optimize PNG files again. 2008-01-02 00:10:07 +00:00
TODO Fix some typos found by Krazy2 2013-06-24 13:46:16 +03:00