mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
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.
This commit is contained in:
@ -51,6 +51,8 @@ public slots:
|
||||
void left();
|
||||
void right();
|
||||
void showGoToDialog();
|
||||
void goToFirstPage();
|
||||
void goToLastPage();
|
||||
void goTo(unsigned int page);
|
||||
void updatePage();
|
||||
void updateContentSize();
|
||||
@ -58,6 +60,8 @@ public slots:
|
||||
void updateOptions();
|
||||
void scrollDown();
|
||||
void scrollUp();
|
||||
void scrollForward();
|
||||
void scrollBackward();
|
||||
void scrollForwardHorizontalFirst();
|
||||
void scrollBackwardHorizontalFirst();
|
||||
void scrollForwardVerticalFirst();
|
||||
@ -162,8 +166,6 @@ private:
|
||||
void wheelEvent(QWheelEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
|
||||
void moveAction(const QKeySequence &key);
|
||||
|
||||
int verticalScrollStep() const;
|
||||
int horizontalScrollStep() const;
|
||||
|
||||
@ -185,10 +187,13 @@ public:
|
||||
// returns the current index starting in 1 [1,nPages]
|
||||
unsigned int getIndex();
|
||||
void updateComic(ComicDB &comic);
|
||||
void moveView(Qt::Key directionKey);
|
||||
|
||||
signals:
|
||||
void backgroundChanges();
|
||||
void pageAvailable(bool);
|
||||
void pageIsBookmark(bool);
|
||||
void comicLoaded();
|
||||
void reset();
|
||||
void openNextComic();
|
||||
void openPreviousComic();
|
||||
|
Reference in New Issue
Block a user