mirror of
https://github.com/YACReader/yacreader
synced 2025-12-03 16:02:55 -05:00
Merge pull request #176 from smalewski/develop
Fixes move action shortcuts not working
This commit is contained in:
@ -9,6 +9,7 @@ Version counting is based on semantic versioning (Major.Feature.Patch)
|
|||||||
## WIP
|
## WIP
|
||||||
### YACReader
|
### YACReader
|
||||||
* Add support for full manga mode.
|
* Add support for full manga mode.
|
||||||
|
* Fix UP,DOWN,LEFT,RIGHT shortcuts for moving a zoomed in page around.
|
||||||
### YACReaderLibrary
|
### YACReaderLibrary
|
||||||
* New search engine.
|
* New search engine.
|
||||||
* New `manga` field added to comics and folders to tag content as manga, any content added to a manga folder will become manga automatically.
|
* New `manga` field added to comics and folders to tag content as manga, any content added to a manga folder will become manga automatically.
|
||||||
|
|||||||
@ -629,7 +629,7 @@ void Viewer::keyPressEvent(QKeyEvent *event)
|
|||||||
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_UP_ACTION_Y) ||
|
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_UP_ACTION_Y) ||
|
||||||
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_LEFT_ACTION_Y) ||
|
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_LEFT_ACTION_Y) ||
|
||||||
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_RIGHT_ACTION_Y)) {
|
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_RIGHT_ACTION_Y)) {
|
||||||
QAbstractScrollArea::keyPressEvent(event);
|
moveAction(key);
|
||||||
emit backgroundChanges();
|
emit backgroundChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -652,6 +652,26 @@ void Viewer::keyPressEvent(QKeyEvent *event)
|
|||||||
QAbstractScrollArea::keyPressEvent(event);
|
QAbstractScrollArea::keyPressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Viewer::moveAction(const QKeySequence &key)
|
||||||
|
{
|
||||||
|
int _key = 0;
|
||||||
|
|
||||||
|
if (key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_DOWN_ACTION_Y))
|
||||||
|
_key = Qt::Key_Down;
|
||||||
|
|
||||||
|
else if (key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_UP_ACTION_Y))
|
||||||
|
_key = Qt::Key_Up;
|
||||||
|
|
||||||
|
else if (key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_LEFT_ACTION_Y))
|
||||||
|
_key = Qt::Key_Left;
|
||||||
|
|
||||||
|
else if (key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_RIGHT_ACTION_Y))
|
||||||
|
_key = Qt::Key_Right;
|
||||||
|
|
||||||
|
QKeyEvent _event = QKeyEvent(QEvent::KeyPress, _key, Qt::NoModifier);
|
||||||
|
QAbstractScrollArea::keyPressEvent(&_event);
|
||||||
|
}
|
||||||
|
|
||||||
static void animateScroll(QPropertyAnimation &scroller, const QScrollBar &scrollBar, int delta)
|
static void animateScroll(QPropertyAnimation &scroller, const QScrollBar &scrollBar, int delta)
|
||||||
{
|
{
|
||||||
int deltaNotFinished = 0;
|
int deltaNotFinished = 0;
|
||||||
|
|||||||
@ -164,6 +164,8 @@ private:
|
|||||||
void wheelEvent(QWheelEvent *event) override;
|
void wheelEvent(QWheelEvent *event) override;
|
||||||
void mouseMoveEvent(QMouseEvent *event) override;
|
void mouseMoveEvent(QMouseEvent *event) override;
|
||||||
|
|
||||||
|
void moveAction(const QKeySequence &key);
|
||||||
|
|
||||||
//!ZigzagScroll
|
//!ZigzagScroll
|
||||||
enum scrollDirection { UP,
|
enum scrollDirection { UP,
|
||||||
DOWN,
|
DOWN,
|
||||||
|
|||||||
Reference in New Issue
Block a user