Commit Graph

399 Commits

Author SHA1 Message Date
Zack Mak
fefcd396a7 Group page scroll into a single function
Renamed wheelAccumulatedDelta to pageScrollDelta
Use QTimer instead of timestamp for scroll idle timeout
2024-05-03 00:46:21 +08:00
Zack Mak
4a6d28ddb8 Merge branch 'master' of https://invent.kde.org/graphics/okular into work/hires_wheel_page_scroll_rework 2024-05-02 21:39:21 +08:00
Sune Vuorela
4509b7bc42 Various minor fixes
Mostly derived from cppcheck runs
2024-04-16 15:44:19 +02:00
Sune Vuorela
bfc3e46f9c A collection of cppcheck fixes 2024-04-15 19:59:42 +02:00
Albert Astals Cid
2c83ccf4fa Fix crash on closing Annot Window if spell checking is enabled
BUGS: 483904
2024-03-22 23:02:41 +00:00
GI GI
caeb12efd1 When pressing shift, hjkl scroll 10 times faster 2024-03-14 15:33:43 +00:00
Sune Vuorela
6c0c020f09 Use setCurrentIndex to set currentIndex
Apparantly select(..) on QItemSelectionModel doesn't update that.
Also skip accessing the currentIndex through the selectionModel. The
select single & clear and select are already also coming from the
selection modes set on the list view.

This ensures signing can work with the preselected (last used / only)
key.
2024-03-14 15:21:42 +00:00
Albert Astals Cid
ac5a8ace6e Fix loading okular preview part
BUGS: 483109
2024-03-11 01:20:00 +01:00
Zentino zylsjsp
7d603a4572 Fix configure web shortcuts popup in kcmshell6
After updating to plasma6, the kcmshell5 changed name to kcmshell6, which caused okular's popup configure menus fail to appear.

This single commit should fix the issue.
2024-03-08 18:40:51 +00:00
Sune Vuorela
56a2a8d3bd cleanups: Sprinkle in a bit unique_ptr
Document memory ownership with unique_ptr's and do a bit of code
cleanups.
2024-03-06 21:57:08 +00:00
Sune Vuorela
717751a1f1 Fix multiline selection
In qt6, QRect::normalized changed it's meaning and it now has a 'span'
that preserves the old meaning.

Use the old span to get the old version of normalized so we can match on
the corners once again.

see https://codereview.qt-project.org/c/qt/qtbase/+/309932 for details.

BUG: 482249
2024-03-05 21:07:10 +00:00
Carl Schwan
7f639c2826 Fix crash when in embedded dummy mode
This is an issue for Kile as they use Okular in the "dummy mode" which
doesn't include the annotation tool.

BUG: 476207
2024-03-05 15:11:36 +00:00
Sune Vuorela
246f6bee79 Fix PAGEVIEW_DEBUG build 2024-03-04 23:42:48 +00:00
Sune Vuorela
111e18eba3 Newer clazy: More PMF 2024-03-04 16:55:11 +01:00
Sune Vuorela
e0fdd8dd14 Newer clazy: Use PMF for actions 2024-03-04 16:50:16 +01:00
Sune Vuorela
97b855c7bb Newer clazy: More QListery 2024-03-04 16:50:11 +01:00
Sune Vuorela
2fcb5f9f9d Newer clazy: Add a few std::as_const 2024-03-04 16:50:06 +01:00
Fushan Wen
677a2467ba Use QStringView more to reduce allocations 2024-02-22 23:20:40 +00:00
Kai Uwe Broulik
450744a37d presentationwidget: Invalidate pixmaps on dpr change
Since the last rendered pixmap is usually reused, its device pixel ratio
can end up different from the `devicePixelRatioF()` of the widget which
is used for most size calculations which leads to an area that might be
unpainted causing visual artifacts.

BUG: 479141
2024-02-21 08:11:07 +00:00
Sune Vuorela
2e008d437c Simplify textentity memory management
After trying to measure the effect of switching TinyTextEntity from a
custom SBO string type to just QString and getting a barely measurable
gain, TinyTextEntity kind of looked like TextEntity, so merge those two.

Also reduce the amount of new/deletes around TextEntities

Implement a string pool for some tiny strings, and various memory optimizations
2024-02-07 14:07:08 +00:00
Sune Vuorela
12e40e0d36 Button groups can span multiple pages
The code needs to be aware of that.

