Commit Graph

393 Commits

Author SHA1 Message Date
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
Nicolas Fella
c4e33d0e79 Make dependency on KI18n and KTextWidgets explicit
They are already pulled in by KParts, but we better not rely on that
2021-04-26 13:49:43 +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
Albert Astals Cid
889e744f91 GIT_SILENT Upgrade release service version to 21.07.70. 2021-03-13 22:06:29 +01:00
David Hurka
134cbc30d5 Port config dialogs from .ui to QFormLayout
* C++ instead of .ui files.
* Put every control in a QFormLayout row.
* Where possible, use only a single layout, i. e. no nesting.
* Use rows with an empty QLabel as horizontal spacer.
  Content grouping by whitespace instead of group boxes.
* Where group boxes were used for labeling tool managers,
  use a <h3> QLabel instead.
* Where group boxes were used for labeling control groups,
  drop the label or label only the first control (like in Dolphin).
* Use combo boxes instead of radio button groups.
  (I don’t know how to connect radio buttons to KConfigWidgets...)
* Don’t use checkboxes as label, that doesn’t lay out correctly.
  Instead, put the checkbox in an own row, although it controls the same feature.

Some of the changes are not perfect yet, so I opened
https://invent.kde.org/graphics/okular/-/issues/45 to outline further improvements.
2021-01-01 01:09:10 +00:00
Thorsten Behrens
f7d6045b92 Add poppler NSS support
Move certificate config down into generator code
Read available signing certificates from poppler NSS
2020-12-13 21:31:14 +00:00
Katarina Behrens
242710cae7 Recycle WidgetConfigurationToolsBase for certificate management dlg 2020-12-13 21:31:14 +00:00
Katarina Behrens
69ddb957f1 Add config page to configure signing identities/certificates 2020-12-13 21:31:14 +00:00
Albert Astals Cid
3cc7bdd1d7 cmake: Modern way to link to zlib 2020-12-02 18:57:49 +01: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
Albert Astals Cid
becdc7c483 Revert the two last commits
f9841b0f8a and e0f45add55

They break the windows build, which shows there's something defenitely
fishy going on with the current code, but oh well, someone with more
time needs to figure out a proper solution
2020-11-11 01:31:47 +01:00
Albert Astals Cid
e0f45add55 Enable -Wweak-vtables in clang
Read https://stackoverflow.com/a/23749273/11956287 for a full
explanation, but basically this is important for headers like the
interfaces/ and kdocumentviewer.h that are supposed to be used by third
partyies where it may happen that wrong things happen because the whole
class is inline in a header

For the classes that are defined in the .cpp or are not installed
headers this would not be necessary but it's not so hard to add a few
default defined destructors, so do that :)
2020-11-08 21:21:06 +00:00
Albert Astals Cid
f44eceba76 GIT_SILENT Upgrade release service version to 21.03.70. 2020-11-08 18:40:16 +01:00
Albert Astals Cid
1327fdd830 GIT_SILENT Upgrade release service version to 20.11.80. 2020-11-08 17:53:23 +01:00
Simone Gaiarin
580cbce837 Selectively reparse builtin and quick annotation tool configuration 2020-10-28 05:32:07 +00:00
Laurent Montel
f7cc59b7dc Drop outdated QT_USE_FAST_OPERATOR_PLUS 2020-09-17 07:14:54 +02:00
Friedrich W. H. Kossebau
37bf29d57d Use ecm_setup_qtplugin_macro_names
Avoids all the explicit boilerplate needed, ensures the dependency on
the JSON file ia also set and allows simple export of the setup
in the installed CMake config file, so other projects importing
the config file have the respective CMake macros set as recommended.

Test Plan:
Still builds as before. Touch a plugin metadata JSON file now triggers a moc
rerun. CMake config file contains setup of variables.
2020-09-13 11:20:50 +02:00
Albert Astals Cid
c17127b018 cmake: suggest-override is provided by ECM since 5.55 2020-09-13 01:04:16 +02:00
Albert Astals Cid
e989200dcf Increase minimum supported versions to those provided by Ubuntu 20.04 2020-09-13 01:03:53 +02:00
Albert Astals Cid
d5210db504 Change the version to be date based
As discussed on the Akademy meeting, it's just simpler to do this than
keep pretending 1.10 vs 1.9 have some kind of meaning :)
2020-09-11 16:27:26 +00:00
Albert Astals Cid
2697105462 Revert cbddcd3273
KJS and KWallet are indeed optional, that's what the ${optionalComponents} variable does
2020-09-09 14:13:09 +02:00
Albert Astals Cid
cbddcd3273 kwallet and kjs are mandatory in cmake anyway, remove ifdefs 2020-09-05 23:50:45 +00:00
Albert Astals Cid
ee2ef4b0f2 Merge remote-tracking branch 'origin/release/20.08' 2020-07-13 01:16:38 +02:00
Albert Astals Cid
a73012a91c Cleanup part.rc files older than version 47
Otherwise we crash because we introduced a mandatory new toolbar and
kxmlgui doesn't seem to merge them properly

