Commit graph

8437 commits

Author SHA1 Message Date
João Netto ad858267d1 Implemented display support and updated dependencies to Poppler > 0.79
Moved executeScript to document private and support to display options for JavaScript
2019-07-20 12:06:12 +02:00
João Netto 552e4a3917 Added support for buttonSetIcon and buttonGetIcon.
Added support for the setIcon/getIcon defined in Poppler > 0_78
2019-07-20 12:05:37 +02:00
João Netto f3c8bb9299 Changed button code to be transparent when there's no text. 2019-07-20 12:04:59 +02:00
João Netto 7555212d29 Implemented the getOCGs and OCGs methods to support layer changing by JavaScript.
Implemented more unit tests to cover the OCGs
2019-07-20 12:04:59 +02:00
João Netto cc10164d34 Implemented initial support for animatedPDF
When refreshing, widgets must check if they should be visible

Implemented unit tests to the JavaScript functions.
2019-07-20 12:04:45 +02:00
Albert Astals Cid a01a04ec7f Merge remote-tracking branch 'origin/Applications/19.08' 2019-07-18 00:45:55 +02:00
Albert Astals Cid 327a66648b Add linux testing CI 2019-07-17 22:39:21 +02:00
Albert Astals Cid 98dfbdc8f4 Merge remote-tracking branch 'origin/Applications/19.08' 2019-07-17 22:36:14 +02:00
Albert Astals Cid a797d2aeb9 parttest: Move calculating the width/height to a bit later
Seems to make tests more stable
2019-07-17 22:35:28 +02:00
Albert Astals Cid 3430081ac6 Merge remote-tracking branch 'origin/Applications/19.08' 2019-07-17 21:58:14 +02:00
Oliver Sander 8e1d9aa480 Fix page boundary gradients on scaled displays
The code that draws a thin gradient at the right and bottom
boundaries of a page implicitly assumed that the display was
not scaled, i.e., that logical pixel where identical to
physical pixels.  Nobody really noticed because that gradient
was so thin.  Anyway, this patch fixes the gradient for
scaled displays.

I considered using a QLinearGradient, but decided against it:
The code would have been longer, and the manual code in the
patch can exploit the fact that all lines are horizontal
or vertical.  Therefore, expensive scan-conversion can be
avoided.
2019-07-17 19:46:59 +00:00
Oliver Sander a0bd9c4d1c Make the page outline one physical pixel wide
Pages get a black rectangle around them as 'outline' after
being rendered.  This rendering was not pixel-perfect at
fractional scalings: apparently, fractional line widths and
positions get rounded differently.  The result was that
sometimes there was a small gap between outline and page.

This pages fixes the problem by making the pen for the
outline 'cosmetic', i.e., one physical pixel wide.
With that, its position can be such that it encloses
the page without any gap.
2019-07-17 19:46:59 +00:00
Oliver Sander 9b34bfb45e Make page boundary rendering more robust
Okular renders a simple 'shadow' at the right and the bottom of each
page.  The code for this is a bit fragile:  After the page is rendered,
Okular paints a black outline, and then the shadow.  The shadow is
a hand-implemented gradient, painted line by line.  Finally, the
remaining area is painted in the background color.  No pixel is
ever touched twice.  Unfortunately, the code is buggy, and in hidpi /
fractional scaling situations, some pixels are never touched.
This results in rendering glitches as reported in

  https://bugs.kde.org/show_bug.cgi?id=383943

Instead of trying to fix the previous approach, this patch makes the
code more robust by changing the order of the painting operations.
After painting the page, the code now first paints the background,
which is now enlarged to cover everything off the page.  Finally,
the black outline and shadow are drawn on the previously drawn
background.  This makes sures that no pixel is ever left uninitialized.
It also allows to simplify the shadow drawing operation a bit.

BUG: 383943
2019-07-17 19:46:59 +00:00
Oliver Sander f681fb0eb2 Use range-based for to iterate over a QRegion
According to

  https://doc.qt.io/qt-5/qregion-obsolete.html#rects

the method QRegion::rects is obsolete and should be avoided.
Let's do that by moving to a range-based for over the QRegion.
That is easier to read anyway.
2019-07-17 19:46:59 +00:00
Yuri Chornoivan c510540ca2 Merge branch 'Applications/19.08' 2019-07-17 18:01:43 +03:00
Yuri Chornoivan 1918601611 Add docs about the 'Open Containing Folder' menu item 2019-07-17 18:00:48 +03:00
Nate Graham 911a8f7795 Merge branch 'Applications/19.08' 2019-07-17 08:35:18 -06:00
Nate Graham ea0ea9c93d Add "Open Containing Folder" feature
Summary:
This patch adds an "Open Containing Folder" menu item to the file menu, similar to
other KDE apps like Gwenview that have it there. This action is especially useful
for the case when you've downloaded a PDF from the internet that opens itself in
Okular. The location of this file may not be clear or easy to find without this
feature, and on several occasiona I have found myself wishing for it when this
happens.

