mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Add zoom controls to main window viewer
This commit is contained in:
parent
e188216f50
commit
ef3a210b98
@ -408,6 +408,20 @@ 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()));
|
||||||
|
|
||||||
|
increasePageZoomAction = new QAction(tr("Zoom+"),this);
|
||||||
|
increasePageZoomAction->setDisabled(true);
|
||||||
|
increasePageZoomAction->setData(ZOOM_PLUS_ACTION_Y);
|
||||||
|
increasePageZoomAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_PLUS_ACTION_Y));
|
||||||
|
|
||||||
|
connect(increasePageZoomAction,SIGNAL(triggered()),this,SLOT(increasePageZoomLevel()));
|
||||||
|
|
||||||
|
decreasePageZoomAction = new QAction(tr("Zoom-"),this);
|
||||||
|
decreasePageZoomAction->setDisabled(true);
|
||||||
|
decreasePageZoomAction->setData(ZOOM_MINUS_ACTION_Y);
|
||||||
|
decreasePageZoomAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_MINUS_ACTION_Y));
|
||||||
|
|
||||||
|
connect(decreasePageZoomAction,SIGNAL(triggered()),this,SLOT(decreasePageZoomLevel()));
|
||||||
|
|
||||||
showFlowAction = new QAction(tr("Show go to flow"),this);
|
showFlowAction = new QAction(tr("Show go to flow"),this);
|
||||||
showFlowAction->setIcon(QIcon(":/images/viewer_toolbar/flow.png"));
|
showFlowAction->setIcon(QIcon(":/images/viewer_toolbar/flow.png"));
|
||||||
showFlowAction->setDisabled(true);
|
showFlowAction->setDisabled(true);
|
||||||
@ -578,6 +592,8 @@ void MainWindowViewer::createToolBars()
|
|||||||
YACReader::addSperator(viewer);
|
YACReader::addSperator(viewer);
|
||||||
|
|
||||||
viewer->addAction(showMagnifyingGlassAction);
|
viewer->addAction(showMagnifyingGlassAction);
|
||||||
|
viewer->addAction(increasePageZoomAction);
|
||||||
|
viewer->addAction(decreasePageZoomAction);
|
||||||
YACReader::addSperator(viewer);
|
YACReader::addSperator(viewer);
|
||||||
|
|
||||||
viewer->addAction(setBookmarkAction);
|
viewer->addAction(setBookmarkAction);
|
||||||
@ -820,6 +836,8 @@ void MainWindowViewer::enableActions()
|
|||||||
doublePageAction->setDisabled(false);
|
doublePageAction->setDisabled(false);
|
||||||
doubleMangaPageAction->setDisabled(false);
|
doubleMangaPageAction->setDisabled(false);
|
||||||
adjustToFullSizeAction->setDisabled(false);
|
adjustToFullSizeAction->setDisabled(false);
|
||||||
|
increasePageZoomAction->setDisabled(false);
|
||||||
|
decreasePageZoomAction->setDisabled(false);
|
||||||
//setBookmark->setDisabled(false);
|
//setBookmark->setDisabled(false);
|
||||||
showBookmarksAction->setDisabled(false);
|
showBookmarksAction->setDisabled(false);
|
||||||
showInfoAction->setDisabled(false); //TODO enable goTo and showInfo (or update) when numPages emited
|
showInfoAction->setDisabled(false); //TODO enable goTo and showInfo (or update) when numPages emited
|
||||||
@ -948,11 +966,13 @@ void MainWindowViewer::showToolBars()
|
|||||||
void MainWindowViewer::fitToWidth()
|
void MainWindowViewer::fitToWidth()
|
||||||
{
|
{
|
||||||
Configuration::getConfiguration().setFitMode(YACReader::FitMode::ToWidth);
|
Configuration::getConfiguration().setFitMode(YACReader::FitMode::ToWidth);
|
||||||
|
viewer->setZoomFactor(1);
|
||||||
viewer->updatePage();
|
viewer->updatePage();
|
||||||
}
|
}
|
||||||
void MainWindowViewer::fitToHeight()
|
void MainWindowViewer::fitToHeight()
|
||||||
{
|
{
|
||||||
Configuration::getConfiguration().setFitMode(YACReader::FitMode::ToHeight);
|
Configuration::getConfiguration().setFitMode(YACReader::FitMode::ToHeight);
|
||||||
|
viewer->setZoomFactor(1);
|
||||||
viewer->updatePage();
|
viewer->updatePage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1081,7 +1101,9 @@ void MainWindowViewer::setUpShortcutsManagement()
|
|||||||
<< rightRotationAction
|
<< rightRotationAction
|
||||||
<< doublePageAction
|
<< doublePageAction
|
||||||
<< doubleMangaPageAction
|
<< doubleMangaPageAction
|
||||||
<< adjustToFullSizeAction);
|
<< adjustToFullSizeAction
|
||||||
|
<< increasePageZoomAction
|
||||||
|
<< decreasePageZoomAction);
|
||||||
|
|
||||||
allActions << tmpList;
|
allActions << tmpList;
|
||||||
|
|
||||||
@ -1361,9 +1383,20 @@ void MainWindowViewer::alwaysOnTopSwitch()
|
|||||||
void MainWindowViewer::adjustToFullSizeSwitch()
|
void MainWindowViewer::adjustToFullSizeSwitch()
|
||||||
{
|
{
|
||||||
Configuration::getConfiguration().setFitMode(YACReader::FitMode::FullRes);
|
Configuration::getConfiguration().setFitMode(YACReader::FitMode::FullRes);
|
||||||
|
viewer->setZoomFactor(1);
|
||||||
viewer->updatePage();
|
viewer->updatePage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindowViewer::increasePageZoomLevel()
|
||||||
|
{
|
||||||
|
viewer->increaseZoomFactor();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindowViewer::decreasePageZoomLevel()
|
||||||
|
{
|
||||||
|
viewer->decreaseZoomFactor();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindowViewer::sendComic()
|
void MainWindowViewer::sendComic()
|
||||||
{
|
{
|
||||||
YACReaderLocalClient * client = new YACReaderLocalClient;
|
YACReaderLocalClient * client = new YACReaderLocalClient;
|
||||||
|
@ -54,6 +54,8 @@ class EditShortcutsDialog;
|
|||||||
void openFolderFromPath(QString pathFile, QString atFileName);
|
void openFolderFromPath(QString pathFile, QString atFileName);
|
||||||
void alwaysOnTopSwitch();
|
void alwaysOnTopSwitch();
|
||||||
void adjustToFullSizeSwitch();
|
void adjustToFullSizeSwitch();
|
||||||
|
void increasePageZoomLevel();
|
||||||
|
void decreasePageZoomLevel();
|
||||||
void reloadOptions();
|
void reloadOptions();
|
||||||
void fitToWidth();
|
void fitToWidth();
|
||||||
void fitToHeight();
|
void fitToHeight();
|
||||||
@ -124,6 +126,8 @@ class EditShortcutsDialog;
|
|||||||
QAction *showDictionaryAction;
|
QAction *showDictionaryAction;
|
||||||
QAction *alwaysOnTopAction;
|
QAction *alwaysOnTopAction;
|
||||||
QAction *adjustToFullSizeAction;
|
QAction *adjustToFullSizeAction;
|
||||||
|
QAction *increasePageZoomAction;
|
||||||
|
QAction *decreasePageZoomAction;
|
||||||
QAction *showFlowAction;
|
QAction *showFlowAction;
|
||||||
|
|
||||||
QAction *showEditShortcutsAction;
|
QAction *showEditShortcutsAction;
|
||||||
|
@ -118,6 +118,8 @@ public:
|
|||||||
#define TOGGLE_FULL_SCREEN_ACTION_Y "TOGGLE_FULL_SCREEN_ACTION_Y"
|
#define TOGGLE_FULL_SCREEN_ACTION_Y "TOGGLE_FULL_SCREEN_ACTION_Y"
|
||||||
#define TOGGLE_TOOL_BARS_ACTION_Y "TOGGLE_TOOL_BARS_ACTION_Y"
|
#define TOGGLE_TOOL_BARS_ACTION_Y "TOGGLE_TOOL_BARS_ACTION_Y"
|
||||||
#define CHANGE_FIT_ACTION_Y "CHANGE_FIT_ACTION_Y"
|
#define CHANGE_FIT_ACTION_Y "CHANGE_FIT_ACTION_Y"
|
||||||
|
#define ZOOM_PLUS_ACTION_Y "ZOOM_PLUS_ACTION_Y"
|
||||||
|
#define ZOOM_MINUS_ACTION_Y "ZOOM_MINUS_ACTION_Y"
|
||||||
//viewer
|
//viewer
|
||||||
#define AUTO_SCROLL_FORWARD_ACTION_Y "AUTO_SCROLL_FORWARD_ACTION_Y"
|
#define AUTO_SCROLL_FORWARD_ACTION_Y "AUTO_SCROLL_FORWARD_ACTION_Y"
|
||||||
#define AUTO_SCROLL_BACKWARD_ACTION_Y "AUTO_SCROLL_BACKWARD_ACTION_Y"
|
#define AUTO_SCROLL_BACKWARD_ACTION_Y "AUTO_SCROLL_BACKWARD_ACTION_Y"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user