We don't need to calculate sizing ourselves, widgets do that.
We also don't need to set maximum size ourselves manually, we already
use KSqueezedLabels to avoid having to do that for very large strings.
spacingHint()/marginHint() just returned the defaults from QApplication
even in kdelibs (4), so this code was useless.
The direct port would look something like this:
page2Layout->setMargin(QApplication::style()->pixelMetric(QStyle::PM_DefaultChildMargin););
page2Layout->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing););
For reference, not even Konqueror uses the toolBarFont() for its
sidebar.
In fact, this seems to be the only usage of toolBarFont() I could find
in any KDE application.
At least in PDF which is the only backend with form support
Radio buttons are a bit of a mess since they're supposedly also uncheckable if NoToggleToOff is not set but in Adobe Reader they never are
BUGS: 357743
Drops the x11 fallback. We were falling back to QX11Extras that were in
fact using QScreen internally.
Also remove the QDesktopWidget fallbacks for the same reason.
Drops some API for fetching the dpi and unifies it with ::realDpi(QWidget).
Based on Sebas's patch.
Reviewed by Albert.
REVIEW: 126913
This removes kdelibs4support for all generators except the mobipocket one.
The test executable for kimgio needs some windows fixes too, so I'll try
to make a separate review for that.
REVIEW: 126375
At least in PDF which is the only backend with form support
Radio buttons are a bit of a mess since they're supposedly also uncheckable if NoToggleToOff is not set but in Adobe Reader they never are
BUGS: 357743
This patch changes multiline QStringLiterals to QString::fromLatin1
as QStringLiterals doesn't understand multiline strings on windows.
Also, strncasecmp is replaced by the portable qstrnicmp function provided
by QByteArray header.
REVIEW: 126379
Right now, fade transition is always done in 100 frames. If the intended duration is, say, 1 second, the actual duration can easily be a few seconds instead, due to the limited CPU power (on my laptop with core i5, those 100 frames take 2 seconds).
I propose a patch that changes the number of frames to 20 * (duration in seconds). 20 FPS still looks completely smooth to me.
REVIEW: 125310
BUGS: 352876
Changes
C1. Added submenu, moved "Trim margins" (TM mode) to it and added "Trim To Selection" (TS mode).
C2. Activating "Trim To selection" enters a new mousemode, similar to RectSelect for defining a viewport.
C3. Once a viewport has been defined, it serves as a viewport for all pages in the document.
C4. Left/Right pages are not treated differently.
Manual Testing
T1. Switching between modes enforces at most one active.
T2. Can deactivate a mode by selecting it again from the menu.
T3. When draggin bbox selection, clicking outside page does not crash.
T4. When in "Facing Pages" mode, mouse release must be over any page (or is ignored).
T5. Normalized bbox coords are computed relative to page indicated by point of mouse release.
T6. Behave as expected when switching between any pair of No Trim/Trim Margins/Trim To Selection.
T7. TM mode persisted across app restarts (existing behavior).
T8. TS mode forgotten across app restarts (as desired).
T9. Exiting and reselectin "Trim To Selection" prompts for new bbox.
T10. Choosing a small Trim bbox enforces minimium dimensions size (As percentag of total), as
it does in TM mode, because of the "scale big and crop down" implementation, to avoid huge pixmaps.
TS mode minimum set at 20% (vs. TM mode's 50%).
REVIEW: 124716
BUGS: 351156
This was broken since commit 077689c4 when this got ported away from
KAction. The code attempted to add a parent QMenu to the QAction
instances nested below that parent. I'm quite surprised that it didn't
crash, but checkable actions do not go well with actions that have
nested menus, apparently.
I haven't checked the rest of the code for similar mistakes, but I don't
see any other case of this bug in Okular's menus when reading PDFs.
REVIEW: 124842
Extend the drawing tool section in top bar with an eraser tool,
which removes parts of the lines that have been drawn before.
FEATURE: 343774
REVIEW: 124689