diff --git a/YACReader/configuration.cpp b/YACReader/configuration.cpp index 909a76c8..059d4090 100644 --- a/YACReader/configuration.cpp +++ b/YACReader/configuration.cpp @@ -39,8 +39,11 @@ void Configuration::load(QSettings * settings) settings->setValue(FLOW_TYPE,0); if(!settings->contains(FULLSCREEN)) settings->setValue(FULLSCREEN,false); + +//TODO: Replace this with zoom mode if(!settings->contains(FIT_TO_WIDTH_RATIO)) settings->setValue(FIT_TO_WIDTH_RATIO,1); + if(!settings->contains(Y_WINDOW_SIZE)) settings->setValue(Y_WINDOW_SIZE,QSize(0,0)); if(!settings->contains(MAXIMIZED)) diff --git a/YACReader/configuration.h b/YACReader/configuration.h index 213e58ce..559e05d1 100644 --- a/YACReader/configuration.h +++ b/YACReader/configuration.h @@ -27,7 +27,7 @@ using namespace YACReader; QSize magnifyingGlassSize; QSize gotoSlideSize; float zoomLevel; - bool adjustToWidth; + //bool adjustToWidth; bool fullScreen; FlowType flowType; float fitToWidthRatio; diff --git a/YACReader/main_window_viewer.cpp b/YACReader/main_window_viewer.cpp index 1198ecb5..e1f738c8 100644 --- a/YACReader/main_window_viewer.cpp +++ b/YACReader/main_window_viewer.cpp @@ -414,7 +414,7 @@ void MainWindowViewer::createActions() fitToPageAction = new QAction(tr("Fit to page"),this); //fitToPageAction->setIcon(QIcon(":/images/viewer_toolbar/full.png")); - fitToPageAction->setCheckable(true); + //fitToPageAction->setCheckable(true); fitToPageAction->setDisabled(true); //fitToPageAction->setChecked(Configuration::getConfiguration().getFitToPage()); fitToPageAction->setData(FIT_TO_PAGE_ACTION_Y); @@ -422,19 +422,20 @@ void MainWindowViewer::createActions() 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); + //increasePageZoomAction->setIcon(QIcon(":/images/viewer_toolbar/full.png")); + 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); - //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); + //decreasePageZoomAction->setIcon(QIcon(":/images/viewer_toolbar/full.png")); + decreasePageZoomAction->setDisabled(true); + decreasePageZoomAction->setData(ZOOM_MINUS_ACTION_Y); + decreasePageZoomAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_MINUS_ACTION_Y)); + //decreasePageZoomAction->setShortcut(QKeySequence::ZoomOut); + connect(decreasePageZoomAction,SIGNAL(triggered()),this,SLOT(decreasePageZoomLevel())); showFlowAction = new QAction(tr("Show go to flow"),this); @@ -839,6 +840,8 @@ void MainWindowViewer::enableActions() doubleMangaPageAction->setDisabled(false); adjustToFullSizeAction->setDisabled(false); fitToPageAction->setDisabled(false); + increasePageZoomAction->setDisabled(false); + decreasePageZoomAction->setDisabled(false); //setBookmark->setDisabled(false); showBookmarksAction->setDisabled(false); showInfoAction->setDisabled(false); //TODO enable goTo and showInfo (or update) when numPages emited diff --git a/common/yacreader_global.h b/common/yacreader_global.h index e57f4105..2ce3de78 100644 --- a/common/yacreader_global.h +++ b/common/yacreader_global.h @@ -18,8 +18,8 @@ #define SLIDE_SIZE "SLIDE_SIZE" #define GO_TO_FLOW_SIZE "GO_TO_FLOW_SIZE" #define FLOW_TYPE_SW "FLOW_TYPE_SW" -#define FIT "FIT" -#define PAGEFIT "PAGEFIT" +//#define FIT "FIT" +//#define PAGEFIT "PAGEFIT" #define FITMODE "FITMODE" #define FLOW_TYPE "FLOW_TYPE" #define FULLSCREEN "FULLSCREEN" @@ -29,7 +29,7 @@ #define MAXIMIZED "MAXIMIZED" #define DOUBLE_PAGE "DOUBLE_PAGE" #define DOUBLE_MANGA_PAGE "DOUBLE_MANGA_PAGE" -#define ADJUST_TO_FULL_SIZE "ADJUST_TO_FULL_SIZE" +//#define ADJUST_TO_FULL_SIZE "ADJUST_TO_FULL_SIZE" #define BACKGROUND_COLOR "BACKGROUND_COLOR" #define ALWAYS_ON_TOP "ALWAYS_ON_TOP" #define SHOW_TOOLBARS "SHOW_TOOLBARS" diff --git a/shortcuts_management/shortcuts_manager.cpp b/shortcuts_management/shortcuts_manager.cpp index 40e725de..5558b617 100644 --- a/shortcuts_management/shortcuts_manager.cpp +++ b/shortcuts_management/shortcuts_manager.cpp @@ -52,7 +52,9 @@ void ShortcutsManager::initDefaultShorcuts() defaultShorcuts.insert(ALWAYS_ON_TOP_ACTION_Y, Qt::Key_Q); //deprecated defaultShorcuts.insert(ADJUST_TO_FULL_SIZE_ACTION_Y, Qt::Key_W); defaultShorcuts.insert(SHOW_FLOW_ACTION_Y, Qt::Key_S); - + defaultShorcuts.insert(ZOOM_PLUS_ACTION_Y, QKeySequence::ZoomIn); + defaultShorcuts.insert(ZOOM_MINUS_ACTION_Y, QKeySequence::ZoomOut); + //main_window_viewer defaultShorcuts.insert(TOGGLE_FULL_SCREEN_ACTION_Y, Qt::Key_F); defaultShorcuts.insert(TOGGLE_TOOL_BARS_ACTION_Y, Qt::Key_H); diff --git a/shortcuts_management/shortcuts_manager.h b/shortcuts_management/shortcuts_manager.h index b3f7bd13..5ed39454 100644 --- a/shortcuts_management/shortcuts_manager.h +++ b/shortcuts_management/shortcuts_manager.h @@ -109,6 +109,8 @@ public: #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 ZOOM_PLUS_ACTION_Y "ZOOM_PLUS_ACTION_Y" +#define ZOOM_MINUS_ACTION_Y "ZOOM_MINUS_ACTION_Y" #define SHOW_FLOW_ACTION_Y "SHOW_FLOW_ACTION_Y" #define SHOW_EDIT_SHORTCUTS_ACTION_Y "SHOW_EDIT_SHORTCUTS_ACTION_Y"