From 4527931083b908dfec6dce44877f3b0aa4d6d5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 18 Feb 2017 09:18:19 +0100 Subject: [PATCH] Added an option to disable showing the go to flow on mouse over. --- YACReader/configuration.h | 1 + YACReader/options_dialog.cpp | 12 +++++++++--- YACReader/options_dialog.h | 3 ++- YACReader/viewer.cpp | 14 ++++++++++++-- common/yacreader_global_gui.h | 1 + 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/YACReader/configuration.h b/YACReader/configuration.h index 6d27227d..9a751112 100644 --- a/YACReader/configuration.h +++ b/YACReader/configuration.h @@ -110,6 +110,7 @@ using namespace YACReader; int getNumDaysBetweenVersionChecks() {return settings->value(NUM_DAYS_BETWEEN_VERSION_CHECKS,1).toInt();} void setNumDaysBetweenVersionChecks(int days) {return settings->setValue(NUM_DAYS_BETWEEN_VERSION_CHECKS,days);} bool getQuickNaviMode(){return settings->value(QUICK_NAVI_MODE).toBool();} + bool getDisableShowOnMouseOver(){return settings->value(DISABLE_MOUSE_OVER_GOTO_FLOW).toBool();} }; #endif diff --git a/YACReader/options_dialog.cpp b/YACReader/options_dialog.cpp index b542d2c3..559b044a 100644 --- a/YACReader/options_dialog.cpp +++ b/YACReader/options_dialog.cpp @@ -105,7 +105,8 @@ OptionsDialog::OptionsDialog(QWidget * parent) connect(gammaS,SIGNAL(valueChanged(int)),this,SLOT(gammaChanged(int))); //connect(brightnessS,SIGNAL(valueChanged(int)),this,SIGNAL(changedOptions())); - quickNavi = new QCheckBox(tr("Quick Navigation Mode")); + quickNavi = new QCheckBox(tr("Quick Navigation Mode")); + disableShowOnMouseOver = new QCheckBox(tr("Disable mouse over activation")); QHBoxLayout * buttons = new QHBoxLayout(); buttons->addStretch(); @@ -119,13 +120,16 @@ OptionsDialog::OptionsDialog(QWidget * parent) layoutGeneral->addWidget(colorBox); layoutGeneral->addWidget(shortcutsBox); layoutGeneral->addStretch(); + layoutFlow->addWidget(sw); #ifndef NO_OPENGL layoutFlow->addWidget(gl); layoutFlow->addWidget(useGL); #endif layoutFlow->addWidget(quickNavi); + layoutFlow->addWidget(disableShowOnMouseOver); layoutFlow->addStretch(); + layoutImage->addWidget(new QLabel(tr("Brightness")),0,0); layoutImage->addWidget(new QLabel(tr("Contrast")),1,0); layoutImage->addWidget(new QLabel(tr("Gamma")),2,0); @@ -194,7 +198,8 @@ void OptionsDialog::saveOptions() settings->setValue(BACKGROUND_COLOR,colorDialog->currentColor()); //settings->setValue(FIT_TO_WIDTH_RATIO,fitToWidthRatioS->sliderPosition()/100.0); - settings->setValue(QUICK_NAVI_MODE,quickNavi->isChecked()); + settings->setValue(QUICK_NAVI_MODE,quickNavi->isChecked()); + settings->setValue(DISABLE_MOUSE_OVER_GOTO_FLOW,disableShowOnMouseOver->isChecked()); YACReaderOptionsDialog::saveOptions(); } @@ -225,7 +230,8 @@ void OptionsDialog::restoreOptions(QSettings * settings) updateColor(settings->value(BACKGROUND_COLOR).value()); //fitToWidthRatioS->setSliderPosition(settings->value(FIT_TO_WIDTH_RATIO).toFloat()*100); - quickNavi->setChecked(settings->value(QUICK_NAVI_MODE).toBool()); + quickNavi->setChecked(settings->value(QUICK_NAVI_MODE).toBool()); + disableShowOnMouseOver->setChecked(settings->value(DISABLE_MOUSE_OVER_GOTO_FLOW).toBool()); brightnessS->setValue(settings->value(BRIGHTNESS,0).toInt()); contrastS->setValue(settings->value(CONTRAST,100).toInt()); diff --git a/YACReader/options_dialog.h b/YACReader/options_dialog.h index df0a723b..95bc5403 100644 --- a/YACReader/options_dialog.h +++ b/YACReader/options_dialog.h @@ -23,7 +23,8 @@ Q_OBJECT //QLabel * pathLabel; QLineEdit * pathEdit; QPushButton * pathFindButton; - QCheckBox * quickNavi; + QCheckBox * quickNavi; + QCheckBox * disableShowOnMouseOver; QLabel * magGlassSizeLabel; diff --git a/YACReader/viewer.cpp b/YACReader/viewer.cpp index 8fb45728..e0290b98 100644 --- a/YACReader/viewer.cpp +++ b/YACReader/viewer.cpp @@ -765,9 +765,14 @@ void Viewer::mouseMoveEvent(QMouseEvent * event) mglass->move(static_cast(event->x()-float(mglass->width())/2),static_cast(event->y()-float(mglass->height())/2)); if(render->hasLoadedComic()) - { + { if(showGoToFlowAnimation->state()!=QPropertyAnimation::Running) { + if(Configuration::getConfiguration().getDisableShowOnMouseOver()) + { + return; + } + if(goToFlow->isVisible()) { QPoint gtfPos = goToFlow->mapFrom(this,event->pos()); @@ -776,7 +781,7 @@ void Viewer::mouseMoveEvent(QMouseEvent * event) //goToFlow->hide(); } else - { + { int umbral = (width()-goToFlow->width())/2; if((event->y()>height()-15)&&(event->x()>umbral)&&(event->x()pos().y(); int x1 = goToFlow->pos().x(); diff --git a/common/yacreader_global_gui.h b/common/yacreader_global_gui.h index 9c36bd56..46680c35 100644 --- a/common/yacreader_global_gui.h +++ b/common/yacreader_global_gui.h @@ -28,6 +28,7 @@ #define GAMMA "GAMMA" #define SHOW_INFO "SHOW_INFO" #define QUICK_NAVI_MODE "QUICK_NAVI_MODE" +#define DISABLE_MOUSE_OVER_GOTO_FLOW "DISABLE_MOUSE_OVER_GOTO_FLOW" #define FLOW_TYPE_GL "FLOW_TYPE_GL" #define Y_POSITION "Y_POSITION"