Test Plan:
- Delete or move aside `~/.local/config/kxmlgui5/okular/part.rc`
- Menu item is enabled and works when there is an open document: {F6940449, size=full}
- Menu item is disabled when there is no open document: {F6940448, size=full}

Reviewers: #okular, aacid, sander

Reviewed By: #okular, aacid

Subscribers: shubham, davidhurka, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D22145
2019-07-17 08:35:09 -06:00
Albert Astals Cid aec76a6752 GIT_SILENT Upgrade KDE Applications version to 19.11.70. 2019-07-15 21:43:08 +02:00
Albert Astals Cid 24e66a250b GIT_SILENT Upgrade KDE Applications version to 19.07.80. 2019-07-15 21:21:18 +02:00
Oliver Sander 73e56ff032 Fix copy'n'paste bug in inline comment 2019-07-14 21:03:35 +00:00
Yuri Chornoivan e7ead0d3f5 Fix EBN issues 2019-07-14 10:15:45 +03:00
Albert Astals Cid 10cfe6c23e Increase cmake requirement to 3.5
It's what KF5 uses since a while and we kind of agreed it was old-enough
looking at https://repology.org/metapackage/cmake/badges
2019-07-04 19:45:51 +02:00
Albert Astals Cid 642f14ac27 Add a Ubuntu 18.04 CI
It matches quite well our min Qt and KF5 requirements
2019-07-04 00:55:27 +02:00
Albert Astals Cid 5e6649c3b1 Increase Qt deendency to Qt 5.9
It's LTS and reading https://repology.org/project/qt5/badges it's not
like many distros ship Qt 5.8 anyway
2019-07-04 00:40:56 +02:00
Albert Astals Cid 2e4212ad80 Partially revert "Fix two easy deprecation warnings"
QFontMetrincs::horizontalAdvance is only available in Qt 5.11

This reverts commit 69ec17554a.
2019-07-04 00:31:15 +02:00
Albert Astals Cid ec51b2f02f Remove QFontDatabase::supportsThreadedFontRendering checks
We require Qt 5.8 and there (and up) it returns true unconditionally and
it's now marked as deprecated
2019-07-04 00:09:04 +02:00
Albert Astals Cid 69ec17554a Fix two easy deprecation warnings
width -> horizontalAdvance

background -> window
2019-07-04 00:06:19 +02:00
Albert Astals Cid f1ba0d297f Merge remote-tracking branch 'origin/Applications/19.04' 2019-07-03 00:19:08 +02:00
Albert Astals Cid cf7d847a33 Fix saving "don't show again" when not using frameworksintegration
When not using frameworks integration we only get "false" in
shouldBeShownYesNo when the saved value is yes/no so set it to yes.

Also it was a bit weird before because we were using an uninitialized
value, so this is much better :)

BUGS: 409430
2019-07-03 00:18:07 +02:00
l10n daemon script 16e30bd2e8 GIT_SILENT made messages (after extraction) 2019-06-25 07:24:33 +02:00
l10n daemon script fe12cf5958 GIT_SILENT made messages (after extraction) 2019-06-25 03:00:23 +02:00
Yuri Chornoivan a80702f00a Add descriptions for the annotation tools new properties, update screenshots 2019-06-24 13:51:16 +03:00
Simone Gaiarin a33cb321df Improve layout of annotation configuration dialogs
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
2019-06-24 07:36:21 +02:00
Bhushan Shah 0991819a49 Don't hide the mobile app
otherwise it doesn't get shown on Plasma Mobile as well, most
distribution doesn't enable mobile app or splits it in seperate package
so this should not be problem
2019-06-23 09:36:47 +00:00
Oliver Sander 19f22098e6 Mind the devicePixelRatio when drawing on-screen in presentation mode
Previously, when using a screen scaling factor larger than 1, the
drawings by mouse or stylus in presentation mode were slightly blocky.
The underlying cause was
a) a few integer types used for non-integer coordinates
b) the intermediate use of a QPixmap without the correct
   devicePixelRatio

Additionally, this patch uses a QPainterPath to draw the path,
rather than a sequence of individual lines.  This improves
the line quality a tiny bit, because the lines are properly
joined.

BUG: 384143

