Commit Graph

56 Commits

Author SHA1 Message Date
Luis Ángel San Martín
2bebec95bf Save magnifying glass size and zoom level 2024-03-02 12:14:01 +01:00
Luis Ángel San Martín
5706407778 Add options for disabling scroll animation 2023-08-26 10:18:52 +02:00
Luis Ángel San Martín
f3249e4053 Add shortcuts to control the double page mode offset 2023-07-09 10:44:43 +02:00
Luis Ángel San Martín
68ece533e1 Replace Q_OS_MAC with Q_OS_MACOS 2023-06-04 20:55:11 +02:00
Luis Ángel San Martín
315d2deced Don't use Q_OS_MAC for ui specifics, Y_MAC_UI is the replacement 2023-05-23 18:51:33 +02:00
Luis Ángel San Martín
0afe2c33b7 Fix currentPage value when closing YACReader in double page mode
If the latest page of the comic is visible, that should be the currentPage value so YACReaderLibrary can mark the comic as read.
2022-12-27 09:26:55 +01:00
Igor Kushnir
24e42f76d2 Make Magnifying glass shortcuts work with non-Latin layouts
Viewer::keyPressEvent()'s and MagnifyingGlass::keyPressEvent()'s custom
matching of these shortcuts is the same as
MainWindowViewer::keyPressEvent()'s before the recent commit
"Reader: make 3 keyboard shortcuts work with non-Latin layouts". That
commit's message details the issues with the custom code.

The Magnifying glass actions are now enabled/disabled when
loadedComicActions are enabled/disabled - for the same reason (see the
recent "Reader: make 12 keyboard shortcuts work with non-Latin layouts"
commit). In addition, Viewer::keyPressEvent() propagated the Magnifying
glass shortcuts to MagnifyingGlass only when it was visible. Therefore
showing/hiding Magnifying glass also enables/disables these actions.
Note that Viewer::showMagnifyingGlass() shows Magnifying glass only if
render->hasLoadedComic() returns true, so
MainWindowViewer::setMglassActionsEnabled slot can be connected directly
to Viewer::magnifyingGlassVisibilityChanged signal without checking this
condition again.
2022-01-15 18:02:31 +02:00
Igor Kushnir
5254e66da3 Fix a typo in Viewer::magnifyingGlassShowed name
Make Viewer::magnifyingGlassIsVisible() const.
2022-01-15 18:02:30 +02:00
Igor Kushnir
efe9a1b995 MagnifyingGlass: get rid of C-style casts to Viewer*
qobject_cast<const Viewer *> improves const correctness.
QLabel::pixmap() is const-qualified => make Viewer::pixmap() const too.

Return non-const QPixmap from Viewer::pixmap() to let compiler move the
return value at the function's call sites.

Introduce a named constant maxRelativeDimension. Change its type from
float to double, which usually multiplies faster on x86-64.

Remove redundant parentheses to improve readability.
2022-01-15 18:02:30 +02:00
Igor Kushnir
a1bb7735d2 Reader: make 12 keyboard shortcuts work with non-Latin layouts
Viewer::keyPressEvent()'s custom matching of these shortcuts is the same
as MainWindowViewer::keyPressEvent()'s before the recent commit
"Reader: make 3 keyboard shortcuts work with non-Latin layouts". That
commit's message details the issues with the custom code.

render->hasLoadedComic() condition in Viewer::keyPressEvent() becomes
true when Comic::_loaded is set to true. This always happens right after
Comic emits its numPages() signal. That is why the 12 fixed actions are
now enabled when Viewer emits its comicLoaded() signal, which is
connected to Render::numPages, which in turn is connected to
Comic::numPages signal.

