* 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.
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.
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.
Reason in this context is
(Optional) The reason for the signing, such as ( I agree ... ).
But since it's not really obvious what it means, showing
Reason: Not Available
is probably more weird to users than simply not showing it at all
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
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
The current code goes through KMimeTypeTrader to find a ps or PDF part.
In both cases it's highly likely that it will be okularpart so we can use that directly.
QLayout: Attempting to add QLayout "" to DlgGeneral "", which already has a layout
QLayout: Attempting to add QLayout "" to DlgPresentation "", which already has a layout
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.
The method qApp->devicePixelRatio() should only be used under
special circumstances. The documentation of QGuiApplication says:
"Returns the highest screen device pixel ratio found on the system.
[...] Use this function only when you don't know which window
you are targeting. If you do know the target window,
use QWindow::devicePixelRatio() instead."
The Okular code used qApp->devicePixelRatio() a few times without
reason. Few people noticed this, because apparently only Windows
and Wayland can set per-screen dprs. This patch replaces those
calls with the correct QWindow call.
The PixmapRequest constructor expected width and height in logical
pixels, and scaled them to device pixels. However, not knowing what
screen the request is for, it had to use qApp->devicePixelRatio()
for the scaling. That value may not be correct if not all screens
use the same scaling.
Fix this by introducing a new constructor that takes the device
pixel ratio as an additional argument, and deprecating the old
constructor.
* 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.
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
This adds a class PreferredScreenSelector, which is a QComboBox that
holds items for each connected screen, and provides a preferredScreen
property which is accessed by KConfigDialogManager.
This class also allows to remember a disconnected screen by adding
a temporary item “Screen xy (disconnected)”.
The Table Select tool no longer automatically copies its
contents to the clipboard, but only to the selection clipboard.
(Middle-click paste clipboard.) Instead, after creating
the table, the user can right-click to bring up a popup
menu with the action "Copy Table Contents to the Clipboard".
Clicking on this will copy the table contents to the clipboard.
Ctrl+C also works.
BUG: 402110
...entering the pwd for the certificate store
Also Move CertificateStoreImpl to PopplerCertificateStore, since
PopplerCertificateStore was declared but never defined and use it
in CertificateTools to get the certificate list instead of calling
the poppler classes directly
* Don't make WidgetAnnotation know about signatures stuff, widget
annotations are for multiple things
* Don't create an "empty" widget annotation and then call sign on it
(which is wrong because widget annotations can be multiple things),
just say sign the document with this data (cert, l&f, etc)
* Remove the "management" functionality from CertificateTools it was
only visual, i.e. it didn't really add/remove certificates
* Ask for the NSS password (if needed)
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
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
QScrollerPrivate::setDpiFromWidget() before Qt 5.14 crashes
when the target widget does not intersect a physical screen,
because QDesktopWidget returns screen index `-1` in this case,
which leads to an out-of-range read from QApplication::screens(),
which leads to a segfault when reading from an invalid QScreen* pointer.
This adds a workaround that checks for the `-1` situation,
and then tries to resize PageView temporarily to intersect at least some screen.
BUG: 425188
FIXED-IN: 20.12
When making a flick using the mouse or the touchscreen and then slowly
dragging the pages in the same direction with the flick, it unintentionally
reenters the flicking state after a mouse button release and it's quite
annoying. The commit reduces the maximum time before the next flick.
Steps to reproduce:
1) Flick in direction A.
2) While the view is coasting, decide that you want to stop close to the current position.
3) Grab the view (still coasting), and drag it slowly in direction A.
4) When you reached the desired point, stop your movement, and release the view.
5) QScroller interprets this release as “accelerating flick”,
and makes the view coast faster in direction A.
Upstream bug is QTBUG-88249; QScroller ignores MinimumVelocity for accelerating flicks.
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