Using the new configuration key BuiltinAnnotationTools instead of AnnotationTools, we avoid any conflicts in the configuration files due to the fact that the key AnnotationTools had a different meaning in the previous versions of Okular. In particular we avoid the critical problem that the actions in the UI do not match the actual annotation tools. The conflict may happen if the kconf_update script is not executed for some reason (e.g. okular running from flatpack).
BUG: 425354
FIXED-IN: 1.11.1
find . \( -name "*.cpp" -or -name "*.h" -or -name "*.c" -or -name "*.cc" \) -exec clang-format -i {} \;
If you reached this file doing a git blame, please see README.clang-format (added 2 commits in the future of this one)
Create a new new annotation toolbar to replace the current one as discussed in the task T8076.
Fixes:
BUG: 386578
BUG: 374728
BUG: 352310
BUG: 330518
BUG: 341914
BUG: 157289
BUG: 358057
BUG: 412767
BUG: 413595
BUG: 420462
FIXED-IN: 1.11.0
Test Plan
Before testing this revision
Delete or Temporary move aside the following files:
~/.config/okularpartrc
~/.config/okularrc
~/.local/share/kxmlgui5/okular/part.rc
~/.local/share/kxmlgui5/okular/shell.rc
Nomenclature
Actions in the main toolbar:
Quick annotations
Actions in the annotation toolbar:
Annotation actions Highlighter, Underline, Squiggle, Strike out, Typewriter,
Inline note, Popup note, Freehand line, Arrow, Straight line, Rectangle, Ellipse,
Polygon, Stamp
Annotation config actions Line width, Color, Inner color, Opacity, Font, Annotation settings
Other actions Add to Quick Annotations, Pin
Autotests
First run: annotation toolbar is not visible
Selecting Tools > Annotations shows the annotation toolbar (below the main toolbar by default)
Select an annotation > toolbar is shown
Select a quick annotation > toolbar is shown
Hide action (red cross) on the toolbar hides the toolbar
Keys 1-9,0 select the (builtin) Annotation actions (one case tested)
Keys Alt+1-9,0 select the quick annotation actions (one case tested)
No annotation action selected: Quick Annotations is enabled, Add to quick annotations is disabled, Annotation config actions are disabled, Pin is enabled
The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled (also in Quick annotations)
The current document is protected: All actions are disabled
Select annotation: the Annotation config actions are enabled and their values set to the ones for the current annotation (taken from okularpartrc)
Click an annotation action when none selected: browse mode is selected
Click the currently selected annotation action: the action is unchecked and the tool disabled (back to browse mode)
Click ESC: the currently selected annotation action is unchecked
If Pin unchecked the selected annotation is unchecked after it has be used once and we are back to Browse mode
The annotation systems works when multiple Okular tabs are open (the selected annotation is per-tab)
Manual tests
(TODO) Check that kconf_update updates the key AnnotationTools to QuickAnnotationTools in ~/.config/okularpartrc
Color icon is a format-text-color (if inline note or typewriter) or format-stroke-color for all other annotations
All actions have tooltips (some change based on the fact that the icon is enabled or not)
If a custom Line Width or Opacity is set through the Annotation Settings dialog, its value appears as a new checked action in the Line width or Opacity menu
If a custom stamp is selected through the Annotation Settings dialog, its name or filename (without path) appears as a new checked action in the Stamp menu
In Configure Okular > Annotations it is only possible to configure the quick annotations. Modifying them here updates the Quick annotations list after clicking Apply
The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled in Quick annotations
The state of Pin action is remembered across Okular launches
Selecting a quick action selects the corresponding action and loads its config values (color, line width, ...)
Setting the color and fill color works for all annotations (to be tested carefully, can be problematic for typewriter and inline note given the different internal mechanism to store the color in the settings)
Test stamp annotation (handled differently from the rest of the annotations)
Merge Request: https://invent.kde.org/graphics/okular/-/merge_requests/105
Use jq to filter compile_commands.json to not include the compilation of
autogenerated files, we don't want to check those
Also filter out the synctex folder, since that is imported code
Since unfortunately some of the autogenerated includes don't pass the
checks we do a trick of building out of source and then specifying the
.*/okular/.* path as the only includes we care about
autotests/*, conf/* , mobile/* , shell/*, part.cpp, extension.cpp
The code compiles and all unit tests pass (except for the two that
fail on master too).
Default to speechd tts engine, but allow other choices from
okular settings.
Also add combobox to allow selecting the tts engine from config
dialog.
TODO: Change/update tts object when setting is changed.
Summary:
The config dialog of each annotation tool is now a form layout without group boxes. Everything is aligned.
Reviewers: #okular, #vdg, ngraham, aacid
Reviewed By: #okular, #vdg, ngraham, aacid
Subscribers: sander, davidhurka, aacid, okular-devel, knambiar, ngraham
Tags: #okular
Maniphest Tasks: T8076
Differential Revision: https://phabricator.kde.org/D10859
Summary: Similar to the line ending style, add support for line start style for the Straight Line annotation tool
Test Plan:
1. Go to Configure annotations
2. Create (or edit existing) Straight Line tool
3. Set the ‘Line Start’ option on Style and Apply
4. Use the Straight Line tool to draw a line and check the line starting style.
Reviewers: #okular, tobiasdeiminger
Reviewed By: tobiasdeiminger
Subscribers: ngraham, tobiasdeiminger, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D21238
Summary:
Poppler and Okular already have support for specifying Line End style (`TermStyle`) for the Straight Line tool. Expose the functionality in configuration and hook up the correct slots.
Configure annotations (before):
{F6788150}
Configure annotations (after):
{F6788151}
Straight Line tool with Open Arrow end in action:
{F6788153}
Test Plan:
1. Open a PDF in Okular
2. Enable Review
3. Right click on Review toolbar and Configure annotations
4. Create (or edit existing) Straight Line tool
5. Set the ‘Line End’ option on Style and Apply
6. Use the Straight Line tool to draw a line and check the line ending style.
Reviewers: #okular, #vdg, sander, ngraham
Reviewed By: #vdg, sander, ngraham
Subscribers: pino, sander, davidhurka, tobiasdeiminger, ngraham, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D20760
This patch makes switching presentation slides using touch screen taps
more flexible. It introduces a new configuration option
'Touch navigation' with three possible values:
* 'Tap left/right side to go back/forward':
Tapping on the left(right) half of the screen
makes the presentation go to the previous(next) slide.
* 'Tap anywhere to go forward':
Tapping on the screen makes the presentation go to the
next slide, no matter where the screen is being tapped
* 'Disabled':
Screen tapping doesn't do anything.
Previously, only 'Tap anywhere...' was implemented.
This patch does not change the behavior of mouse clicks.
Differential Revision: https://phabricator.kde.org/D18118
Summary:
Some people need it because it is now the default TeX editor in distributions.
BUG: 404120
Test Plan: "Settings -> Configure Okular... -> Editor -> TeXstudio". Should work for the reverse search if the tex file is compiled with \usepackage[active]{srcltx}
Reviewers: #okular, ngraham
Reviewed By: ngraham
Subscribers: ngraham, okular-devel, kde-doc-english
Tags: #okular, #documentation
Differential Revision: https://phabricator.kde.org/D19272
Summary:
This only depended on okularpart due to the export header used in the
kcfgc file, so use a dedicated one for the mobile components that doesn't
export anything.
This enables disabling the part build for mobile-only builds such as
Android, and thus removing the need for some difficult dependencies
like KParts.
Reviewers: aacid
Reviewed By: aacid
Subscribers: aacid, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D19037
Summary:
Changing typewriter text color can be done in the typewriter properties dialog, or programmatically via new okular API methods TextAnnotation::textColor and TextAnnotation::setTextColor.
poppler >= 0.69 is required to store text color natively inside PDF documents. For other document types, text color is stored as metadata inside the document archive.
This work was done during GSoC 2018. See https://community.kde.org/GSoC/2018/StatusReports/DileepSankhla for details.
Test Plan:
- properties dialog of typewriter annotation has "Font Color" picker
- saving to PDF results in <r> <g> <b> rg operation in /DA
- saving to archive results in fontColor="rrggbb" attribute in metadata.xml
Reviewers: sander
Reviewed By: sander
Subscribers: kde-doc-english, sander, okular-devel
Tags: #okular, #documentation
Differential Revision: https://phabricator.kde.org/D15205
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:
This is mainly preparation for D15204 (typewriter), where storing RGB won't be sufficient any longer.
Typewriter will need transparent background (alpha=0x00), which can only be expressed as ARGB string.
Current code handles name format identical for all annotations. It doesn't hurt to store all annotations in ARGB format, so instead of introducing special handling for typewriter, let's store all annotation color attributes as ARGB string.
Note: In case of previously existing okularpartrc, configuration will be reused without conversion. New color format will be written when new settings are saved. This has no bad effect.
Test Plan:
- when [Reviews] section in okularpartrc is initially generated, all annotation color attributes are in #AARRGGBB format
- saving into archive stores color with alpha channel (#AARRGGBB), for all kind of annotations
Reviewers: sander
Reviewed By: sander
Subscribers: dileepsankhla, sander, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D15279
Summary:
This patch enables HiDPI throughout the application
Every pixmap is multiplied by the devicePixelRatioF
QPainter code is ajusted to take the DPR value into account
All pixmaps get cached with the highest DPR of all screens. When moving the application to another screen, the cache doesn't have to be invalidated.
BUGS: 362856 383589
REVIEW: D6268
Summary:
BUG: 182994
Adds an option to the config dialog that enables background color (the color around the displayed page) to be changed (while by default preserving the Qt toolkit selection as not to affect existing users).
Reasons for this change:
Accessibility, eye strain, aesthetic reasons, color displayed on monitor can affect power consumption (how: depends on display technology).
Many people want this change occording to Bugzilla and other sources.
Maintenance: Nearly no additional maintenance:
This is no new subsystem but a trivial feature with no complex code dependencies, and we are already showing a colour selection dialog and setting colours in other places in Okular.
{F4257766}
Other less important information:
https://git.reviewboard.kde.org/r/130219/https://mail.kde.org/pipermail/okular-devel/2017-September/025520.html
Test Plan:
Tested everything, it all works:
Toggled the custom background color, changed custom background color, removed okular settings file (with: "rm ~/.config/okular*") to verify it uses the usual qt theme colour by default (where the settings file remembered the custom color).
Reviewers: #okular, aacid, elvisangelaccio, rkflx, ngraham
Reviewed By: ngraham
Subscribers: aacid, ltoscano, ngraham
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8051
Summary:
BUG: 182994
Adds an option to the config dialog that enables background color (the color around the displayed page) to be changed (while by default preserving the Qt toolkit selection as not to affect existing users).
Reasons for this change:
Accessibility, eye strain, aesthetic reasons, color displayed on monitor can affect power consumption (how: depends on display technology).
Many people want this change occording to Bugzilla and other sources.
Maintenance: Nearly no additional maintenance:
This is no new subsystem but a trivial feature with no complex code dependencies, and we are already showing a colour selection dialog and setting colours in other places in Okular.
{F4257766}
Other less important information:
https://git.reviewboard.kde.org/r/130219/https://mail.kde.org/pipermail/okular-devel/2017-September/025520.html
Test Plan:
Tested everything, it all works:
Toggled the custom background color, changed custom background color, removed okular settings file (with: "rm ~/.config/okular*") to verify it uses the usual qt theme colour by default (where the settings file remembered the custom color).
Reviewers: #okular, aacid, elvisangelaccio, rkflx, ngraham
Reviewed By: ngraham
Subscribers: aacid, ltoscano, ngraham
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8051