Commit graph

35 commits

Author SHA1 Message Date
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 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
Gerd Wachsmuth 0a23d4a001 Fix a bug with zoom levels on cropped pages
BUG: 342003

Uses ideas of https://bugs.kde.org/show_bug.cgi?id=342003#c5
2021-04-08 22:27:20 +02:00
Mahmoud Khalil aa0d1b459b Fixes changing continuous mode while on tabs issue
Toggling the Continuous mode while opening multiple tabs caused an issue
in Okular, in which it considered it a global setting. So, toggling it
for one document, then toggling it again for the other documents may not
take effect. This should fix it by considering this setting a per
document setting, and therefore toggling the mode for one document
shouldn't have any effect for other documents.

BUGS: 422080
2021-04-07 23:39:55 +02:00
David Hurka 67325270ec Fix viewport jumps when drag-scrolling beyond screen edges
This creates CursorWrapHelper, which wraps the cursor
from e. g. top screen edge to bottom screen edge,
and calculates the drag offset from the actual cursor movement.
2021-03-25 12:22:19 +00:00
Oliver Sander ccda6d2a65 Remove device pixel ratio scaling from PixmapRequest
The PixmapRequest constructor expected width and height in logical
pixels, and scaled them to device pixels.  However, not knowing what
screen the request is for, it had to use qApp->devicePixelRatio()
for the scaling.  That value may not be correct if not all screens
use the same scaling.

Fix this by introducing a new constructor that takes the device
pixel ratio as an additional argument, and deprecating the old
constructor.
2021-03-08 00:23:11 +01:00
Michael Augaitis 9f5c05028d Make ESC key leave fullscreen
BUG: 366276, 417337, 269677
2021-02-09 23:57:47 +00:00
Steven Chua 2917e73953 Fix Table Selection polluting clipboard history
The Table Select tool no longer automatically copies its
contents to the clipboard, but only to the selection clipboard.
(Middle-click paste clipboard.) Instead, after creating
the table, the user can right-click to bring up a popup
menu with the action "Copy Table Contents to the Clipboard".
Clicking on this will copy the table contents to the clipboard.
Ctrl+C also works.

BUG: 402110
2020-12-25 13:04:44 +00:00
Albert Astals Cid 0f4be27338 Use the action icon instead of the mimetype icon 2020-12-13 21:31:14 +00:00
Albert Astals Cid 49f784ecf9 When signing save to a new file, not over the current one 2020-12-13 21:31:14 +00:00
Albert Astals Cid 6325a4fe0b Make sure you have no unsaved changes before saving 2020-12-13 21:31:14 +00:00
Albert Astals Cid a5df71a79a Sign -> Digitally Sign
And remove from toolbar, it's not that important it should be there

Also increase version
2020-12-13 21:31:14 +00:00
Albert Astals Cid b09e23f6ab Run clang-format
Attempting to fix the whole chain of commits is not worth it
2020-12-13 21:31:14 +00:00
Thorsten Behrens e3e582ee5c Add feature flag for poppler signing API
Test and conditionally-compile pdf signing feature, depending
on poppler new-ness.
2020-12-13 21:31:14 +00:00
Katarina Behrens 6cff306bab Making 'Sign' button a toggle was a bad idea 2020-12-13 21:31:14 +00:00
Katarina Behrens 339ce239f5 Draw an initial rectangle where to place the signature 2020-12-13 21:31:14 +00:00
Katarina Behrens b5117aff6c Add slot for 'Sign' button, shows info overlay so far 2020-12-13 21:31:14 +00:00
Katarina Behrens 2845db76fb Add 'Sign' menu entry 2020-12-13 21:31:14 +00:00
Laurent Montel 3f58639e06 operator+/- is disabled for QFlags in qt6 2020-12-09 08:34:49 +01:00
Nate Graham 49a7caf64c Merge branch 'release/20.12' 2020-11-20 12:01:00 -07:00
David Hurka c6a3275151 Fix QScroller crash on Qt < 5.14 and certain screen arrangements
QScrollerPrivate::setDpiFromWidget() before Qt 5.14 crashes
when the target widget does not intersect a physical screen,
because QDesktopWidget returns screen index `-1` in this case,
which leads to an out-of-range read from QApplication::screens(),
which leads to a segfault when reading from an invalid QScreen* pointer.

This adds a workaround that checks for the `-1` situation,
and then tries to resize PageView temporarily to intersect at least some screen.

BUG: 425188
FIXED-IN: 20.12
2020-11-20 18:01:20 +00:00
Alex Rosca 8ae95b29c8 Avoid unintentional accelerating flicks by reducing maximum flick time
When making a flick using the mouse or the touchscreen and then slowly
dragging the pages in the same direction with the flick, it unintentionally
reenters the flicking state after a mouse button release and it's quite
annoying. The commit reduces the maximum time before the next flick.

Steps to reproduce:
1) Flick in direction A.
2) While the view is coasting, decide that you want to stop close to the current position.
3) Grab the view (still coasting), and drag it slowly in direction A.
4) When you reached the desired point, stop your movement, and release the view.
5) QScroller interprets this release as “accelerating flick”,
   and makes the view coast faster in direction A.

Upstream bug is QTBUG-88249; QScroller ignores MinimumVelocity for accelerating flicks.
2020-11-20 17:54:07 +00:00
David Hurka a83261db92 Merge branch 'release/20.12' into master 2020-11-18 20:35:53 +01:00
David Hurka 19d5dd8ec7 New part/ directory for okularpart sources from /, ui/, conf/
Source files are no longer separated by UI and non-UI and similar,
but only by their build target.

* ui/ -> part/
* Move all source files from conf/ to part/
* Keep config skeleton definitions in conf/, needed for the mobile target too
* Move editdrawingtooldialogtest.h from conf/autotests/ to autotests/
* ui/data/icons/ -> icons/
* Move /part.cpp, /part.rc and similar files to part/
* Adapt include paths in source files
* Adapt CMakeLists.txt files (in / and in subdirectories)
* Adapt /Messages.sh
2020-11-18 19:32:56 +00:00
Renamed from ui/pageview.cpp (Browse further)