Commit graph

310 commits

Author SHA1 Message Date
Sune Vuorela 03368e06f4 Make phonon optional
In certain configurations not lugging around a multimedia framework could be preferred.
2023-06-21 15:50:58 +00:00
Sune Vuorela 0c383d8cfc Random minor/pedantic fixes 2023-06-17 11:04:41 +00:00
Nate Graham c1165fba5d Surface Digitally Sign action more obviously in hamburger menu
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
2023-06-15 05:12:56 +00:00
Sune Vuorela 3768e242b5 Signature dialog: put a spacer in bottom
This prevents too much items dancing around if no images and just one
certificate
2023-06-14 17:47:41 +00:00
Sune Vuorela 91b03f860a Show recent images when it gains content 2023-06-14 17:47:41 +00:00
Sune Vuorela 3c6ebac826 Provide a way to remove images from signature dialog 2023-06-14 17:47:41 +00:00
Sune Vuorela c27539fbbb Make certificate list fit if only 1 or 2 certificates 2023-06-14 17:47:41 +00:00
Sune Vuorela 9f498c7f55 Allow new signatures to have image backgrounds 2023-06-14 17:47:41 +00:00
Sune Vuorela da7ca71291 Add location and reason to signing info 2023-06-14 17:47:41 +00:00
Sune Vuorela 47b8fb2729 Switch SelectCertificateDialog to ui file
No other changes is in here.
2023-06-14 17:47:41 +00:00
Nate Graham 99600667d4 Don't stop or warn if the edited file was deleted on disk
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
2023-06-08 15:21:41 +00:00
Friedrich W. H. Kossebau 725155b29d Include only needed headers instead of QtDBus module header
GIT_SILENT
2023-06-07 22:41:22 +00:00
Friedrich W. H. Kossebau de03d64855 Include only needed headers instead of QtTextToSpeech module header
GIT_SILENT
2023-06-07 22:41:22 +00:00
Sune Vuorela 3ff2ab5081 Switch optional kwallet to use config.h 2023-05-25 21:43:43 +00:00
Sune Vuorela 62767b7c8c Convert QtSpeech to config.h 2023-05-25 21:43:43 +00:00
Sune Vuorela d597da0204 Rename Purpose defines to match others 2023-05-25 21:43:43 +00:00
Kai Uwe Broulik a6eeddf892 PageView: Set InstantPopup mode for View Mode menu
Fixes typo.
2023-05-16 17:35:53 +02:00
Sune Vuorela 0a7199fab6 Simple deprecation. ReturnKeyPressed 2023-05-12 18:09:44 +00:00
Sune Vuorela 5c9e0e2585 Rename setViewportWithHistory to setViewport and remove the old setViewport 2023-05-12 10:39:41 +00:00
Sune Vuorela 763328a6ba Better dialog for selecting certificates
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.
2023-05-03 13:41:14 +00:00
Sune Vuorela d3e1c32ff7 Simple deprecation: returnPressed 2023-05-03 09:58:52 +00:00
Sune Vuorela 9876bef3bb Simple deprecation: DefaultLocaleLongDate 2023-05-03 09:42:45 +00:00
Sune Vuorela b32ae775b4 Remove virtual methods from signature and certificate info
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.
2023-05-03 09:15:42 +00:00
Nate Graham 89f17155bf Offer options when trying to overwrite externally-modified file
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
2023-05-02 20:57:48 +00:00
Nate Graham b5191a2c1f Let user "Save As..." when document has been externally modified
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
2023-05-02 20:57:48 +00:00
Kai Uwe Broulik 7d53ef7c74 Allow copying annotation text to clipboard
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.
2023-04-30 08:11:16 +00:00
Sune Vuorela b932f4289e Simple deprecation. Qt::MidButton 2023-04-27 10:36:01 +00:00
Sune Vuorela 1826ec6daa Simple deprecation. Date long formatting 2023-04-27 11:56:24 +02:00
Sune Vuorela 5d8eac0e2a Return a structure instead of using output arguments
This is preparation to extending the function to also query for possible
background images, reason and location
2023-04-27 09:34:58 +02:00
Sune Vuorela 222d778c33 Deprecation fix; returnPressed 2023-04-22 15:02:09 +00:00
Sune Vuorela 87b2831232 Deprecation fix. popupMode 2023-04-19 20:30:27 +00:00
Sune Vuorela 63053419b9 setDelayed deprecation 2023-04-19 14:57:55 +00:00
Sune Vuorela b238acae92 deprecation fix. krandom 2023-04-16 10:15:01 +00:00
Nate Graham 8c8744f2e3 Re-arrange toolbar buttons by usage frequency
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.
2023-03-15 18:11:52 +00:00
Friedrich W. H. Kossebau 9de70e2499 Port away from deprecated PurposeWidgets include
GIT_SILENT
2023-03-03 02:39:25 +01:00
Nate Graham b6c6d906ba Tweak default toolbar to fit View Mode combobox
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.
2023-02-23 16:21:27 +00:00
Friso Smit 0b25a83cd5 Do continous scrolling when there is high resolution scroll 2023-02-20 01:07:11 +00:00
Friso Smit 30969b490c Move continuous zoom to a function 2023-02-20 01:07:11 +00:00
Cimbali a33e499b40 Fix wrong interpretation of autoplay flag
BUGS: 436709
2023-02-15 23:32:49 +00:00
shenleban tongying 2ba2ee5d87 Reduce sidebar title size
This slightly increases the amount of vertical space available for content.

BUG: 462321
FIXED-IN: 23.04
2023-01-05 23:45:52 +00:00
Eugene Popov 2fbab13e1f Port sidebar to QDockWidget
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
2022-12-22 22:50:55 +00:00
Albert Astals Cid fc8059575e Two more version checks that are not needed now 2022-11-19 11:10:16 +01:00
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 d0359e6342 Merge remote-tracking branch 'origin/release/22.08' 2022-09-04 22:41:24 +02:00
Albert Astals Cid 8e93995e3c Fix saving files on Windows
turn a move into a copy and remove

Seems to work better with windows way of working with open files being
overwritten and stuff

BUGS: 458574
2022-09-04 22:26:23 +02:00
Albert Astals Cid b2c56a0a71 Merge remote-tracking branch 'origin/release/22.08' 2022-08-31 22:09:06 +02:00
Albert Astals Cid 3304038d1d ToggleActions: Obey "don't show text" for a particular action toolbar setting
BUGS: 457322
2022-08-31 19:59:22 +00:00