mirror of
https://github.com/YACReader/yacreader
synced 2025-07-22 23:15:14 -04:00
Scaling code refractoring, add fit to page mode and zoom levels
This commit is contained in:
@ -420,6 +420,22 @@ void MainWindowViewer::createActions()
|
||||
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);
|
||||
//fitToPageAction->setIcon(QIcon(":/images/viewer_toolbar/full.png"));
|
||||
//fitToPageAction->setDisabled(true);
|
||||
//fitToPageAction->setChecked(Configuration::getConfiguration().getFitToPage());
|
||||
//fitToPageAction->setData(FIT_TO_PAGE_ACTION_Y);
|
||||
increasePageZoomAction->setShortcut(QKeySequence::ZoomIn);
|
||||
connect(increasePageZoomAction,SIGNAL(triggered()),this,SLOT(increasePageZoomLevel()));
|
||||
|
||||
decreasePageZoomAction = new QAction(tr("Zoom-"),this);
|
||||
//fitToPageAction->setIcon(QIcon(":/images/viewer_toolbar/full.png"));
|
||||
//fitToPageAction->setDisabled(true);
|
||||
//fitToPageAction->setChecked(Configuration::getConfiguration().getFitToPage());
|
||||
//fitToPageAction->setData(FIT_TO_PAGE_ACTION_Y);
|
||||
decreasePageZoomAction->setShortcut(QKeySequence::ZoomOut);
|
||||
connect(decreasePageZoomAction,SIGNAL(triggered()),this,SLOT(decreasePageZoomLevel()));
|
||||
|
||||
showFlowAction = new QAction(tr("Show go to flow"),this);
|
||||
showFlowAction->setIcon(QIcon(":/images/viewer_toolbar/flow.png"));
|
||||
@ -543,7 +559,8 @@ void MainWindowViewer::createToolBars()
|
||||
comicToolBar->addSeparator();
|
||||
|
||||
comicToolBar->addAction(showMagnifyingGlassAction);
|
||||
|
||||
comicToolBar->addAction(increasePageZoomAction);
|
||||
comicToolBar->addAction(decreasePageZoomAction);
|
||||
|
||||
comicToolBar->addSeparator();
|
||||
|
||||
@ -1396,6 +1413,19 @@ void MainWindowViewer::fitToPageSwitch()
|
||||
viewer->updatePage();
|
||||
}
|
||||
|
||||
void MainWindowViewer::increasePageZoomLevel()
|
||||
{
|
||||
qDebug() << "Increase page zoom level!";
|
||||
Configuration::getConfiguration().setPageZoomLevel(Configuration::getConfiguration().getPageZoomLevel() + 0.1);
|
||||
viewer->updatePage();
|
||||
}
|
||||
|
||||
void MainWindowViewer::decreasePageZoomLevel()
|
||||
{
|
||||
Configuration::getConfiguration().setPageZoomLevel(Configuration::getConfiguration().getPageZoomLevel() - 0.1);
|
||||
viewer->updatePage();
|
||||
}
|
||||
|
||||
void MainWindowViewer::sendComic()
|
||||
{
|
||||
YACReaderLocalClient * client = new YACReaderLocalClient;
|
||||
|
Reference in New Issue
Block a user