Commit Graph

52 Commits

Author SHA1 Message Date
Luis Ángel San Martín Rodríguez
0b37c7c684 Use the new svg icons in macos too 2022-10-20 19:14:13 +02:00
Luis Ángel San Martín
4c66b8ecad Use SVG icons in YACReader's toolbar (windows/linux) and in shortcuts dialog 2022-10-20 17:51:22 +02:00
Luis Ángel San Martín Rodríguez
e026f25617 QMacToolBar is not available in Qt6
This commit adds new qt pure versions of the mac toolbar to be used in qt6.
2022-09-12 19:24:56 +02: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
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
Igor Kushnir
88e0f5513a Reader: make 3 keyboard shortcuts work with non-Latin layouts
MainWindowViewer::keyPressEvent()'s custom matching of these shortcuts
does not leverage all the features of standard Qt shortcut matching. As
a result, the corresponding actions cannot be triggered when their
assigned shortcuts consist of a single Latin letter without modifiers
and e.g. Ukrainian keyboard layout is active.

Furthermore, some key presses (e.g. Scroll Lock in my customized
keyboard layout) set QKeyEvent::key() to 0, which the custom matching
considers equal to an unassigned shortcut. So an action without shortcut
is triggered by such a key press.

Adding these 3 actions to MainWindowViewer and connecting the
corresponding slots to their triggered() signals allows to remove the
custom matching code and thus eliminates both of its issues.
2022-01-15 18:02:30 +02:00
Luis Ángel San Martín
fce1f163aa Check that double click is done using the left button before toggling full-screen mode 2022-01-13 23:06:24 +01: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
f5035b4bac Use fully qualified names 2021-10-19 00:00:08 +02:00
Luis Ángel San Martín
2a90b1c6ef Stop using availableGeometry 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
b8ad2b540b
Merge branch 'develop' into clazy_autorefactoring 2021-09-26 08:52:23 +02:00
Felix Kauselmann
54b9952253 YACReader: Show error when opening nonexistent open recent entry 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
8377de7c3e Clazy: Use fixits to refactor some old style signal connections 2021-06-29 13:53:12 +02:00
Luis Ángel San Martín
3683ace654 Remove message box used during development 2021-05-29 10:34:42 +02:00
Luis Ángel San Martín
4fc60c72aa Update YACReaderLibrary <-> YACReader communication to support reading lists 2021-05-27 18:56:31 +02:00
Igor Kushnir
497894c5bf Allow to configure Fit to page action shortcut in the UI 2021-03-11 11:14:24 +02:00
Igor Kushnir
3c9ed6ef8f Deprecated qSort => std::sort
This change gets rid of some GCC's -Wdeprecated-declarations warnings.
2021-03-09 21:32:23 +01:00
Luis Ángel San Martín
58fdf0af23 Add what's new dialog 2021-01-21 21:39:22 +01:00
Luis Ángel San Martín
a911a4fc53 Update action names in macos menus 2021-01-16 18:45:47 +01:00
Luis Ángel San Martín
2a3f7668ba Rename method 2021-01-16 18:27:16 +01:00
Luis Ángel San Martín
d07de8fb2e Rename prev/next actions to reflect its positional behaviour 2021-01-16 14:59:37 +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
Felix Kauselmann
232181eef7 Reader: Add option to stop enlarging images in fit to width and height 2020-09-02 09:27:53 +02:00
Igor Kushnir
0da59285cf Reader: fix QTimer-related memory leaks 2020-08-31 15:44:50 +02:00
Luis Ángel San Martín
1f8be886ec Add new action to create a new instance of the viewer in macos 2019-09-28 16:55:28 +02:00
Luis Ángel San Martín
e1b0e7c96f Fix full screen mode in windows with qt 5.12.4+ 2019-09-28 10:11:44 +02:00
Igor Kushnir
82719573b5 Reader: store geometry instead of pos&size in Configuration
Qt documentation recommends calling saveGeometry() in closeEvent().

This commit fixes the following bug on my GNU/Linux with Xfce system:
    1. Move the top of the YACReader window to the top of the screen.
    2. Restart YACReader (exit and run again).
    2. Enter full screen mode.
    4. Restart YACReader.
    5. Exit full screen mode.
At this point YACReader's title bar is hidden beyond the top of the
screen, i.e. the window has moved up.
2019-09-18 18:10:40 +02: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
e2276cbc1c More auto 2019-06-01 16:04:48 +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
Luis Ángel San Martín
9321d864db Fixed sending read progress. 2018-10-06 11:12:44 +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
1a91206a2d
Merge branch 'develop' into 9.5.0_bugfixes 2018-05-31 18:12:52 +02:00
Luis Ángel San Martín
9cc4f65fc8 Use older api currentSecsSinceEpoch was introduced in Qt 5.8 2018-05-28 21:18:11 +02:00
Felix Kauselmann
0cc6b3bcf7 SendComic: Connect finished signal to deleteLater slot BEFORE the finished
signal is emitted so it is actually processed and we don't get dangling pointers.

Use modern signal slot syntax so that the compiler and source check tools can
verify we actually fixed the problem.
2018-05-26 12:43:03 +02:00
Luis Ángel San Martín
5c876e6785 Make YACReader send info for the next comic.
Now we can set the next comic as reading.
2018-05-20 17:43:28 +02:00
Luis Ángel San Martín
82cfdfdf30 YACReader should be dummy about has been opened.
It should only send back information, hasBeenOpened will be set in YACReaderLibrary depending on various factors.
2018-05-20 14:43:19 +02:00
Luis Ángel San Martín
e8c6f60c13 Merge 2017-11-26 07:39:08 +01:00
Luis Ángel San Martín
d5f167b670 Don't set the window icon, let windows use the app icon. 2017-11-20 21:37:26 +01:00
Luis Ángel San Martín
5c268217d3 Fix read flag calculation on progress read updated from the server. 2017-11-19 10:03:40 +01:00