Commit Graph

50 Commits

Author SHA1 Message Date
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
5254e66da3 Fix a typo in Viewer::magnifyingGlassShowed name
Make Viewer::magnifyingGlassIsVisible() const.
2022-01-15 18:02:30 +02:00
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
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
feaee915bc Extract Viewer::(vertical|horizontal)ScrollStep() 2022-01-15 18:02:30 +02:00
133b547e7a Remove unused *Step* data members from Viewer 2022-01-15 18:02:30 +02:00
77c96de0ea Remove unused resources 2022-01-15 15:51:59 +01:00
e452178adb Log the device pixel ratio used while rendering 2022-01-15 11:54:40 +01:00
565bc3a5d0 Replace all uses of devicePixelRatio with devicePixelRatioF 2022-01-14 19:22:50 +01:00
e532fa4439 Use devicePixelRatioF instead of devicePixelRatio when rendering pages 2022-01-13 23:12:05 +01:00
d20958c14f Make forward and backward mouse buttons turn pages 2022-01-13 23:05:49 +01:00
dcb7e6e0c6 Add settings to control the page turn behavior on scroll 2022-01-13 23:04:22 +01:00
4bee296096 Strict qt5.15 breaks poppler 2021-10-23 17:11:50 +02:00
81ff663acd Use qt5.15 2021-10-19 00:00:09 +02:00
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
ae43f23c85 Use angleDelta
pixelDelta is only provided in systems that support it
2021-10-19 00:00:08 +02:00
740eab5025 Update QWheelEvent delta usage 2021-10-19 00:00:08 +02:00
5f55dab0cc Do not write unused values 2021-10-19 00:00:08 +02:00
e1ed292a91 Convert emit(signal()) calls to emit signal() 2021-10-19 00:00:07 +02:00
5aa02a19bb clang-format 2021-10-18 21:56:52 +02:00
0dbad65f7f Don't use the wheel stop in full page mode 2021-09-28 16:21:43 +02:00
b8ad2b540b Merge branch 'develop' into clazy_autorefactoring 2021-09-26 08:52:23 +02:00
40d4d224be Viewer: Always start GoTo flow on correct page 2021-07-30 08:58:39 +02:00
5b66153390 YACReader/viewer: Convert a bunch of loosely related signals to new syntax 2021-06-29 13:53:12 +02:00
5dbbaad73b GoTo flows: Untangle and refactor goTo signal to new syntax 2021-06-29 13:53:12 +02:00
47324e7f22 Comic/Render: Use overloads refactor some SIGNAL/SLOT connections to new syntax 2021-06-29 13:53:12 +02:00
8377de7c3e Clazy: Use fixits to refactor some old style signal connections 2021-06-29 13:53:12 +02:00
dee557c518 Use a constant reference for passing QKeySequence to moveAction 2021-01-17 11:11:25 +01:00
08ce8c3c65 Fixed move action shortcuts 2021-01-17 11:06:45 +01:00
c73f28cca1 KeySequence passed by reference 2021-01-17 11:06:45 +01:00
fccf9ab0af Fixed shortcuts for move actions 2021-01-17 11:06:45 +01:00
c7cf012d51 Remove commented code 2021-01-16 14:34:28 +01:00
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
4739376f5b Use new methods 2020-09-07 18:13:55 +02:00
acce89ef78 Update viewer.cpp 2020-09-07 08:54:23 +02:00
232181eef7 Reader: Add option to stop enlarging images in fit to width and height 2020-09-02 09:27:53 +02:00
a2b4b88801 Format 2020-08-31 16:04:26 +02:00
0da59285cf Reader: fix QTimer-related memory leaks 2020-08-31 15:44:50 +02:00
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
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
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
bb334cfd50 Use auto to avoid duplicating the type name 2019-06-01 16:04:48 +02:00
923ad40057 Use nullptr instead of 0 2019-06-01 16:04:48 +02:00
e3ec56aa43 Format code using clang-format 2019-05-30 19:46:37 +02:00
06a36bfa40 reorder initialization of Viewer::Viewer 2019-04-01 09:16:09 +02:00
d5a11fb16b Add .gitattributes rules for text and binary handling 2018-07-30 15:04:04 +02:00
c97bc6ef88 Fix determining if we are in double page or not. 2018-05-20 17:39:08 +02:00
c9f703b6f7 Revert "Fixed wrong index asigned to current page from the viewer"
This reverts commit 26fdb5a303.
2018-05-20 15:19:48 +02:00
26fdb5a303 Fixed wrong index asigned to current page from the viewer 2018-05-20 14:40:07 +02:00
2cbbf8d433 Headless server: simplify system config logger 2018-01-28 13:32:56 +01:00