Commit Graph

337 Commits

Author SHA1 Message Date
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
0d40301d50 Add a few definitions that will come with ECM 5.85
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
2022-04-07 23:02:12 +00:00
Jeremy Whiting
1be2290358 Allow user to select tts voice in addition to engine.
To make tts more user friendly allow user to select which
voice is used for tts playback.
2022-02-14 08:20:14 -07:00
Simone Gaiarin
60645dfda5 Rename kcfg setting to primaryAnnotationToolBar 2021-08-13 21:28:39 +00:00
Simone Gaiarin
54dd173ca6 Use combobox to select default annotation toolbar style 2021-08-13 21:28:39 +00:00
Simone Gaiarin
5d968d5112 Add new toolbar holding the quick annotations minibar action
This toolbar emulates the old version of the Okular annotation bar
2021-08-13 21:28:39 +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
Simone Gaiarin
93a4b47332 Remember last used quick annotation tool
A limitation of the current implementation is that when the quick annotation tools are modified by the user, the first quick annotation tool is selected. This because the order of the quick annotation tools may be changed and some tools may have been deleted.
2021-05-10 05:36:29 +00:00
shenleban tongying
1855f9e4b1 Patch: Let form and sign interface to respect the OSD setting 2021-04-23 03:44:44 +00: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
Nate Graham
d0b9b138cc Switch to existing document in new tab by default
Right now Okular defaults to opening an already-open document in a new
tab when opened a second time, which is a bit odd. Most other
document-based apps will switch to the existing document's instance
instead of opening a new instance of it.

Interestingly enough, Okular has an option to do this, but it's off by
default. I think on by default makes more sense here, to be consistent
with other document-based apps. Since the option exists, people who have
a specialized use case that commonly involves opening multiple instances
of the same document can toggle the option to have that. Everyone wins!

BUG: 432942
FIXED-IN: 21.04
2021-03-17 10:00:54 -06:00
David Hurka
53a9f56668 Presentation config: Replace transitions checkbox by “Instant” item in combobox 2021-02-04 10:24:57 +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
b2c5aa61d7 Read/write certificate settings 2020-12-13 21:31:14 +00: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
681f405390 Merge remote-tracking branch 'origin/release/20.08' 2020-10-29 00:47:39 +01:00
Albert Astals Cid
82590da11a Fix wrong memory access that may cause crash
When editing the quick annotations
2020-10-28 19:35:33 +01:00
Simone Gaiarin
580cbce837 Selectively reparse builtin and quick annotation tool configuration 2020-10-28 05:32:07 +00:00
Laurent Montel
486e05b270 If include is define in .h remove it if it's defined in .cpp too (scripted) 2020-10-23 07:32:28 +02:00
Albert Astals Cid
ddf691fbc9 Port away from deprecated QDesktopWidget::numScreens 2020-09-30 16:09:56 +00:00
Albert Astals Cid
265b85fd6e Remove unneded deprecated KConfigDialogManager::changedMap calls
Both WidgetDrawingTools and WidgetAnnotTools have a NOTIFY changed USER true property so that's what is used anyway
2020-09-30 16:09:56 +00:00
Nate Graham
122528d3fe Add option to disable smooth scrolling
Even though the animated smooth scrolling transitions are now affected
by the global animation speed setting in Plasma, this is not totally
satisfactory for the full pool of people who hate smooth scrolling, as
it does not address the cases of people using Okular outside of Plasma
or people who generally want animations but just not in Okular's
scrolling implementation.

Accordingly, there is now a GUI option to disable smooth scrolling in
Okular's settings window.

BUG: 420755
FIXED-IN: 20.12
2020-09-24 13:43:54 +00:00
Simone Gaiarin
10d92fbeda Store the state of the builtin annotations in a new config key
Using the new configuration key BuiltinAnnotationTools instead of AnnotationTools, we avoid any conflicts in the configuration files due to the fact that the key AnnotationTools had a different meaning in the previous versions of Okular. In particular we avoid the critical problem that the actions in the UI do not match the actual annotation tools. The conflict may happen if the kconf_update script is not executed for some reason (e.g. okular running from flatpack).

BUG: 425354
FIXED-IN: 1.11.1
2020-08-25 10:16:10 +02:00
Albert Astals Cid
19d98d6a74 Run clang-format
find . \( -name "*.cpp" -or -name "*.h"  -or -name "*.c"  -or -name "*.cc" \) -exec clang-format -i {} \;

If you reached this file doing a git blame, please see README.clang-format (added 2 commits in the future of this one)
2020-07-11 09:17:33 +02:00
Laurent Montel
516fb89d94 Use camelcase include. (scripted) 2020-07-08 13:54:37 +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
Nate Graham
5b25ed3356 Hide status bar by default and move navigation controls into toolbar
BUG: 413689
FIXED-IN: 1.9.0
2020-06-03 03:45:42 +00:00
Andi Sardina Ramos
d735d50cde Give the option of switching to a tab if the file is already open instead of opening a new tab
Disabled by default

BUG: 419096
2020-04-23 07:39:32 +00:00
David Hurka
aa6833483e Add some color modes: Invert Lightness/Luma, Hue Shift 2020-03-28 19:13:43 +00:00
David Hurka
2bee66d225 Set buddy and alignment for some QLabels in configuration dialogs 2020-03-16 22:26:11 +01:00
Albert Astals Cid
07a1f616c0 Enable clazy qproperty-type-mismatch 2020-02-21 17:09:46 +01:00
Albert Astals Cid
968e9d6073 Enable clazy old-style-connect 2020-02-20 15:48:08 +01:00
Albert Astals Cid
c10faf0926 Enable clazy qproperty-without-notify 2020-02-20 12:53:28 +01:00
Albert Astals Cid
b001ea2019 CI: Enable a bunch of bugprone- clang-tidy warnings 2019-12-24 10:18:16 +00:00
Albert Astals Cid
0a2287be19 CI: Enable two readability clang-tidy checks
Use jq to filter compile_commands.json to not include the compilation of
autogenerated files, we don't want to check those