The 12 fixed actions are now disabled when most other actions are
disabled: before a comic is opened and on comic opening error.
2022-01-15 18:02:30 +02:00
Igor Kushnir
feaee915bc Extract Viewer::(vertical|horizontal)ScrollStep() 2022-01-15 18:02:30 +02:00
Igor Kushnir
133b547e7a Remove unused *Step* data members from Viewer 2022-01-15 18:02:30 +02:00
Luis Ángel San Martín
77c96de0ea Remove unused resources 2022-01-15 15:51:59 +01:00
Luis Ángel San Martín
e452178adb Log the device pixel ratio used while rendering 2022-01-15 11:54:40 +01:00
Luis Ángel San Martín
565bc3a5d0 Replace all uses of devicePixelRatio with devicePixelRatioF 2022-01-14 19:22:50 +01:00
Luis Ángel San Martín
e532fa4439 Use devicePixelRatioF instead of devicePixelRatio when rendering pages 2022-01-13 23:12:05 +01:00
Luis Ángel San Martín
d20958c14f Make forward and backward mouse buttons turn pages 2022-01-13 23:05:49 +01:00
Luis Ángel San Martín
dcb7e6e0c6 Add settings to control the page turn behavior on scroll 2022-01-13 23:04:22 +01:00
Luis Ángel San Martín
4bee296096 Strict qt5.15 breaks poppler 2021-10-23 17:11:50 +02:00
Luis Ángel San Martín
81ff663acd Use qt5.15 2021-10-19 00:00:09 +02:00
Luis Ángel San Martín
a7e3c41f34 QLabel QPixmap *pixmap() method is deprecated
const QPixmap should perform as fast as a pointer
there is a replacement version for Qt5 but it requires Qt5.15, so we are using indirection witch is unsafer but it should be ok as all the action is happen in the main thread
2021-10-19 00:00:08 +02:00
Luis Ángel San Martín
ae43f23c85 Use angleDelta
pixelDelta is only provided in systems that support it
2021-10-19 00:00:08 +02:00
Luis Ángel San Martín
740eab5025 Update QWheelEvent delta usage 2021-10-19 00:00:08 +02:00
Luis Ángel San Martín
5f55dab0cc Do not write unused values 2021-10-19 00:00:08 +02:00
Luis Ángel San Martín
e1ed292a91 Convert emit(signal()) calls to emit signal() 2021-10-19 00:00:07 +02:00
Luis Ángel San Martín
5aa02a19bb clang-format 2021-10-18 21:56:52 +02:00
Luis Ángel San Martín
0dbad65f7f Don't use the wheel stop in full page mode 2021-09-28 16:21:43 +02:00
Luis Ángel San Martín
b8ad2b540b
Merge branch 'develop' into clazy_autorefactoring 2021-09-26 08:52:23 +02:00
Felix Kauselmann
40d4d224be Viewer: Always start GoTo flow on correct page 2021-07-30 08:58:39 +02:00
Felix Kauselmann
5b66153390 YACReader/viewer: Convert a bunch of loosely related signals to new syntax 2021-06-29 13:53:12 +02:00
Felix Kauselmann
5dbbaad73b GoTo flows: Untangle and refactor goTo signal to new syntax 2021-06-29 13:53:12 +02:00
Felix Kauselmann
47324e7f22 Comic/Render: Use overloads refactor some SIGNAL/SLOT connections to new syntax 2021-06-29 13:53:12 +02:00
Felix Kauselmann
8377de7c3e Clazy: Use fixits to refactor some old style signal connections 2021-06-29 13:53:12 +02:00
Luis Ángel San Martín
dee557c518 Use a constant reference for passing QKeySequence to moveAction 2021-01-17 11:11:25 +01:00
Stefan Malewski
08ce8c3c65 Fixed move action shortcuts 2021-01-17 11:06:45 +01:00
Stefan Malewski
c73f28cca1 KeySequence passed by reference 2021-01-17 11:06:45 +01:00
Stefan Malewski
fccf9ab0af Fixed shortcuts for move actions 2021-01-17 11:06:45 +01:00
Luis Ángel San Martín
c7cf012d51 Remove commented code 2021-01-16 14:34:28 +01:00
Luis Ángel San Martín
611d4c5e26 Add support for detecting manga issues in YACReader
When an issues is open from YACReaderLibrary we can check if it is a manga an update the UI to enable manga reading.

This also fixes going previous/next from the ui/shortcuts
2021-01-16 14:29:00 +01:00
Luis Ángel San Martín
4739376f5b Use new methods 2020-09-07 18:13:55 +02:00
Felix Kauselmann
acce89ef78
Update viewer.cpp 2020-09-07 08:54:23 +02:00
Felix Kauselmann
232181eef7 Reader: Add option to stop enlarging images in fit to width and height 2020-09-02 09:27:53 +02:00
Luis Ángel San Martín
a2b4b88801 Format 2020-08-31 16:04:26 +02:00
Igor Kushnir
0da59285cf Reader: fix QTimer-related memory leaks 2020-08-31 15:44:50 +02:00
Igor Kushnir
b0082101d3 Reader: don't forget comic info visibility
The timer used to time out and invoke Viewer::informationSwitch() twice
before getting destroyed. This caused the following bug:
    1. Press 'I' to Show Info in YACReader.
    2. Restart YACReader (exit and run again). Info is visible.
    3. Restart YACReader one more time. Info is hidden.

Apparently, when informationSwitch() was called a second time soon after
the first one, informationLabel didn't hide for some reason, but the
wrong value (false) was stored at the SHOW_INFO key in Configuration.
2020-08-31 15:44:50 +02:00
Igor Kushnir
8820c8769b Reader: add support for horizontal mouse wheel
Without this commit the horizontal wheel on a two-wheel mouse acts the
same as the vertical wheel in YACReader.

horizontalScroller is used analogously to verticalScroller in
Viewer::scrollTo(). So I made the horizontal wheel work analogously to
the vertical wheel except for moving to the next or previous page.
2019-09-18 15:32:35 +02:00
Luis Ángel San Martín
0892d2a022 Fix saving progress in double page mode
If the current page is being displayed we don't change anything, if is it not, we pick the current index page.
2019-08-21 18:46:10 +02:00
Luis Ángel San Martín
bb334cfd50 Use auto to avoid duplicating the type name 2019-06-01 16:04:48 +02:00
Luis Ángel San Martín
923ad40057 Use nullptr instead of 0 2019-06-01 16:04:48 +02:00
Luis Ángel San Martín
e3ec56aa43 Format code using clang-format 2019-05-30 19:46:37 +02:00