Add new fitmode FitToPage

This commit is contained in:
Felix Kauselmann 2015-12-03 12:22:19 +01:00
parent 605523546f
commit f70ecc6dc7
3 changed files with 21 additions and 0 deletions

View File

@ -109,6 +109,7 @@ MainWindowViewer::~MainWindowViewer()
delete showDictionaryAction;
delete alwaysOnTopAction;
delete adjustToFullSizeAction;
delete fitToPageAction;
delete showFlowAction;
}
@ -410,6 +411,12 @@ void MainWindowViewer::createActions()
adjustToFullSizeAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_TO_FULL_SIZE_ACTION_Y));
connect(adjustToFullSizeAction,SIGNAL(triggered()),this,SLOT(adjustToFullSizeSwitch()));
fitToPageAction = new QAction(tr("Fit to page"),this);
fitToPageAction->setDisabled(true);
fitToPageAction->setData(FIT_TO_PAGE_ACTION_Y);
fitToPageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(FIT_TO_PAGE_ACTION_Y));
connect(fitToPageAction,SIGNAL(triggered()),this,SLOT(fitToPageSwitch()));
increasePageZoomAction = new QAction(tr("Zoom+"),this);
increasePageZoomAction->setDisabled(true);
increasePageZoomAction->setData(ZOOM_PLUS_ACTION_Y);
@ -537,6 +544,7 @@ void MainWindowViewer::createToolBars()
comicToolBar->addAction(adjustWidthAction);
comicToolBar->addAction(adjustHeightAction);
comicToolBar->addAction(adjustToFullSizeAction);
comicToolBar->addAction(fitToPageAction);
comicToolBar->addAction(leftRotationAction);
comicToolBar->addAction(rightRotationAction);
comicToolBar->addAction(doublePageAction);
@ -587,6 +595,7 @@ void MainWindowViewer::createToolBars()
viewer->addAction(adjustHeightAction);
viewer->addAction(adjustWidthAction);
viewer->addAction(adjustToFullSizeAction);
viewer->addAction(fitToPageAction);
viewer->addAction(leftRotationAction);
viewer->addAction(rightRotationAction);
viewer->addAction(doublePageAction);
@ -838,6 +847,8 @@ void MainWindowViewer::enableActions()
doublePageAction->setDisabled(false);
doubleMangaPageAction->setDisabled(false);
adjustToFullSizeAction->setDisabled(false);
adjustToFullSizeAction->setDisabled(false);
fitToPageAction->setDisabled(false);
increasePageZoomAction->setDisabled(false);
decreasePageZoomAction->setDisabled(false);
//setBookmark->setDisabled(false);
@ -1389,6 +1400,13 @@ void MainWindowViewer::adjustToFullSizeSwitch()
viewer->updatePage();
}
void MainWindowViewer::fitToPageSwitch()
{
Configuration::getConfiguration().setFitMode(YACReader::FitMode::FullPage);
viewer->setZoomFactor(1);
viewer->updatePage();
}
void MainWindowViewer::increasePageZoomLevel()
{
viewer->increaseZoomFactor();

View File

@ -54,6 +54,7 @@ class EditShortcutsDialog;
void openFolderFromPath(QString pathFile, QString atFileName);
void alwaysOnTopSwitch();
void adjustToFullSizeSwitch();
void fitToPageSwitch();
void increasePageZoomLevel();
void decreasePageZoomLevel();
void reloadOptions();
@ -126,6 +127,7 @@ class EditShortcutsDialog;
QAction *showDictionaryAction;
QAction *alwaysOnTopAction;
QAction *adjustToFullSizeAction;
QAction *fitToPageAction;
QAction *increasePageZoomAction;
QAction *decreasePageZoomAction;
QAction *showFlowAction;

View File

@ -110,6 +110,7 @@ public:
#define SHOW_DICTIONARY_ACTION_Y "SHOW_DICTIONARY_ACTION_Y"
#define ALWAYS_ON_TOP_ACTION_Y "ALWAYS_ON_TOP_ACTION_Y"
#define ADJUST_TO_FULL_SIZE_ACTION_Y "ADJUST_TO_FULL_SIZE_ACTION_Y"
#define FIT_TO_PAGE_ACTION_Y "FIT_TO_PAGE_ACTION_Y"
#define SHOW_FLOW_ACTION_Y "SHOW_FLOW_ACTION_Y"
#define SHOW_EDIT_SHORTCUTS_ACTION_Y "SHOW_EDIT_SHORTCUTS_ACTION_Y"