BUGS: 422827
2020-07-12 23:52:08 +02:00
Albert Astals Cid
4f3d1db584 increase version 2020-07-11 12:29:01 +02:00
Albert Astals Cid
8fef6098a1 GIT_SILENT Upgrade release service version to 20.11.70. 2020-07-11 12:27:08 +02:00
Albert Astals Cid
7044b0ddf3 GIT_SILENT Upgrade release service version to 20.07.80. 2020-07-11 11:54:57 +02:00
Albert Astals Cid
a3c7d81000 Merge remote-tracking branch 'origin/release/20.04' 2020-06-30 19:37:33 +02:00
Albert Astals Cid
795c7cb01f Increase kjs requirement for using the timeout check
Unfortunately with the new timeout code but older than 5.72 will crash on appAlert

So increase the requirement to > 5.71
2020-06-24 12:06:32 +02:00
Christoph Feck
1d80b278ff GIT_SILENT Upgrade release service version to 20.04.2. 2020-06-08 19:29:41 +02:00
Simone Gaiarin
0b05d7ce99 Overhaul annotations UX
Create a new new annotation toolbar to replace the current one as discussed in the task T8076.
Fixes:
BUG: 386578
BUG: 374728
BUG: 352310
BUG: 330518
BUG: 341914
BUG: 157289
BUG: 358057
BUG: 412767
BUG: 413595
BUG: 420462
FIXED-IN: 1.11.0

Test Plan
Before testing this revision
Delete or Temporary move aside the following files:

~/.config/okularpartrc
~/.config/okularrc
~/.local/share/kxmlgui5/okular/part.rc
~/.local/share/kxmlgui5/okular/shell.rc

Nomenclature
Actions in the main toolbar:

Quick annotations
Actions in the annotation toolbar:

Annotation actions Highlighter, Underline, Squiggle, Strike out, Typewriter,
Inline note, Popup note, Freehand line, Arrow, Straight line, Rectangle, Ellipse,
Polygon, Stamp

Annotation config actions Line width, Color, Inner color, Opacity, Font, Annotation settings

Other actions Add to Quick Annotations, Pin

Autotests

 First run: annotation toolbar is not visible

 Selecting Tools > Annotations shows the annotation toolbar (below the main toolbar by default)

 Select an annotation > toolbar is shown

 Select a quick annotation > toolbar is shown

 Hide action (red cross) on the toolbar hides the toolbar

 Keys 1-9,0 select the (builtin) Annotation actions (one case tested)

 Keys Alt+1-9,0 select the quick annotation actions (one case tested)

 No annotation action selected: Quick Annotations is enabled, Add to quick annotations is disabled, Annotation config actions are disabled, Pin is enabled

 The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled (also in Quick annotations)

 The current document is protected: All actions are disabled

 Select annotation: the  Annotation config actions are enabled and their values set to the ones for the current annotation (taken from okularpartrc)

 Click an annotation action when none selected: browse mode is selected

 Click the currently selected annotation action: the action is unchecked and the tool disabled (back to browse mode)

 Click ESC: the currently selected annotation action is unchecked

 If Pin unchecked the selected annotation is unchecked after it has be used once and we are back to Browse mode

 The annotation systems works when multiple Okular tabs are open (the selected annotation is per-tab)

Manual tests

(TODO) Check that kconf_update updates the key AnnotationTools to QuickAnnotationTools in ~/.config/okularpartrc

Color icon is a format-text-color (if inline note or typewriter) or format-stroke-color for all other annotations
All actions have tooltips (some change based on the fact that the icon is enabled or not)
If a custom Line Width or Opacity is set through the Annotation Settings dialog, its value appears as a new checked action in the Line width or Opacity menu
If a custom stamp is selected through the Annotation Settings dialog, its name or filename (without path) appears as a new checked action in the Stamp menu
In Configure Okular > Annotations it is only possible to configure the quick annotations. Modifying them here updates the Quick annotations list after clicking Apply

The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled in Quick annotations
The state of Pin action is remembered across Okular launches
Selecting a quick action selects the corresponding action and loads its config values (color, line width, ...)
Setting the color and fill color works for all annotations (to be tested carefully, can be problematic for typewriter and inline note given the different internal mechanism to store the color in the settings)
Test stamp annotation (handled differently from the rest of the annotations)

