Commit graph

146 commits

Author SHA1 Message Date
Josef Filzmaier
1d90817660 Replace kWarning with qWarning
Even in comments
2021-07-16 00:11:53 +02:00
Alexander Lohnau
7c9322ad7a
Remove defunct and unused knsrc file 2021-07-03 17:44:07 +02:00
David Hurka
b805603c58 CursorWrapHelper: Do not crash on Wayland.
According to https://bugs.kde.org/show_bug.cgi?id=437334
the cursor position is not necessarily known on Wayland.
That would trigger the Q_ASSERT_X, so this patch removes
it. This does not solve the problem that we can not wrap
the cursor, but it prevents crashing Okular if using the
debug build on Wayland. You’re reading rectangular text.

BUG: 437334
CCBUG: 439471
2021-07-02 21:36:13 +00:00
Albert Astals Cid
ec1fda4f87 Merge remote-tracking branch 'origin/release/21.04' 2021-06-27 01:13:50 +02:00
Gerd Wachsmuth
e1a14b4a1a Request Pixmaps in slotRelayoutPages 2021-06-26 10:13:34 +00:00
Simone Gaiarin
230a68d537 Uncheck mouse mode action when annotation tool selected
When the annotation is unchecked the previous mouse mode is restored.

The slot slotMouseNormalToggled is changed back to its original version
of slotSetMouseNormal given that we needed to pass the checked state
only to detach the annotations, and we do it in the lambda now.

BUG: 398108

BUG: 437377

FIXED-IN: 21.08
2021-06-19 14:12:19 +00:00
Simone Gaiarin
67a54bd8e0 Save zoom mouse mode action to a variable 2021-06-19 14:12:19 +00:00
Simone Gaiarin
44f7a6de25 Do not unselect annotation tool in none selected 2021-06-19 14:12:19 +00:00
Ahmad Samir
960dc24674 Fix signatures.html help:/ url
From a glimpse at the khelpcenter code, I think it indexes all the html
pages in a manual, then finds the requested page by searching for the filename
(I am not 100% sure, though), for example either of these two urls work:
help:/okular/index.html#adding_digital_signatures
help:/okular/signatures.html#adding_digital_signatures

but when falling back to opening the manual at docs.kde.org in a web browser
that indexing isn't available, so we have to be a bit more precise with the
urls, so use the second url.

(cherry picked from commit df02881611)
2021-06-17 00:50:01 +02:00
Ahmad Samir
df02881611 Fix signatures.html help:/ url
From a glimpse at the khelpcenter code, I think it indexes all the html
pages in a manual, then finds the requested page by searching for the filename
(I am not 100% sure, though), for example either of these two urls work:
help:/okular/index.html#adding_digital_signatures
help:/okular/signatures.html#adding_digital_signatures

but when falling back to opening the manual at docs.kde.org in a web browser
that indexing isn't available, so we have to be a bit more precise with the
urls, so use the second url.
2021-06-16 22:47:51 +00:00
Alexander Lohnau
ac083e44e3 Make meaning of sponsoring note more clear 2021-06-10 08:11:56 +00:00
Alexander Lohnau
356bd482be Convert license headers to SPDX for newly added files 2021-06-10 08:11:56 +00:00
Alexander Lohnau
83dfef19ab Put author and mail on same SPDX-FileCopyrightText line 2021-06-10 08:11:56 +00:00
Alexander Lohnau
24c75071be Move sponsoring note outside of SPDX-FileCopyrightText statement 2021-06-10 08:11:56 +00:00
Alexander Lohnau
2f193a63de Convert license headers to SPDX 2021-06-10 08:11:56 +00:00
Albert Astals Cid
73c3fa57f9 Merge remote-tracking branch 'origin/release/21.04' 2021-06-04 23:45:06 +02:00
Albert Astals Cid
e457ceb731 FormLineEdit: Don't run focusin action when gaining focus because of window management
Adobe Reader doesn't do it, and with reason, because otherwise we end up
with:
 * Run focus in script
 * script shows alert()
 * field loses focus and gains it again once the alert() is closed
 * infinite loop

BUGS: 436990
2021-06-04 21:17:41 +00:00
Albert Astals Cid
b518c01f1c FormLineEdit: Don't run focusout/formatfield actions when losing focus because of window management
Adobe Reader doesn't do it and if we do it can end up crashing because
we end up running two focusout actions in parallel and our script system
is not prepared for that:

Scenario:
 * Tab out of a field
 * Script for that focusout runs
 * focus goes to next field
 * script for that focusout shows an alert()
 * second focusout script for that field runs while the first is running
 * bad stuff

