This is an important feature of Okular, but when using the
KHamburgerMenu UX, it's quite buried in the More... section. Let's
move it up to the top level of the menu.
BUG: 470752
FIXED-IN: 23.08
If an open file with unsaved changes was deleted on disk, Okular
currently warns the user about it (in master) or prevents them from
saving it (in 23.04). But in both cases this is unnecessary; if the
open file was deleted on disk when the user tries to save changes,
Okular can simply save to its file path and re-create it, with no
risk of data loss or stomping on anyone else's work. So it should do
that.
CCBUG: 402017
Instead of just a simple list of "nickname"'s which is kind of like the
signing backend's internal ID for a given certificate, provide some more
context to each key.
This is a slight improvement, not a complete overhaul.
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.
When the user tries to do a "Save" operation on an open file that was
since modified externally, currently Okular prohibits it. We can make
this a bit more user-friendly by instead explaining the situation
clearly and offering the user some options:
- Yes, really overwrite the changes made in the other program
- Instead save the unsaved changes as a new file elsewhere
- Abort
CCBUG: 402017
Currently Okular stops the user from saving their document if it has
unsaved changes and was modified externally. This makes some sense
because there are now two sources of truth, and Okular cannot reconcile
them itself. However as a consequence, it causes data loss since the
user's unsaved changes in Okular become un-save-able. This is quite
frustrating when it happens.
But this prohibiton on saving over an externally-modified document only
really makes sense for a "Save" operation that overwrites the original
document. If instead, the user does a "Save As...", then they can save
their local changes to another file and avoid losing unsaved changes.
Then if needed, they can manually compare the original
externally-modified document with their newly-saved document and
reconcile the changes by hand.
Accordingly, this commit avoids showing the error message box and
blocking saving if the user is doing a "Save As..." to a new location,
rather than overwriting the open file.
BUG: 402017
FIXED-IN: 23.04.1
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.
When using an LTR language, people scan user interfaces left-to right
and top to bottom. This means that the most frequently-used controls
should be located at the top left, so people see them first.
This commit uses that principle to re-arrange the toolbar a bit, so that
after the "show/hide sidebar button" (which needs to be the left-most
item to connect it with the left sidebar), the left-most items in the
default toolbar are the zoom and view mode controls. These are
viewing-related controls, and Okular is first and foremost a viewer app.
The controls that let you interact with the document (select stuff,
annotate) are moved over to the right side of the toolbar because they
are used for secondary workflows.
The zoom buttons are also grouped together to connect them in the user's
mind.
Finally, the separator lines are re-added to disconnect the "show/hide
sidebar" button from the now-icons-only zoom buttons.
This is a useful UI element that I find myself using a lot, so quick
access is helpful. Another person just submitted a similar change (see
!689) so it would seem there is some demand for this.
In its current form, the toolbar contents would be too long if we added
it, and items would get pushed into the overflow menu. To prevent this,
let's also drop the separator lines and text from the zoom buttons.
With this MR, the sidebar can now be (if not locked):
* docked to the left or right side
* undocked and floated as an independent window
* closed with the close button in the header
BUG: 455013
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