mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04: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
|
||||
### YACReader
|
||||
* Add support for full manga mode.
|
||||
* Fix UP,DOWN,LEFT,RIGHT shortcuts for moving a zoomed in page around.
|
||||
### YACReaderLibrary
|
||||
* 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.
|
||||
|
@ -629,7 +629,7 @@ void Viewer::keyPressEvent(QKeyEvent *event)
|
||||
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_UP_ACTION_Y) ||
|
||||
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_LEFT_ACTION_Y) ||
|
||||
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_RIGHT_ACTION_Y)) {
|
||||
QAbstractScrollArea::keyPressEvent(event);
|
||||
moveAction(key);
|
||||
emit backgroundChanges();
|
||||
}
|
||||
|
||||
@ -652,6 +652,26 @@ void Viewer::keyPressEvent(QKeyEvent *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)
|
||||
{
|
||||
int deltaNotFinished = 0;
|
||||
|
@ -164,6 +164,8 @@ private:
|
||||
void wheelEvent(QWheelEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
|
||||
void moveAction(const QKeySequence &key);
|
||||
|
||||
//!ZigzagScroll
|
||||
enum scrollDirection { UP,
|
||||
DOWN,
|
||||
|
Reference in New Issue
Block a user