mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Add new fitmode FitToPage
This commit is contained in:
parent
605523546f
commit
f70ecc6dc7
@ -109,6 +109,7 @@ MainWindowViewer::~MainWindowViewer()
|
|||||||
delete showDictionaryAction;
|
delete showDictionaryAction;
|
||||||
delete alwaysOnTopAction;
|
delete alwaysOnTopAction;
|
||||||
delete adjustToFullSizeAction;
|
delete adjustToFullSizeAction;
|
||||||
|
delete fitToPageAction;
|
||||||
delete showFlowAction;
|
delete showFlowAction;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -410,6 +411,12 @@ void MainWindowViewer::createActions()
|
|||||||
adjustToFullSizeAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_TO_FULL_SIZE_ACTION_Y));
|
adjustToFullSizeAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_TO_FULL_SIZE_ACTION_Y));
|
||||||
connect(adjustToFullSizeAction,SIGNAL(triggered()),this,SLOT(adjustToFullSizeSwitch()));
|
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 = new QAction(tr("Zoom+"),this);
|
||||||
increasePageZoomAction->setDisabled(true);
|
increasePageZoomAction->setDisabled(true);
|
||||||
increasePageZoomAction->setData(ZOOM_PLUS_ACTION_Y);
|
increasePageZoomAction->setData(ZOOM_PLUS_ACTION_Y);
|
||||||
@ -537,6 +544,7 @@ void MainWindowViewer::createToolBars()
|
|||||||
comicToolBar->addAction(adjustWidthAction);
|
comicToolBar->addAction(adjustWidthAction);
|
||||||
comicToolBar->addAction(adjustHeightAction);
|
comicToolBar->addAction(adjustHeightAction);
|
||||||
comicToolBar->addAction(adjustToFullSizeAction);
|
comicToolBar->addAction(adjustToFullSizeAction);
|
||||||
|
comicToolBar->addAction(fitToPageAction);
|
||||||
comicToolBar->addAction(leftRotationAction);
|
comicToolBar->addAction(leftRotationAction);
|
||||||
comicToolBar->addAction(rightRotationAction);
|
comicToolBar->addAction(rightRotationAction);
|
||||||
comicToolBar->addAction(doublePageAction);
|
comicToolBar->addAction(doublePageAction);
|
||||||
@ -587,6 +595,7 @@ void MainWindowViewer::createToolBars()
|
|||||||
viewer->addAction(adjustHeightAction);
|
viewer->addAction(adjustHeightAction);
|
||||||
viewer->addAction(adjustWidthAction);
|
viewer->addAction(adjustWidthAction);
|
||||||
viewer->addAction(adjustToFullSizeAction);
|
viewer->addAction(adjustToFullSizeAction);
|
||||||
|
viewer->addAction(fitToPageAction);
|
||||||
viewer->addAction(leftRotationAction);
|
viewer->addAction(leftRotationAction);
|
||||||
viewer->addAction(rightRotationAction);
|
viewer->addAction(rightRotationAction);
|
||||||
viewer->addAction(doublePageAction);
|
viewer->addAction(doublePageAction);
|
||||||
@ -838,6 +847,8 @@ void MainWindowViewer::enableActions()
|
|||||||
doublePageAction->setDisabled(false);
|
doublePageAction->setDisabled(false);
|
||||||
doubleMangaPageAction->setDisabled(false);
|
doubleMangaPageAction->setDisabled(false);
|
||||||
adjustToFullSizeAction->setDisabled(false);
|
adjustToFullSizeAction->setDisabled(false);
|
||||||
|
adjustToFullSizeAction->setDisabled(false);
|
||||||
|
fitToPageAction->setDisabled(false);
|
||||||
increasePageZoomAction->setDisabled(false);
|
increasePageZoomAction->setDisabled(false);
|
||||||
decreasePageZoomAction->setDisabled(false);
|
decreasePageZoomAction->setDisabled(false);
|
||||||
//setBookmark->setDisabled(false);
|
//setBookmark->setDisabled(false);
|
||||||
@ -1389,6 +1400,13 @@ void MainWindowViewer::adjustToFullSizeSwitch()
|
|||||||
viewer->updatePage();
|
viewer->updatePage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindowViewer::fitToPageSwitch()
|
||||||
|
{
|
||||||
|
Configuration::getConfiguration().setFitMode(YACReader::FitMode::FullPage);
|
||||||
|
viewer->setZoomFactor(1);
|
||||||
|
viewer->updatePage();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindowViewer::increasePageZoomLevel()
|
void MainWindowViewer::increasePageZoomLevel()
|
||||||
{
|
{
|
||||||
viewer->increaseZoomFactor();
|
viewer->increaseZoomFactor();
|
||||||
|
@ -54,6 +54,7 @@ class EditShortcutsDialog;
|
|||||||
void openFolderFromPath(QString pathFile, QString atFileName);
|
void openFolderFromPath(QString pathFile, QString atFileName);
|
||||||
void alwaysOnTopSwitch();
|
void alwaysOnTopSwitch();
|
||||||
void adjustToFullSizeSwitch();
|
void adjustToFullSizeSwitch();
|
||||||
|
void fitToPageSwitch();
|
||||||
void increasePageZoomLevel();
|
void increasePageZoomLevel();
|
||||||
void decreasePageZoomLevel();
|
void decreasePageZoomLevel();
|
||||||
void reloadOptions();
|
void reloadOptions();
|
||||||
@ -126,6 +127,7 @@ class EditShortcutsDialog;
|
|||||||
QAction *showDictionaryAction;
|
QAction *showDictionaryAction;
|
||||||
QAction *alwaysOnTopAction;
|
QAction *alwaysOnTopAction;
|
||||||
QAction *adjustToFullSizeAction;
|
QAction *adjustToFullSizeAction;
|
||||||
|
QAction *fitToPageAction;
|
||||||
QAction *increasePageZoomAction;
|
QAction *increasePageZoomAction;
|
||||||
QAction *decreasePageZoomAction;
|
QAction *decreasePageZoomAction;
|
||||||
QAction *showFlowAction;
|
QAction *showFlowAction;
|
||||||
|
@ -110,6 +110,7 @@ public:
|
|||||||
#define SHOW_DICTIONARY_ACTION_Y "SHOW_DICTIONARY_ACTION_Y"
|
#define SHOW_DICTIONARY_ACTION_Y "SHOW_DICTIONARY_ACTION_Y"
|
||||||
#define ALWAYS_ON_TOP_ACTION_Y "ALWAYS_ON_TOP_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 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_FLOW_ACTION_Y "SHOW_FLOW_ACTION_Y"
|
||||||
#define SHOW_EDIT_SHORTCUTS_ACTION_Y "SHOW_EDIT_SHORTCUTS_ACTION_Y"
|
#define SHOW_EDIT_SHORTCUTS_ACTION_Y "SHOW_EDIT_SHORTCUTS_ACTION_Y"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user