Commit graph

72 commits

Author SHA1 Message Date
Albert Astals Cid 91afa74342 Set minimum requirement to Ubuntu 22.04 2022-11-19 09:48:15 +00:00
Nikola Nikolic e6002e798d Fix: Involuntary scrolling when annotations encounter the edge of the page
There are three reasons why scrolling happens (first two cases of scrolling are actually due to
viewport transition that is triggered by annotation being traslated/created):

1. VisiblePageRect are NormalizedRect and should be represented by four values in [0, 1] interval.
   Due to rounding errors caused by using QRect, they only reach the [0, 0.999] interval.
   That means that right and bottom edge of the page are never visible so if annotation
   is translated along the right/bottom edge viewport transition occurs (fixed in
   PageView::slotRequestVisiblePixmaps)

2. For freehand line there are some constants (dX, dY) that make a line to be drawn outside
   the page borders causing viewport transition. Removing these constants solves the problem (fixed
   in SmoothPathEngine::event)

3. Browse mode is activated as soon as the cursor is moved outside the viewport.
   Instead, we should forward the move event to the annotation which than can ignore the event (fixed
   in PageView::mouseMoveEvent)

BUG: 436742
2022-11-15 13:30:55 +00:00
Eugene Popov 40aa5fadb6 Increase scrolling speed with the touchpad
Currently, scrolling through a document using the touchpad is quite slow compared to scrolling through the standard Qt controls. This MR increases the speed of scrolling with the touchpad by removing the "magic" divider.

CCBUG: 455014
2022-11-13 18:12:25 +00:00
Eduardo Cruz ea04c61faf Add a configuration option to disable drag-scrolling beyond screen edges
The mouse cursor wrap feature while drag-scrolling can be undesirable in some
cases; for example it can be annoying to have the cursor jump accidentally to
the distant edge of a big screen. Now users can disable this feature if they
prefer.

BUG: 421040
FIXED-IN: 22.12
2022-09-28 00:10:56 +00:00
Albert Astals Cid 0d40301d50 Add a few definitions that will come with ECM 5.85
Better enforce them now, so that the work to port doesn't increase over
time

Not a super fan of this for regular applications, but oh well the ship
has sailed
2022-04-07 23:02:12 +00:00
Albert Astals Cid 252236d413 Port a few more QLinkedList to QList
We don't need the special properties of QLinkedList in any of those and
QLinkedList is deprecated, so move away from it
2022-03-31 17:08:01 +02:00
Albert Astals Cid 0741ef1838 Port away from more QLinkedLists
QLinkedList is gone from Qt6

The almost 1:1 port is std::list but we don't need iterator stability on
removal/insertion so just port to QList
2022-03-22 12:58:59 +01:00
Albert Astals Cid 8941e43488 Port away from more QLinkedLists
QLinkedList is gone from Qt6

The 1:1 port is std::list but we don't need iterator stability on
removal/insertion so just port to QList (one case to std::vector since
QList needs a copy constructor)
2022-03-22 00:11:55 +01:00
Albert Astals Cid 6767b8739e Port a few QLinkedList to QList
QLinkedList is deprecated in later Qt5 and gone in Qt6

The 1:1 port is std::list but in this cases all we ever do
is create the lists, push back to them, and pass then around
to be read, for that a QList is more than enough
2022-03-19 11:22:55 +00:00
Albert Astals Cid ba35bbd9e6 emit -> Q_EMIT
A future ECM is going to force that on us, so do it early
2022-03-19 10:58:47 +00:00
Albert Astals Cid ec1ed42dca Make clang-format happier 2022-03-12 10:59:53 +01:00
Jonathan Marten 1489c9aacb Fix clang-format brace layout introduced in adc7a758 2022-03-11 10:06:13 +00:00
Jonathan Marten adc7a75803 Fix a missing brace if HAVE_SPEECH is not defined
Possibly introduced by commit 50d0703a.

part/pageview.cpp: In member function 'virtual void PageView::mouseReleaseEvent(QMouseEvent*)':
part/pageview.cpp:3077: error: expected '}' before 'else'
part/pageview.cpp:3069: note: to match this '{'
2022-03-11 09:49:26 +00:00
Volker Krause 50d0703ae0 Enable readability-braces-around-statements 2022-03-09 23:29:56 +01:00
Nicolas Fella 1d64fea660 Port away from KToolInvokation 2022-03-03 21:54:28 +01:00
Albert Astals Cid 4cd6bfd30e mobile: Add Signature Viewing UI
Move a few files from part/ to gui/ since they are also used by the
mobile/ frontend
2022-02-18 08:32:13 +00:00
Yuri Chornoivan 28e362b6a1 Simplify the string for the 'Search for...' action
BUG: 450334
2022-02-17 15:09:42 +02:00
Nicolas Fella 3e2e5cc95e Simplify form action handling
Instead of going widget -> controller -> pageview -> document do
widget -> document directly.
2022-01-24 16:00:19 +01:00
Albert Astals Cid a8e5f6e9f7 PDF: Allow signing unsigned signature fields 2022-01-24 13:18:36 +01:00
Albert Astals Cid f03bbfa89d PDF: Allow signing documents that need password to open them
We need the password since in the middle of the signing process we need to reopen
the document we just created to do some final modifications
2022-01-05 13:59:37 +00:00
Albert Astals Cid 62eec7d5b1 Show the "No signing certs" warning earlier
No need to ask for the user to draw a rectangle for the signature
if there's no certs to sign anyway