BUG: 479942
2024-01-25 22:14:54 +00:00
Sune Vuorela
0afb1aa6ba Fix last deprecated qvariant type 2024-01-09 18:20:12 +00:00
Laurent Montel
0ece83ebba Fix warning: QLayout: Attempting to add QLayout to PixmapPreviewSelector , which already has a layout 2024-01-04 19:18:36 +01:00
Sune Vuorela
e26731b4fc Port deprecated event positions
Most stuff are in floating point numbers, not rects, nowadays.
2024-01-03 15:49:54 +00:00
Sune Vuorela
a3f0181848 Fix zoom select
There is a surprising api change in KSelectAction that has renamed
triggered, but a base class is still having a different triggered, so
code still compiles.

Rename the signal to the new version

BUG: 479108
2024-01-02 11:21:31 +01:00
Alexander Lohnau
0ad732f666 Remove unused includes and avoid Qt module include
This just causes compile time overhead
2023-12-28 14:14:15 +01:00
Alexander Lohnau
efcc677e0c Explicitly add includes for used KIO jobs
Needed for https://invent.kde.org/frameworks/kio/-/merge_requests/1525
2023-12-28 14:13:29 +01:00
Sune Vuorela
9e0e18176d port from deprecated parentWidget 2023-12-21 14:39:28 +00:00
Sune Vuorela
992af46b6c Port from deprecated QGuiApplication::paletteChanged 2023-12-21 14:18:33 +00:00
Sune Vuorela
6cc8968ee8 Port from deprecated QVariant type 2023-12-21 12:58:31 +00:00
Sune Vuorela
e33007703f Fixup config group porting 2023-12-21 12:31:47 +00:00
Sune Vuorela
3c01b0b68c Shortcuts: Operator+ is deprecated. use operator| instead 2023-12-21 12:19:02 +00:00
Sune Vuorela
70acf82817 Port from removed KConfigGroup keys api 2023-12-21 13:06:42 +01:00
Sune Vuorela
5fe172991e port deprecated filter 2023-12-21 13:06:42 +01:00
Sune Vuorela
a6d5ba93fe Remove a few unused headers 2023-12-20 19:18:33 +00:00
Sune Vuorela
e7fe0bd1bb Remove 'embedded in khtml' option. KHTML is kind of dead 2023-12-20 18:34:10 +00:00
Sune Vuorela
2bce1d03a7 Port away from deprecated associatedWidgets 2023-12-20 15:34:36 +00:00
Sune Vuorela
c217ff0e8a KIO::statDetails deprecated. port (back) to KIO::stat 2023-12-19 12:02:44 +00:00
Sune Vuorela
792425fc77 s/qAsConst/std::as_const/
We now definitely has std::as_const available and Qt has started nagging
about converting to std::as_const.

Implementation is the same for both functions, and qAsConst was a
stop-gap measure until std::as_const was sufficiently available.
2023-12-19 11:46:24 +00:00
Sune Vuorela
a72ad046f7 Remove ifdef'ed out code 2023-12-18 22:56:22 +00:00
Sune Vuorela
5ac1eb0ad6 clazy: make qregularexpression static const 2023-12-18 22:56:22 +00:00
Sune Vuorela
be29ae5eec Make some RegularExpressions static 2023-12-18 22:56:22 +00:00
Sune Vuorela
65bc8a0c1d Fix compile warning 2023-12-18 22:56:22 +00:00
Carl Schwan
010fe10098 videowidget: Port away from deprecated methods 2023-12-18 22:56:22 +00:00
Sune Vuorela
8a1ef0cc84 Minor last fixes 2023-12-18 22:56:22 +00:00
Sune Vuorela
74d017b174 Adapt part ctor 2023-12-18 22:56:22 +00:00
Sune Vuorela
137be017b5 Fix int/long compare 2023-12-18 22:56:22 +00:00
Sune Vuorela
aea7e5f637 Action names in Presentation Widget 2023-12-18 22:56:22 +00:00
Sune Vuorela
162a4afcdf Remove global strut usage, it's 0,0
We aren't setting it anywhere
2023-12-18 22:56:22 +00:00
Sune Vuorela
0ba0e6f087 Fix combined modifiers in annotationactionhandler 2023-12-18 22:56:22 +00:00