Also filter out the synctex folder, since that is imported code
2019-12-23 12:06:49 +01:00
Albert Astals Cid
78cf6bd910 CI: enable more modernize checks
Since unfortunately some of the autogenerated includes don't pass the
checks we do a trick of building out of source and then specifying the
.*/okular/.* path as the only includes we care about
2019-12-18 12:51:13 +01:00
Ahmad Samir
45c72ff0eb Port from deprecated foreach to range-for
autotests/*, conf/* , mobile/* , shell/*, part.cpp, extension.cpp

The code compiles and all unit tests pass (except for the two that
fail on master too).
2019-12-12 22:48:27 +00:00
Volker Krause
6cf2242cd9 Port away from deprecated Bar|Desktop|SmallIcon methods
Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D25553
2019-11-30 10:45:10 +01:00
Abby Berkers
c56a924ab4 Add TeXiFy IDEA support 2019-11-30 01:02:03 +00:00
Jeremy Whiting
67e7dc8f4c Fix building okular without QTextToSpeech by adding ifdefs.
Also hide speech box in gui if built without tts features.
2019-10-09 07:33:52 +00:00
Jeremy Whiting
1b3bb01478 Add user okular user setting for which QtSpeech engine to use.
Default to speechd tts engine, but allow other choices from
okular settings.
Also add combobox to allow selecting the tts engine from config
dialog.

TODO: Change/update tts object when setting is changed.
2019-10-09 07:33:52 +00:00
Laurent Montel
8beef33c05 Port some deprecated methods 2019-09-18 13:41:19 +02:00
Laurent Montel
db0f477119 Port deprecated QLayout::setMargin 2019-09-18 13:35:04 +02:00
Simone Gaiarin
a33cb321df Improve layout of annotation configuration dialogs
Summary:
The config dialog of each annotation tool is now a form layout without group boxes. Everything is aligned.

Reviewers: #okular, #vdg, ngraham, aacid

Reviewed By: #okular, #vdg, ngraham, aacid

Subscribers: sander, davidhurka, aacid, okular-devel, knambiar, ngraham

Tags: #okular

Maniphest Tasks: T8076

Differential Revision: https://phabricator.kde.org/D10859
2019-06-24 07:36:21 +02:00
Laurent Montel
9f90e14dd1 Fix forward declaration 2019-06-03 08:48:32 +02:00
Rajeesh K Nambiar
59a86c3f14 Okular Annotation: add support for line start style for Straight Line tool
Summary: Similar to the line ending style, add support for line start style for the Straight Line annotation tool

Test Plan:
1. Go to Configure annotations
2. Create (or edit existing) Straight Line tool
3. Set the ‘Line Start’ option on Style and Apply
4. Use the Straight Line tool to draw a line and check the line starting style.

Reviewers: #okular, tobiasdeiminger

Reviewed By: tobiasdeiminger

Subscribers: ngraham, tobiasdeiminger, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21238
2019-05-19 09:08:02 +02:00
Rajeesh K Nambiar
db2dcdade3 Okular Annotation: add support for line ending style for Straight Line tool
Summary:
Poppler and Okular already have support for specifying Line End style (`TermStyle`) for the Straight Line tool. Expose the functionality in configuration and hook up the correct slots.

Configure annotations (before):
{F6788150}

Configure annotations (after):
{F6788151}

Straight Line tool with Open Arrow end in action:
{F6788153}

Test Plan:
1. Open a PDF in Okular
2. Enable Review
3. Right click on Review toolbar and Configure annotations
4. Create (or edit existing) Straight Line tool
5. Set the ‘Line End’ option on Style and Apply
6. Use the Straight Line tool to draw a line and check the line ending style.

Reviewers: #okular, #vdg, sander, ngraham

Reviewed By: #vdg, sander, ngraham

Subscribers: pino, sander, davidhurka, tobiasdeiminger, ngraham, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20760
2019-05-07 11:06:14 +02:00
Laurent Montel
f0ed618757 Fix add_test command 2019-04-30 07:02:26 +02:00
Oliver Sander
50bfd9fe86 Presentation: optionally go to prev. page when touching left half of the page
This patch makes switching presentation slides using touch screen taps
more flexible.  It introduces a new configuration option
'Touch navigation' with three possible values:
* 'Tap left/right side to go back/forward':
   Tapping on the left(right) half of the screen
  makes the presentation go to the previous(next) slide.
* 'Tap anywhere to go forward':
  Tapping on the screen makes the presentation go to the
  next slide, no matter where the screen is being tapped
* 'Disabled':
  Screen tapping doesn't do anything.

Previously, only 'Tap anywhere...' was implemented.

This patch does not change the behavior of mouse clicks.

Differential Revision: https://phabricator.kde.org/D18118
2019-03-11 21:09:30 +01:00
Yuri Chornoivan
2b6e75e411 Add TeXstudio support
Summary:
Some people need it because it is now the default TeX editor in distributions.

BUG: 404120

Test Plan: "Settings -> Configure Okular... -> Editor -> TeXstudio". Should work for the reverse search if the tex file is compiled with \usepackage[active]{srcltx}

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: ngraham, okular-devel, kde-doc-english

Tags: #okular, #documentation

Differential Revision: https://phabricator.kde.org/D19272
2019-02-24 22:22:00 +02:00