mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Add shortcuts to control the double page mode offset
This commit is contained in:
parent
a77a704d48
commit
f3249e4053
@ -1252,6 +1252,11 @@ void MainWindowViewer::setUpShortcutsManagement()
|
|||||||
auto *const goToLastPageAction = addActionWithShortcut(tr("Go to the last page"), GO_TO_LAST_PAGE_ACTION_Y);
|
auto *const goToLastPageAction = addActionWithShortcut(tr("Go to the last page"), GO_TO_LAST_PAGE_ACTION_Y);
|
||||||
connect(goToLastPageAction, &QAction::triggered, viewer, &Viewer::goToLastPage);
|
connect(goToLastPageAction, &QAction::triggered, viewer, &Viewer::goToLastPage);
|
||||||
|
|
||||||
|
auto *const offsetDoublePageToTheLeft = addActionWithShortcut(tr("Offset double page to the left"), OFFSET_DOUBLE_PAGE_TO_THE_LEFT_Y);
|
||||||
|
connect(offsetDoublePageToTheLeft, &QAction::triggered, viewer, &Viewer::offsetDoublePageToTheLeft);
|
||||||
|
auto *const offsetDoublePageToTheRight = addActionWithShortcut(tr("Offset double page to the right"), OFFSET_DOUBLE_PAGE_TO_THE_RIGHT_Y);
|
||||||
|
connect(offsetDoublePageToTheRight, &QAction::triggered, viewer, &Viewer::offsetDoublePageToTheRight);
|
||||||
|
|
||||||
loadedComicActions = { autoScrollForwardAction,
|
loadedComicActions = { autoScrollForwardAction,
|
||||||
autoScrollBackwardAction,
|
autoScrollBackwardAction,
|
||||||
autoScrollForwardHorizontalFirstAction,
|
autoScrollForwardHorizontalFirstAction,
|
||||||
@ -1263,7 +1268,9 @@ void MainWindowViewer::setUpShortcutsManagement()
|
|||||||
moveLeftAction,
|
moveLeftAction,
|
||||||
moveRightAction,
|
moveRightAction,
|
||||||
goToFirstPageAction,
|
goToFirstPageAction,
|
||||||
goToLastPageAction };
|
goToLastPageAction,
|
||||||
|
offsetDoublePageToTheLeft,
|
||||||
|
offsetDoublePageToTheRight };
|
||||||
|
|
||||||
editShortcutsDialog->addActionsGroup(tr("Reading"), QIcon(":/images/shortcuts_group_reading.svg"),
|
editShortcutsDialog->addActionsGroup(tr("Reading"), QIcon(":/images/shortcuts_group_reading.svg"),
|
||||||
tmpList = QList<QAction *>()
|
tmpList = QList<QAction *>()
|
||||||
|
@ -1083,6 +1083,36 @@ void Viewer::setBookmarks()
|
|||||||
bd->setBookmarks(*render->getBookmarks());
|
bd->setBookmarks(*render->getBookmarks());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Viewer::offsetDoublePageToTheLeft()
|
||||||
|
{
|
||||||
|
if (!doublePage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doubleMangaPage) {
|
||||||
|
render->previousPage();
|
||||||
|
} else {
|
||||||
|
render->nextPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
updateInformation();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Viewer::offsetDoublePageToTheRight()
|
||||||
|
{
|
||||||
|
if (!doublePage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doubleMangaPage) {
|
||||||
|
render->nextPage();
|
||||||
|
} else {
|
||||||
|
render->previousPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
updateInformation();
|
||||||
|
}
|
||||||
|
|
||||||
void Viewer::showIsCoverMessage()
|
void Viewer::showIsCoverMessage()
|
||||||
{
|
{
|
||||||
if (!shouldOpenPrevious) {
|
if (!shouldOpenPrevious) {
|
||||||
|
@ -101,6 +101,8 @@ public slots:
|
|||||||
void showMessageErrorOpening(QString);
|
void showMessageErrorOpening(QString);
|
||||||
void processCRCError(QString message);
|
void processCRCError(QString message);
|
||||||
void setBookmarks();
|
void setBookmarks();
|
||||||
|
void offsetDoublePageToTheLeft();
|
||||||
|
void offsetDoublePageToTheRight();
|
||||||
// deprecated
|
// deprecated
|
||||||
void updateImageOptions();
|
void updateImageOptions();
|
||||||
void updateFilters(int brightness, int contrast, int gamma);
|
void updateFilters(int brightness, int contrast, int gamma);
|
||||||
|
@ -69,6 +69,8 @@ void ShortcutsManager::initDefaultShorcuts()
|
|||||||
defaultShorcuts.insert(MOVE_UP_ACTION_Y, Qt::Key_Up);
|
defaultShorcuts.insert(MOVE_UP_ACTION_Y, Qt::Key_Up);
|
||||||
defaultShorcuts.insert(GO_TO_FIRST_PAGE_ACTION_Y, Qt::Key_Home);
|
defaultShorcuts.insert(GO_TO_FIRST_PAGE_ACTION_Y, Qt::Key_Home);
|
||||||
defaultShorcuts.insert(GO_TO_LAST_PAGE_ACTION_Y, Qt::Key_End);
|
defaultShorcuts.insert(GO_TO_LAST_PAGE_ACTION_Y, Qt::Key_End);
|
||||||
|
defaultShorcuts.insert(OFFSET_DOUBLE_PAGE_TO_THE_LEFT_Y, Qt::CTRL | Qt::SHIFT | Qt::Key_Left);
|
||||||
|
defaultShorcuts.insert(OFFSET_DOUBLE_PAGE_TO_THE_RIGHT_Y, Qt::CTRL | Qt::SHIFT | Qt::Key_Right);
|
||||||
// mglass
|
// mglass
|
||||||
defaultShorcuts.insert(SIZE_UP_MGLASS_ACTION_Y, Qt::Key_Plus);
|
defaultShorcuts.insert(SIZE_UP_MGLASS_ACTION_Y, Qt::Key_Plus);
|
||||||
defaultShorcuts.insert(SIZE_DOWN_MGLASS_ACTION_Y, Qt::Key_Minus);
|
defaultShorcuts.insert(SIZE_DOWN_MGLASS_ACTION_Y, Qt::Key_Minus);
|
||||||
|
@ -152,6 +152,8 @@ public:
|
|||||||
#define MOVE_RIGHT_ACTION_Y "MOVE_RIGHT_ACTION_Y"
|
#define MOVE_RIGHT_ACTION_Y "MOVE_RIGHT_ACTION_Y"
|
||||||
#define GO_TO_FIRST_PAGE_ACTION_Y "GO_TO_FIRST_PAGE_ACTION_Y"
|
#define GO_TO_FIRST_PAGE_ACTION_Y "GO_TO_FIRST_PAGE_ACTION_Y"
|
||||||
#define GO_TO_LAST_PAGE_ACTION_Y "GO_TO_LAST_PAGE_ACTION_Y"
|
#define GO_TO_LAST_PAGE_ACTION_Y "GO_TO_LAST_PAGE_ACTION_Y"
|
||||||
|
#define OFFSET_DOUBLE_PAGE_TO_THE_LEFT_Y "OFFSET_DOUBLE_PAGE_TO_THE_LEFT_Y"
|
||||||
|
#define OFFSET_DOUBLE_PAGE_TO_THE_RIGHT_Y "OFFSET_DOUBLE_PAGE_TO_THE_RIGHT_Y"
|
||||||
// mglass
|
// mglass
|
||||||
#define SIZE_UP_MGLASS_ACTION_Y "SIZE_UP_MGLASS_ACTION_Y"
|
#define SIZE_UP_MGLASS_ACTION_Y "SIZE_UP_MGLASS_ACTION_Y"
|
||||||
#define SIZE_DOWN_MGLASS_ACTION_Y "SIZE_DOWN_MGLASS_ACTION_Y"
|
#define SIZE_DOWN_MGLASS_ACTION_Y "SIZE_DOWN_MGLASS_ACTION_Y"
|
||||||
|
Loading…
Reference in New Issue
Block a user