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
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.
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
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
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
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
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
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
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
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
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
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
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
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
Summary: Move the error label to the results grid view, which fixes the layout of the TextField.
Test Plan: TextField and label are still visible if no search result is found.
Reviewers: #okular, ngraham
Reviewed By: ngraham
Subscribers: ngraham, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D21551
Summary: Port the drawer to QQC2
Test Plan: It still has the same features as before
Reviewers: #okular, ngraham
Reviewed By: ngraham
Subscribers: ngraham, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D21550
Summary:
Windows MSVC Qt5.11 build fails:
```
conversion from 'initializer list' to 'QSizeF' requires a narrowing conversion
```
Pass QSize, and let QSizeF Ctor `QSizeF(const QSize &)` do the conversion.
Test Plan: - build on Windows MSVC
Reviewers: aacid
Reviewed By: aacid
Subscribers: aacid, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D21543
Summary:
Use `LineAnnotPainter` to generate accurate icons.
Looks like this:
{F6852054}
Depends on D21248
Test Plan:
- open "Edit annotation tool" for straight line and check combo box items for start and stop style
- test on HiDPI
Reviewers: #okular, sander
Reviewed By: sander
Subscribers: davidhurka, knambiar, ngraham, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D21416
Summary:
This implements drawing the various line ending styles for 2 point lines in non-PDF documents.
Looks like this:
{F6833437}
CCBUG: 381629
Test Plan:
- open a *.txt document
- draw line annotations with different arrow styles: Square, Diamond, OpenArrow, ClosedArrow, ROpenArrow, RClosedArrow, Butt, Slash, Circle
- ... as start and as end style (start needs D21238 to be configurable in GUI)
- ... filled or not (fill color can't be configured in GUI yet)
- ... with different leader line settings
- ... at various angles
- rotate and scale page
- leader line with setting 100 gives 100 pixel line at 100% zoom (use kruler to verify)
Reviewers: #okular, aacid, sander
Reviewed By: sander
Subscribers: ngraham, sander, knambiar, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D21248
Summary:
“Inner Color” configuration of Polygon tool was overlapping with the line start/end styles intended for only Straight Line tool. Fix it.
CCBUG: 381629
Test Plan:
1. Configure annotations
2. Create/Edit Polygon tool
3. Observe that no Line Start/End styles are visible
4. Create/Edit Straight Line tool
5. Observe that line start/end styles can be configured
Reviewers: #okular, tobiasdeiminger
Reviewed By: tobiasdeiminger
Subscribers: tobiasdeiminger, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D21332
Summary:
The "<video></video>" tag is a placeholder, and should only be processed
when it has been inserted for this toc item, i.e. when movieAnnots is
non-empty. Also place the search cursor at the last inserted block,
otherwise the expression will search from the beginning of the document.
Do likewise for audio/soundActions.
This makes loading large documents much fasters, and even fixes crashing
on huge documents, e.g. from project Gutenberg "The Complete Works of
William Shakespeare" (3200 pages) or the "King James Bible" (1400 pages).
Test Plan: open a large EPub file (see above)
Reviewers: #okular, aacid
Reviewed By: #okular, aacid
Subscribers: aacid, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D20948