Commit graph

19 commits

Author SHA1 Message Date
Alexander Lohnau
2f193a63de Convert license headers to SPDX 2021-06-10 08:11:56 +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
Nicolas Fella
e73bf99e58 Remove GuiUtils::iconLoader
It's unused
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
shenleban tongying
1855f9e4b1 Patch: Let form and sign interface to respect the OSD setting 2021-04-23 03:44:44 +00:00
Albert Astals Cid
89a90cf0b5 Merge remote-tracking branch 'origin/release/21.04' 2021-04-15 16:44:45 +02:00
Nate Graham
dea517bb69 Use icons-only "Show Sidebar" Button with new icon, if available
This commit makes the "Show Sidebar" button that's on the toolbar by
default use the new `sidebar-expand` icon, if present. If not, it falls
back to the old `view-sidetree` icon for compatibility's sake.

We also make thie button icons-only by default, as the new icon is
clearer than the old one. This saves some horizontal space in the
defualt toolbar, which is now quite wide.
2021-04-14 16:31:52 -06:00
Albert Astals Cid
ff5f4cbc45 Open the signed document on the page with the new signature
It's still not perfect because it probably won't show the signature
since signatures "usually" go to the bottom of the page and we're only
focusing on that page, which means the beginning which depending on zoom
settings may very well not include the signature, but at least it's
closer
2021-04-14 22:05:38 +02:00
David Hurka
53a9f56668 Presentation config: Replace transitions checkbox by “Instant” item in combobox 2021-02-04 10:24:57 +00:00
David Hurka
f69026dd7f Disable KXMLGUI workaround for adding toolbars at ≥ KF 5.78 2021-02-03 13:58:25 +00:00
Albert Astals Cid
9d0800a57a Merge remote-tracking branch 'origin/release/20.12' 2020-12-27 12:10:55 +01:00
Albert Astals Cid
9e23338b00 Fix opening markdown files
In d2ae2c283d we introduced a tweak that
broke opening markdown files.

what we really want is this:
 * If the mimetype from the filename is text (or children) but looking
   at the data says it's not text, then try opening first opening with
   the data suggeted mimetype
 * But if the data suggested mimetype says it's text, use the filename
   suggested mimetype since for example, the only way to really
   differentiate markdown from text is the filename, so trust that

BUGS: 430538
2020-12-27 00:16:58 +00:00
Albert Astals Cid
49f784ecf9 When signing save to a new file, not over the current one 2020-12-13 21:31:14 +00:00
Laurent Montel
3f58639e06 operator+/- is disabled for QFlags in qt6 2020-12-09 08:34:49 +01:00
Albert Astals Cid
6f761b9e3a Merge remote-tracking branch 'origin/release/20.12' 2020-11-27 00:29:36 +01:00
Albert Astals Cid
239827baad Rework how we open urls that have a #
Previously if it was a remote url that had # and a . after the # we
assumed the url had no fragment and everything was filename.

We don't do that anymore, what we do now is try to open the url as
parsed, i.e. before the # is the filename after is the fragment, and if
that fails we try to open everything as filename and nothing as
fragment.

Unfortunately given how kpart internals handle opening local vs remote
urls we need to do this in two places.

Also we have to remove the test that checked that the url was mangled at
the shell level because we don't do that anymore. Unfortunately can't
add a test for the new codepage since it would involve starting an http
server ^_^

Filenames:
  source2e.pdf
  foo#bar.pdf

What works:
 * okular http://localhost/source2e.pdf#subsection.68.3
 * okular file:///srv/http/source2e.pdf#subsection.68.3
 * okular source2e.pdf#subsection.68.3 (in the /srv/http folder)
 * okular source2e.pdf#2
 * okular http://localhost/foo#bar.pdf
 * okular file:///srv/http/foo#bar.pdf
 * okular foo#bar.pdf (in the /srv/http folder)

What doesn't work:
 * okular http://localhost/foo#bar.pdf#2

I think it's a fair limitation that if you want to open a file that contains # in the name and also use a # page marker you need to use the encoded url like okular http://localhost/foo%23bar.pdf#2
after all things like firefox will totally fail opening http://localhost/foo#bar.pdf and will just work if you give the encoded url

BUGS: 426976
2020-11-26 10:07:58 +00:00
Albert Astals Cid
d2ae2c283d More fine tuning of the mime of the opened file
In fba90677fc we introduced a "if we're
told this is a text file let's check the mime of the content only since
text files never fail to open".

This extends it to anything that inherits from text now, so if you
rename a PDF file to bla.php it still tries to open as a pdf first and
if that files as a php file
2020-11-25 22:41:34 +00: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
Renamed from part.cpp (Browse further)