The zoom is implemented using zoomWithFixedCenter so it zooms into the
current mouse pointer location instead of zooming on the viewport center.
BUGS: 421484
This commit changes the "if / else" into "if return" so most of the
scrolling implemententation is not indented and the Ctrl+Wheel case is
handled as a special case at the beginning of the function.
Rather than opening a new window/tab with an extra document when signing
a document, replace current active unsigned document with the signed
version.
At least for some users, including me when testing,
it gives annoyance or confusion.
After updating to plasma6, the kcmshell5 changed name to kcmshell6, which caused okular's popup configure menus fail to appear.
This single commit should fix the issue.
In qt6, QRect::normalized changed it's meaning and it now has a 'span'
that preserves the old meaning.
Use the old span to get the old version of normalized so we can match on
the corners once again.
see https://codereview.qt-project.org/c/qt/qtbase/+/309932 for details.
BUG: 482249
After trying to measure the effect of switching TinyTextEntity from a
custom SBO string type to just QString and getting a barely measurable
gain, TinyTextEntity kind of looked like TextEntity, so merge those two.
Also reduce the amount of new/deletes around TextEntities
Implement a string pool for some tiny strings, and various memory optimizations
There is a surprising api change in KSelectAction that has renamed
triggered, but a base class is still having a different triggered, so
code still compiles.
Rename the signal to the new version
BUG: 479108
We now definitely has std::as_const available and Qt has started nagging
about converting to std::as_const.
Implementation is the same for both functions, and qAsConst was a
stop-gap measure until std::as_const was sufficiently available.
Which feels more natural than always zooming towards the center of the window.
Co-authored-by: Steffen Hartleib <sh033@gmx.de>
Co-authored-by: Oliver Sander <oliver.sander@tu-dresden.de>
BUG: 390707
When starting a pinch the user first touches with one finger. That causes the QScroller to enter the pressed state.
Then when the second finger touches and moves this causes the QScroller to interpret it as a scroll. This causes
the view position of the document to move
To avoid this send InputRelease to the scroller when a pinch starts to make sure it is no longer in pressed state.
Also don't send any input to the scroller while the pinch is ongoing to avoid it entering the pressed state again.
BUG: 421755
This is an abi break, but it menas we can extend signature and
certificate info in the future without breaking the abi again.
While we are at it, there is no need to hand around pointers to
certificate/signature info any longer, so clean up that. Fix memleaks as
side effect.
Adds a "Copy Text to Clipboard" context menu which copies the
annotation text to the clipboard as plain text.
When an annotation is selected in "Browse" mode, its text is copied.
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
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
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
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
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)
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
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 '{'