BUGS: 435833
2021-06-04 21:17:41 +00:00
Albert Astals Cid
812adaa26d FormLineEdit: Move editing=false up in the focus out event
The fact that we don't want to process the focusout/formatfield actions
doesn't mean we are still editing the field
2021-06-04 21:17:41 +00:00
Albert Astals Cid
47b56fb8df Merge remote-tracking branch 'origin/release/21.04' 2021-06-03 00:11:01 +02:00
Albert Astals Cid
92f4ade00c Mark items with name in toolsQuick as default
This way we know we must translate their names when showing it to the
user
2021-06-01 21:34:40 +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
Albert Astals Cid
1954d43f05 0 -> Okular::Settings::EnumViewMode::Single 2021-05-18 19:10:43 +00:00
Nicolas Fella
6009e9f526 Use QIcon::fromTheme instead of KIconLoader::loadIcon 2021-05-11 20:23:41 +00:00
Simone Gaiarin
0a41305160 Fix old quick annotations not deleted after reparse
Also refactored the code to populate the quick annotations in order to re-add only the quick annotions and not config actions
2021-05-10 05:36:29 +00:00
Simone Gaiarin
c925b224de Fix crash when repopulating quick annotations action 2021-05-10 05:36:29 +00:00
Simone Gaiarin
5d251b725b Use new ToggleActionMenu constructor interface 2021-05-10 05:36:29 +00:00
Simone Gaiarin
068d19de27 Add action to quick annotation menu to show the builtin annotation toolbar 2021-05-10 05:36:29 +00:00
Simone Gaiarin
388b3e54dc Rename action aShowToolBar to aToolBarVisibility 2021-05-10 05:36:29 +00:00
Simone Gaiarin
87fa366c4a Adapt annotation toolbar tests to new toggleable quick annotation 2021-05-10 05:36:29 +00:00
Simone Gaiarin
4408d13886 Refactor code for populating the quick annotations action 2021-05-10 05:36:29 +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
Simone Gaiarin
3d55184116 Do not uncheck quick annotations when the toolbar is hidden 2021-05-10 05:36:29 +00:00
Simone Gaiarin
03b2346e4e Uncheck quick annotation when repopulating the quick tools menu
This prevents undefined states when the currently selected quick annotation is modified or deleted in the annotation settings.

BUG: 426026
FIXED-IN: 21.08
2021-05-10 05:36:29 +00:00
Simone Gaiarin
616b03358f Warn user that quick stamp annotations in PDF are an experimental feature 2021-05-10 05:36:29 +00:00
Simone Gaiarin
f8fe30e687 Do not show annotation toolbar when quick annotation tool is selected 2021-05-10 05:36:29 +00:00
Simone Gaiarin
0fb2058e2a Make quick annotation tools checkable
CCBUG: 425438
2021-05-10 05:36:29 +00:00
Simone Gaiarin
6b61909ac5 Select quick tool directly without proxying a builtin annotation 2021-05-10 05:36:29 +00:00
Simone Gaiarin
3f18367efd Refactor code for selecting annotation tool 2021-05-10 05:36:29 +00:00
Simone Gaiarin
e000489268 Refactor selection of last used annotation tool 2021-05-10 05:36:29 +00:00
Nicolas Fella
e73bf99e58 Remove GuiUtils::iconLoader
It's unused
2021-05-05 21:36:34 +00:00
Nicolas Fella
b0542ca0b2 Use QIcon::fromTheme instead of GuiUtils::iconLoader
The only relevant behavior of the custom icon loader is the automatic
fallback to <share>/okular/pics, which we can do ourselves with QIcon
API.
2021-05-05 21:36:34 +00:00
Nicolas Fella
1e9711ba37 Add <share>/okular/pics to icon search path
This is automatically done when using KIconLoader, but not when using another QIcon implementation.
2021-05-05 21:36:34 +00:00
Gerd Wachsmuth
6a6b6ca345 Fix bug: select browse tool after trim select 2021-04-25 13:43:18 -06:00
Nicolas Fella
ef5254b020 Remove some unused includes 2021-04-25 14:27:46 +02:00
shenleban tongying
1855f9e4b1 Patch: Let form and sign interface to respect the OSD setting 2021-04-23 03:44:44 +00:00
David Hurka
5a58d3bb8e Simplify ToggleActionMenu
* Remove the ImplicitDefaultAction intelligence, so ToggleActionMenu is
  not more than a KActionMenu with setDefaultAction().
* Instead, reset the default action when it gets removed from the menu().
  This is done by filtering QActionEvent from menu().
* Add an autotest for ToggleActionMenu.

This replaces prior efforts to fix problems in ToggleActionMenu
in !245 and !254, following the discussion on the virtual meeting
at 2021-02-26.

6b26a2b4b and 1786e6c99 have already ported PageView and
AnnotationActionHandler to the simplified interface.
2021-04-23 01:54:42 +00:00
Albert Astals Cid
394001017e Merge remote-tracking branch 'origin/release/21.04' 2021-04-22 22:01:23 +02:00
Gerd Wachsmuth
f6b58ed804 Fix bug: select browse tool after trim select 2021-04-21 08:01:10 +02:00
Gerd Wachsmuth
61551d2356 Fix: Viewport coords normalized w.r.t. full page
The coordinates in Viewport.rePos are normalized on the full page. In
two functions within pageview.cpp, these were treated as coordinates on
the cropped page.

CCBUG: 198427

This partially fixes the bug 198427 in the case that the cropping of the
target pages (and the pages around the target) is known at the time the
link is clicked. That is, it works if

- One uses 'Trim To Selection'
- One uses 'Trim To Margin' and has already viewed at the target
page(s).

In the case that the cropping of the page at the target is unknown, we
still end up at the wrong position.
2021-04-20 07:48:51 +02:00