Differential Revision: https://phabricator.kde.org/D21836
2019-06-22 21:55:30 +02:00
Dr. David Alan Gilbert f4a883ea5d Partial fix for high res displays
Summary:
On high res displays we end up using
the tile manager on single pages, that doesn't work
(for reasons that aren't yet clear) - but it
doesn't make sense if we most of the page anyway.

BUG: 401339

Reviewers: #okular, aacid

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20882
2019-06-22 16:43:20 +02:00
Albert Astals Cid 073f50cab8 Merge remote-tracking branch 'origin/Applications/19.04' 2019-06-22 12:40:20 +02:00
Albert Astals Cid 3c5b9b6f81 Fix compile with older poppler 2019-06-22 12:39:42 +02:00
Albert Astals Cid ea2a7b264f PDF: Finish support for Optional Content state change links
I implemented this 3 years ago, but for some reason forgot to commit this part ^_^

CCBUGS: 408849
2019-06-22 12:36:33 +02:00
Albert Astals Cid f3f7ca79fc Fix crash for rects that don't have an action
It shouldn't really happen, but in some cases it does, so be protective

BUGS: 408849
2019-06-22 12:35:17 +02:00
Laurent Montel a262fa194d Install in new logging directory when we use kf5 5.59.0 2019-06-12 06:58:00 +02:00
Jonah Brüchert c1b396af3e
mobile: fully port to QQC2
Summary: Remove all QtQuick Controls 1 imports and replace by QtQuick Controls 2

Test Plan: The mobile app behaves just as before

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: ngraham, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21675
2019-06-10 20:59:15 +02:00
Alexander Volkov 3311ba3a67 Use lambdas instead of QSignalMapper
Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D17481
2019-06-10 14:07:55 +03:00
Noah Davis 2c39981b21 Change Text Selection icon to edit-select-text
Summary:
The current icon (draw-text) is semantically incorrect. This patch makes the Text Selection tool use the icons added in D21632.

BUG: 408391
FIXED-IN: 1.8.0

Test Plan: {F6874885, size=full}

Reviewers: #vdg, #okular, ngraham

Reviewed By: #vdg, ngraham

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21633
2019-06-06 14:58:40 -04:00
Noah Davis 9310bed616 Change Browse icon back to the hand shape
Summary: I changed the `input-mouse` icon so that it would look more like a real mouse. In order to keep the proper icon for the Browse tool, I have to change the icon to `transform-browse`.

Test Plan: {F6874739, size=full}

Reviewers: #okular, #vdg, ngraham

Reviewed By: #vdg, ngraham

Subscribers: ngraham, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21630
2019-06-06 13:48:05 -04:00
Nate Graham e84733549d In Toolbar's selection mode menu, show "Text Selection" tool by default
Summary:
Currently, the Toolbar's selection mode menu shows the rectangular selection mode
by default, which is not the most useful or commonly used selection mode.

This patch makes the Text Selection tool the one that's shown by default, since that's
the kind of selection that's the most useful given the sort of document that Okular
is typically used to view.

Test Plan:
- Delete `~/.config/okularrc` and `~/.config/okularpartrc`
- Open Okular
- See that the selection mode toolbar button shows Text Selection by default:
{F6874497, size=full}

Reviewers: #okular, #vdg, ndavis

Reviewed By: #vdg, ndavis

Subscribers: ndavis, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21624
2019-06-06 11:26:15 -06:00
Nate Graham c792444550 Use a more conventional dropdown menu style instead of press-and-hold
Summary:
Currently, `ToolAction` menus (of which there is only one, the selection tool menu)
activate the current tool on click, and require a click-and-hold to choose a new tool.
This is a somewhat unfamiliar user interface that I myself struggled with when initially
encountering it, and I've encountered user complaints about it as well.

This patch adjusts the behavior so that clicking on the arrow on the right side of the
button will open the pop-up and allow choosing another tool, which is a more common
method of implementing the feature. The patch also adjusts the tooltop accordingly.

Test Plan: {F6874466, size=full}

Reviewers: #okular, #vdg, ndavis

Reviewed By: #vdg, ndavis

Subscribers: ndavis, abetts, filipf, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21622
2019-06-06 11:40:02 -06:00
Nate Graham c325cb4161 Regularize tool names
Summary:
Currently, some of the items in the {nav Tools} menu have "tool" in the name, and some
do not. This is in any event redundant since they're in a menu with that word in it
already. In the toolbar, these actions become more inconsistent since their names change
and can even differ between what's shown in the pop-up menu and what's shown on the
button text.

This patch regularizes the names, stops changing the names for the toolbar versions, and
updates the docbook accordingly.

Test Plan:
{F6874459, size=full}

{F6874458, size=full}

Reviewers: #okular, #vdg, filipf

Reviewed By: #vdg, filipf

Subscribers: filipf, okular-devel, kde-doc-english

Tags: #okular, #documentation

Differential Revision: https://phabricator.kde.org/D21621
2019-06-06 09:12:14 -06:00
Yuri Chornoivan e49742e0f8 Remove a note on line endings (they can be used for non-PDF files now) 2019-06-04 10:20:37 +03:00