Summary:
Typewriter is originally specified by the PDF reference as special FreeText annotation, where Intent=FreeTextTypewriter. It features opaque letters on transparent background, so that users can fill non interactive forms. Herewith typewriter is implemented natively for PDF, and there's also an Okular specific implementation for other document types. The added tool reuses the inline note UI.
This work was done during GSoC 2018. See https://community.kde.org/GSoC/2018/StatusReports/DileepSankhla for details.
FEATURE: 353401
Test Plan:
- okularpartrc is generated (if not yet existing) with typewriter as 10th tool
- typewriter tool is also available in Annotation Tools -> Add, Typ "Typewriter"
- selecting the tool and left click into document opens inline note input dialog
- finishing creates an annotation similar to inline note, but with transparent background
- saving into PDF results in /Subtype FreeText /IT /FreeTextTypeWriter
- saving typewriter into archive stores color with alpha channel = 0x00
- opening annotated archive works, if archive was created with old Okular, and opened in patched Okular
- opening annotated archive works, if archive was created with patched Okular, and opened in old Okular
Reviewers: sander
Reviewed By: sander
Subscribers: ngraham, sander, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D15204
Summary:
When hovering the mouse over the X symbol to close a note the cursor remains the same of the current shape (hand, selection cursor) based on the tool selected.
This patch morphe the cursor to the standard arrow over the X symbol to close a note by adding setCursor() call in the CloseButton constructor
BUG: 384381
Test Plan:
1. Open okular and select Tools -> Review or press F6 to create a new pop-up note
2. Hover the mouse cursor over the close button (X) of the pop-up note window
3. You will see the standard arrow instead of the current tool based cursor.
Screenshot below (the tooltip saying "Close this note" was not captured by Spectacle application)
{F5685539}
Reviewers: #okular, ngraham
Reviewed By: ngraham
Subscribers: ngraham, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D10209
How does it work:
* What it does is really closing and opening the file again through poppler
* This means that things that are generated in "open" time like Page, Rects, Annotations, Forms need to be updated
* For Page what we do is swap the PagePrivate so that other classes that hold Page* don't break
* Since some parts of the PagePrivate can be reused, we move them in PagePrivate::adoptGeneratedContents
* For all the commands in the undo stack we need to update the annotations/forms it refers to, added a new function to do that
* The annotationmodel needs updating it's pointers
* The widgets for the forms are reused and their form* updated
* the widgets for the videos are recreased since videos don't really hold much content (you lose the playing status on save but i think that's acceptable)
TODO: Make this work for .okular files
TODO: For files with password we will need to reload the file, asking for the password again and thus losing the undo stack, warn the user
TODO: autotests
Drops the x11 fallback. We were falling back to QX11Extras that were in
fact using QScreen internally.
Also remove the QDesktopWidget fallbacks for the same reason.
Drops some API for fetching the dpi and unifies it with ::realDpi(QWidget).
Based on Sebas's patch.
Reviewed by Albert.
REVIEW: 126913
We need
disconnect(textEdit, SIGNAL(cursorPositionChanged()), this,SLOT(slotsaveWindowText()));
and it's counterpart, otherwise when inserting the image, the cursor pos changes, slotsaveWindowText is called, the content is passed by a toPlainText and set again and kaboom the content is lost
Also a few extra const
BUGS: 335476
FIXED-IN: 4.14.2
Modification and removal of *external* annotations are disabled by this
patch. Note that this change doesn't remove any functionality, because they
have never been implemented (AnnotationProxy is defined by the previous
patch).
The #if0'd blocks will be enabled by a future patch that provides fallback
behavior for generators that don't support saving changes.
* We do not keep them around any more time than needed (they are cheap to create)
* AnnotWindow::slotsaveWindowText calls m_document->modifyPageAnnotation so
edition of inline notes happens immediately