Summary:
This replaces ToolAction by a near-drop-in replacement named ToggleActionMenu. The new annotation toolbar already uses this (D15580).
Unlike ToolAction, ToggleActionMenu inherits from KActionMenu to be more flexible.
* Menu can be set from outside, not hard coded.
* Default action for toolbar button is controllable from outside. (Theoretically, the button could trigger //anything// now.)
* KActionMenu instead of KSelectAction:
- Pluggable in other menus, thus called “Menu”.
- Doesn’t make the actions exclusive, so //any// actions can be added to the menu.
* ImplicitDefaultAction mode can choose the default action of the toolbar buttons automatically, by looking for the first checked action in the menu.
Toolbar buttons use the default action //of// this menu, not this menu itself as action.
Because the default action is configurable now, D21622 and D21635 (where we tried to fine-tune ToolAction) become obsolete.
Screenshot:
Everything like before, here with mouse_selecttool added to Tools menu to show submenu capability.
{F6884228}
Test Plan:
ToolAction replacement and ImplicitDefaultAction mode:
* Open Okular and look at toolbar button -> has correct tool selected.
* Open a document.
* Look at toolbar button menu -> Correct menu entries (like before, with ToolAction).
* Select some selection tools through shortcuts and toolbar button -> behaves correctly.
Usage as submenu:
* Add ToggleActionMenu ("mouse_selecttool") to menubar (..../kxmlgui5/okular/part.rc) -> Submenu looks correctly, has no checkbox attached and so on...
Toolbar buttons:
* Add diverse other actions to the menu -> still works as before.
* Add actions when toolbar buttons are already created -> actions are added to existing buttons.
* setDefaultAction() to some completely unrelated action. -> ToggleActionMenu does not get confused.
Reviewers: simgunz
Reviewed By: simgunz
Subscribers: aacid, ngraham, simgunz, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D21971
By waiting for the delayResizeEventTimer to trigger before starting the
test.
The test "randomly" failed before, which shows there's an actual bug in
the code, but the actual bug is "if you are moving the mouse over a
field that has a on focus action and at that very same time the
delayResizeEventTimer triggers, the action won't be executed".
That's almost impossible to reproduce in real life so i'm going to
pretend the bug is not there for all purposes
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
This patch adds kinetic / inertial scrolling to ease the use of Okular on touchscreen devices, using Qt's QScroller. I think it's much nicer even for mouse usage.
I left the "mouse cursor wraps when going at the edge of the screen" mechanism intact.
Also, I made it so that there is a nice animation when using the up / down keys to navigate the document, instead of having discrete steps.
FEATURE: 413989
FIXED-IN: 1.10.0
Summary: TODO: Only enable the action when there's text being spoken or when speech is paused.
Subscribers: okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D24102
The return type of that method is Okular::View::CapabilityFlags.
Hence, returning 'nullptr' as was done previously cannot be correct,
and 'NoFlag' should be used instead. As both evaluate to '0'
internally there should not be any functional difference.
Adds the functionality to save the view mode (single page, facing...),
continuous scrolling, and margin trimming to the document information,
as it is already done with the zoom information.
Summary:
With formatting there is an internal value, which represents
the true value of a field additionaly to the normal,
visible, text.
For fields which have formatting rules these might differ
and for calculations the internal value is used. The behavior
to format on focus in / focus out events is similar to
that of Acrobat reader.
Test Plan: Needs unit test
Reviewers: aacid
Subscribers: okular-devel
Tags: #okular
Maniphest Tasks: T8886
Differential Revision: https://phabricator.kde.org/D13171
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.
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.
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:
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, 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:
When you select a square with the right mouse button, and you go past the margin of the window (but where there is still space to go), okular scrolls the document so you can select more.
With this patch this automatic scrolling goes at 60 fps instead of 10, I made it so that the speed of the scroll is the same
Reviewers: #okular, aacid, sander, ngraham
Reviewed By: sander, ngraham
Subscribers: sander, ngraham, aacid, ahmedbilal, okular-devel, kezik
Tags: #okular
Differential Revision: https://phabricator.kde.org/D20437
BUG: 358868
Test Plan: Click on "Select All Text on Current Page" entry in Edit menu to select the entire page. The selected text can then be copied via Edit menu item "Copy"
Reviewers: aacid, #vdg, ngraham
Reviewed By: #vdg, ngraham
Subscribers: yurchor, michaelweghorn, kde-doc-english, davidhurka, abetts, loh.tar, alexde, ngraham, okular-devel
Tags: #okular, #documentation
Differential Revision: https://phabricator.kde.org/D18744
Summary: As the title says. In my humble opinion this makes the code *much* easier to read.
Test Plan: No functional changes.
Reviewers: #okular
Subscribers: aacid, davidhurka, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D19539