CCBUGS: 446549
2021-12-12 23:43:37 +00:00
Albert Astals Cid 975bf990ed Fix zoom actions not being updated correctly
BUGS: 440173
2021-11-23 19:46:08 +00:00
Bharadwaj Raju cc64011e3b Revert ce6582c76 2021-10-18 14:53:49 +05:30
Bharadwaj Raju ce6582c761 Change labels of selection and annotation tools to be imperative
This makes them conform to the HIG and also looks cleaner.
2021-10-14 18:22:19 +00:00
Albert Astals Cid c8a439132d Merge remote-tracking branch 'origin/release/21.08' 2021-09-09 21:28:12 +02:00
Albert Astals Cid 376925a10d Remove \n if it's the last char of the selected text
BUGS: 342874
2021-09-09 17:33:28 +00:00
Albert Astals Cid 0c659a5466 clang-tidy: Enable google-explicit-constructor 2021-08-29 08:52:35 +00:00
Nate Graham 9819baffbf Merge branch 'release/21.08' 2021-07-23 06:57:50 -06:00
David Hurka c399a11054 Fix Page Up/Down scrolling when scrollbars are turned off
PageView::slotScrollUp/Down() queried the size of the scrollbar instead of the viewport,
which has no obvious reason and doesn’t work when scrollbars are not there.

Probably the scrollbar size was thought to be more robust
in times when PageView had overshoot enabled.

Also fixes code documentation for these methods,
and removes another spaghetti feature where Continuous mode was queried
in an `if` branch before the one where it is relevant.

BUG: 421822
2021-07-22 21:05:53 +00:00
Josef Filzmaier 1d90817660 Replace kWarning with qWarning
Even in comments
2021-07-16 00:11:53 +02:00
Albert Astals Cid ec1fda4f87 Merge remote-tracking branch 'origin/release/21.04' 2021-06-27 01:13:50 +02:00
Gerd Wachsmuth e1a14b4a1a Request Pixmaps in slotRelayoutPages 2021-06-26 10:13:34 +00:00
Simone Gaiarin 230a68d537 Uncheck mouse mode action when annotation tool selected
When the annotation is unchecked the previous mouse mode is restored.

The slot slotMouseNormalToggled is changed back to its original version
of slotSetMouseNormal given that we needed to pass the checked state
only to detach the annotations, and we do it in the lambda now.

BUG: 398108

BUG: 437377

FIXED-IN: 21.08
2021-06-19 14:12:19 +00:00
Simone Gaiarin 67a54bd8e0 Save zoom mouse mode action to a variable 2021-06-19 14:12:19 +00:00
Alexander Lohnau ac083e44e3 Make meaning of sponsoring note more clear 2021-06-10 08:11:56 +00:00
Alexander Lohnau 83dfef19ab Put author and mail on same SPDX-FileCopyrightText line 2021-06-10 08:11:56 +00:00
Alexander Lohnau 24c75071be Move sponsoring note outside of SPDX-FileCopyrightText statement 2021-06-10 08:11:56 +00:00
Alexander Lohnau 2f193a63de Convert license headers to SPDX 2021-06-10 08:11:56 +00:00
David Hurka 195bbe3636 Create color mode menu.
Implemented using a ColorModeMenu class,
derived from ToggleActionMenu (derived from KActionMenu),
as a child object of PageView.

* KToggleAction for every color mode, allows to set shortcuts for every mode.
  Color mode actions have icons.
* KToggleAction for normal colors mode.
* ToggleActionMenu containing all color mode actions.
  If triggered, toggles color mode between normal colors and last change colors mode.

"Toggle Change Colors" is replaced by "Change Colors", which is actually a toggle action.

BUG: 407217
BUG: 437755
2021-05-29 23:08:56 +00:00
Albert Astals Cid 1954d43f05 0 -> Okular::Settings::EnumViewMode::Single 2021-05-18 19:10:43 +00:00
Gerd Wachsmuth 6a6b6ca345 Fix bug: select browse tool after trim select 2021-04-25 13:43:18 -06:00
shenleban tongying 1855f9e4b1 Patch: Let form and sign interface to respect the OSD setting 2021-04-23 03:44:44 +00:00
Albert Astals Cid 394001017e Merge remote-tracking branch 'origin/release/21.04' 2021-04-22 22:01:23 +02:00
Gerd Wachsmuth f6b58ed804 Fix bug: select browse tool after trim select 2021-04-21 08:01:10 +02:00
Gerd Wachsmuth 61551d2356 Fix: Viewport coords normalized w.r.t. full page
The coordinates in Viewport.rePos are normalized on the full page. In
two functions within pageview.cpp, these were treated as coordinates on
the cropped page.

CCBUG: 198427

This partially fixes the bug 198427 in the case that the cropping of the
target pages (and the pages around the target) is known at the time the
link is clicked. That is, it works if

- One uses 'Trim To Selection'
- One uses 'Trim To Margin' and has already viewed at the target
page(s).

In the case that the cropping of the page at the target is unknown, we
still end up at the wrong position.
2021-04-20 07:48:51 +02:00
David Hurka 6b26a2b4bd Port PageView to simplified ToggleActionMenu 2021-04-11 17:55:51 +00:00
David Hurka 2e1ddaa109 Enable horizontal mouse wrap for Browse tool drag scrolling
Also fixes calculation of wrap edges, where top and bottom edge were swapped.

BUG: 371904
2021-04-11 09:56:41 +00:00
David Faure 6b3da83f69 Merge remote-tracking branch 'origin/release/21.04' 2021-04-09 23:15:32 +02:00
David Faure c118ab9482 Fix valgrind warning about uninit variables 2021-04-09 12:39:12 +02:00
Nate Graham 0906d5ea0a Merge branch 'release/21.04' 2021-04-08 19:22:15 -06:00