Merge Request: https://invent.kde.org/graphics/okular/-/merge_requests/105
2020-06-04 13:01:31 +00:00
Albert Astals Cid
daad6c9fa1 Silence some deprecation warnings we can't fix 2020-06-03 21:37:32 +00:00
Christoph Feck
d3dcf7a394 GIT_SILENT Upgrade release service version to 20.04.1. 2020-05-11 22:23:16 +02:00
Albert Astals Cid
26f8bb3279 GIT_SILENT increase version 2020-04-15 23:15:50 +02:00
Christoph Feck
5f9a2d85d4 GIT_SILENT Upgrade release service version to 20.04.0. 2020-04-15 10:38:01 +02:00
Albert Astals Cid
25b6775468 Use ${KF5_REQUIRED_VERSION} also for ECM 2020-04-08 21:56:29 +02:00
Friedrich W. H. Kossebau
2fa8080447 Ensure build dependency on JSON files using CMAKE_AUTOMOC_DEPEND_FILTERS
Also do needed setup for automoc in installed CMake config file.
2020-04-08 00:46:27 +02:00
Christoph Feck
aa1af3cf4f GIT_SILENT Upgrade release service version to 20.03.90. 2020-03-28 23:33:51 +01:00
Albert Astals Cid
c06f3c1557 GIT_SILENT Upgrade release service version to 20.03.80. 2020-03-15 19:58:44 +01:00
Albert Astals Cid
c1852b8ddb GIT_SILENT Increase version 2020-03-15 19:48:43 +01:00
Albert Astals Cid
61e155045b GIT_SILENT Upgrade release service version to 20.07.70. 2020-03-15 19:36:50 +01:00
Simone Gaiarin
31e2c29ef0 Set C++ minimum version to 14
Also set CXX_EXTENSIONS to OFF
2020-02-29 09:26:34 +01:00
Yuri Chornoivan
5c6a297feb Fix minor EBN issues 2020-02-13 11:47:51 +02:00
Harri Porten
c1afa356c0 Restrict time given for JavaScript evaluation to max. 2 seconds.
Possible improvement: alert the user of the timeout and offer
the option to continue or abort execution.
2020-02-11 22:34:46 +00:00
Albert Astals Cid
a96c082d69 Build desktop User Interface by default
Can choose to only build mobile interface or both
2020-02-06 22:26:00 +01:00
David Hurka
c6d937ab0d Replace ToolAction by ToggleActionMenu
Summary:
This replaces ToolAction by a near-drop-in replacement named ToggleActionMenu. The new annotation toolbar already uses this (D15580).

Unlike ToolAction, ToggleActionMenu inherits from KActionMenu to be more flexible.
* Menu can be set from outside, not hard coded.
* Default action for toolbar button is controllable from outside. (Theoretically, the button could trigger //anything// now.)
* KActionMenu instead of KSelectAction:
  - Pluggable in other menus, thus called “Menu”.
  - Doesn’t make the actions exclusive, so //any// actions can be added to the menu.
* ImplicitDefaultAction mode can choose the default action of the toolbar buttons automatically, by looking for the first checked action in the menu.

Toolbar buttons use the default action //of// this menu, not this menu itself as action.

Because the default action is configurable now, D21622 and D21635 (where we tried to fine-tune ToolAction) become obsolete.

Screenshot:
Everything like before, here with mouse_selecttool added to Tools menu to show submenu capability.
{F6884228}

Test Plan:
ToolAction replacement and ImplicitDefaultAction mode:
 * Open Okular and look at toolbar button -> has correct tool selected.
 * Open a document.
 * Look at toolbar button menu -> Correct menu entries (like before, with ToolAction).
 * Select some selection tools through shortcuts and toolbar button -> behaves correctly.
Usage as submenu:
 * Add ToggleActionMenu ("mouse_selecttool") to menubar (..../kxmlgui5/okular/part.rc) -> Submenu looks correctly, has no checkbox attached and so on...
Toolbar buttons:
 * Add diverse other actions to the menu -> still works as before.
 * Add actions when toolbar buttons are already created -> actions are added to existing buttons.
 * setDefaultAction() to some completely unrelated action. -> ToggleActionMenu does not get confused.

Reviewers: simgunz

Reviewed By: simgunz

Subscribers: aacid, ngraham, simgunz, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21971
2020-02-02 01:33:33 +01:00
Albert Astals Cid
be8e5710d4 Require poppler >= 0.62
It's the one that comes with our "minimum" requirement Ubuntu 16.04

Cleans up the code a bit
2020-01-09 00:01:43 +00:00
Jonathan Riddell
3403a16f42 Change KDE_APPLICATIONS_VERSION to RELEASE_SERVICE_VERSION https://phabricator.kde.org/T11933
GIT_SILENT
2019-12-10 16:56:25 +00:00
Albert Astals Cid
b8ff7608f2 increase version
GIT_SILENT
2019-11-10 01:18:11 +01:00