Commit Graph

2748 Commits

Author SHA1 Message Date
Luis Ángel San Martín
dfd5742d2c qt5-default is no longer available 2022-07-06 11:08:52 +02:00
Luis Ángel San Martín
a4c15728e2 We shouldn't need additional repos 2022-07-06 11:03:30 +02:00
Luis Ángel San Martín
0045daafd7 Try a newer version of ubuntu to see if we can get qt 5.15 out of the box 2022-07-06 10:55:07 +02:00
Luis Ángel San Martín
58cf162534 Update CHANGELOG and what's new content 2022-07-06 10:47:41 +02:00
Luis Ángel San Martín
9c0aa41c32 Improve what's new style 2022-07-06 10:06:22 +02:00
Luis Ángel San Martín
be3e31624a Update CHANGELOG 2022-07-06 09:46:51 +02:00
Luis Ángel San Martín
14a7148bfa Purge bookmarks if they get invalid 2022-05-28 12:37:27 +02:00
Luis Ángel San Martín
34c1849ddc Merge remote-tracking branch 'origin/develop' into develop 2022-05-28 11:39:24 +02:00
Luis Ángel San Martín
f70799502b Bump version number 2022-05-28 11:38:58 +02:00
Luis Ángel San Martín
3b676053d9
Update README.md 2022-04-14 07:29:50 +02:00
Luis Ángel San Martín
4a59271ebd Initialize manga field to false in Folder 2022-04-13 19:13:58 +02:00
Luis Ángel San Martín
51e3b2618a Fix type boolean -> bool 2022-04-10 08:33:32 +02:00
Luis Ángel San Martín
4c54f2a07c Fix clicking on the folders treeview when it shown results from search
This was a bug introduced when support for folder navigation using the keyboard was added.
2022-03-28 22:32:52 +02:00
Luis Ángel San Martín
9e9f035f35 Use Qt::HighDpiScaleFactorRoundingPolicy::PassThrough
It will be the default in Qt6 and respecting the scale factor that the user sets is the right thing to do.
2022-03-12 11:51:29 +01:00
Luis Ángel San Martín
f27de78fe1 Fix grid cell selection border
Moving the DropShadow broke things in Qt5.15
2022-02-20 18:02:11 +01:00
Luis Ángel San Martín
72670ea6c8 Move connections to happen later
Otherwise QQuickItem(s) don't work properly in Qt6. I couldn't find the root cause.
2022-01-19 21:13:53 +01:00
Luis Ángel San Martín
f48201fb91 Initialize fields to nullptr 2022-01-19 21:12:37 +01:00
Luis Ángel San Martín
2d741140e6 Add nullptr check 2022-01-19 21:12:26 +01:00
Luis Ángel San Martín
4bb227aff2 Fix trace message 2022-01-19 21:12:00 +01:00
Luis Ángel San Martín
1b54a407b8 Move common initialization code to the parent class 2022-01-19 19:16:27 +01:00
Luis Ángel San Martín
ab927d791b Avoid code duplication 2022-01-19 18:30:38 +01:00
Luis Ángel San Martín
a6a812d8e5 Update CHANGELOG 2022-01-19 18:29:40 +01:00
Luis Ángel San Martín
8d0beee195 Use parent instead of id 2022-01-19 18:29:09 +01:00
Luis Ángel San Martín
24ad06e839 Remove icon 2022-01-19 18:28:49 +01:00
Luis Ángel San Martín
d73a9a2207 Move DropShadow block 2022-01-19 18:28:38 +01:00
Luis Ángel San Martín
26b4a85928 Rename id 2022-01-19 18:27:22 +01:00
Luis Ángel San Martín
6892a28d0a Check for undefined and null values in QML
Conditional chaining is not available in Qt5.15, so this is uglier than it should be.
2022-01-19 18:24:29 +01:00
Luis Ángel San Martín
68dbd90413 Update listeners definitions 2022-01-19 18:22:04 +01:00
Luis Ángel San Martín
1a25fd0740 Update listeners definitions 2022-01-19 18:20:05 +01:00
Luis Ángel San Martín
f3e08a04d7 Add some initial values for context variables 2022-01-19 18:17:53 +01:00
Luis Ángel San Martín
27383da945 Configure the initial size of the covers 2022-01-19 18:17:04 +01:00
Luis Ángel San Martín
59ae6c5e51 Extract method 2022-01-19 18:16:13 +01:00
Luis Ángel San Martín
2ae9b83bbf Make sure that opengl is used
QQuickWidget requires opengl.
2022-01-19 18:15:36 +01:00
Luis Ángel San Martín
b841aff4a3 Wrap booleans in QVariant when updating the qml context 2022-01-19 18:14:29 +01:00
Luis Ángel San Martín
768d7ee73c Set initial dummy values for some context references 2022-01-19 18:13:20 +01:00
Luis Ángel San Martín
e80f5a9f64 Move common initialization to the parent class 2022-01-19 18:12:40 +01:00
Luis Ángel San Martín
c948ee70cb Add some system info to the help/about dialog
I'll see what other info can be useful.
2022-01-16 11:19:19 +01:00
Luis Ángel San Martín
be684514e3
Merge pull request #189 from vedgy/enable-shortcuts-in-other-layouts
Fix keyboard shortcuts with alternative layouts; always limit Magnifying glass height; clean up related code
2022-01-16 11:18:24 +01:00
Igor Kushnir
662b5c99fd Don't leak "orphan" actions at exit
The original reason to orphan these actions is likely obsolete now.

