Commit Graph

21 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
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
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
5aa02a19bb clang-format 2021-10-18 21:56:52 +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
c73f28cca1 KeySequence passed by reference 2021-01-17 11:06:45 +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
Igor Kushnir
39ab598363 Reader: clean unused code up
closeEvent is accepted by default, so this commit does not change the
application behavior. But Qt documentation recommends not relying on the
default value as subclasses may choose to clear it in their constructor.
2019-09-18 18:10:40 +02:00
Luis Ángel San Martín
f29724e404 Annotate overridden methods 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
Felix Kauselmann
d5a11fb16b Add .gitattributes rules for text and binary handling 2018-07-30 15:04:04 +02:00
Luis Ángel San Martín
2a136e3ea3 Merge - 9.0.0 release 2018-02-18 10:35:24 +01:00
apollo2k4
f2a356fc70 Update russian translation. Need to subtract and to bring the terminology to a common denominator 2018-01-08 16:32:56 +00:00