Extract MainWindowViewer::addActionWithShortcut() to reduce code
duplication.
2022-01-15 18:02:31 +02:00
Igor Kushnir
482c19b358 Allow triggering Open latest comic action when the toolbar is hidden
This action is added to the toolbar but not to the viewer. Thus it
cannot be triggered when the toolbar is hidden. Adding it to
MainWindowViewer makes it available at all times.
2022-01-15 18:02:31 +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
c8697ccd2d Always limit Magnifying glass's height
MagnifyingGlass::sizeUp() and MagnifyingGlass::sizeDown() grow/shrink
both width and height, but check only width's limits. Thus the user can
first increase Magnifying glass's height, then increase its size and
make the height greater than the main window's height. The user can also
first increase the width, then decrease the size until the height
shrinks to 0 and Magnifying glass disappears.

When Magnifying glass disappears, the only way to make it visible again
is to restore its default size by restarting YACReader, because the
invisible MagnifyingGlass widget does not receive wheel events and
Viewer::keyPressEvent() propagates shortcuts to mglass only if it is
visible. And even this workaround is possible only because YACReader
does not save/restore Magnifying glass's size (should it?).

Always checking both width and height limits fixes the bug. If one of
the dimensions reaches a limit, only the other dimension is modified. If
both dimensions reach their limits, neither is modified.
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
fdba938fe8 MagnifyingGlass: don't updateImage() needlessly
Not all possible keyboard modifiers of a wheel event change
MagnifyingGlass's pixmap. So in case of e.g. MetaModifier or more than
one modifier, MagnifyingGlass::wheelEvent() calls updateImage() to no
avail.

Move the updateImage() call into the public slots to make them
self-sufficient. This also allows not to call updateImage() when the
pixmap is not changed in case the adjusted parameter has reached its
minimum or maximum value already.
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
0fad89dc03 Simplify code that disables previous/next comic actions 2022-01-15 18:02:30 +02:00
Igor Kushnir
f030a7fb0c Remove deprecated and always disabled alwaysOnTopAction 2022-01-15 18:02:30 +02:00
Igor Kushnir
b3c99823eb MainWindowViewer::createActions(): deduplicate setDisabled 2022-01-15 18:02:30 +02:00
Igor Kushnir
3bb475b47a MainWindowViewer: deduplicate enabling/disabling actions 2022-01-15 18:02:30 +02:00