Added an option to disable showing the go to flow on mouse over.

This commit is contained in:
Luis Ángel San Martín 2017-02-18 09:18:19 +01:00
parent 6d23989a96
commit 4527931083
5 changed files with 25 additions and 6 deletions

View File

@ -110,6 +110,7 @@ using namespace YACReader;
int getNumDaysBetweenVersionChecks() {return settings->value(NUM_DAYS_BETWEEN_VERSION_CHECKS,1).toInt();} 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);} void setNumDaysBetweenVersionChecks(int days) {return settings->setValue(NUM_DAYS_BETWEEN_VERSION_CHECKS,days);}
bool getQuickNaviMode(){return settings->value(QUICK_NAVI_MODE).toBool();} bool getQuickNaviMode(){return settings->value(QUICK_NAVI_MODE).toBool();}
bool getDisableShowOnMouseOver(){return settings->value(DISABLE_MOUSE_OVER_GOTO_FLOW).toBool();}
}; };
#endif #endif

View File

@ -105,7 +105,8 @@ OptionsDialog::OptionsDialog(QWidget * parent)
connect(gammaS,SIGNAL(valueChanged(int)),this,SLOT(gammaChanged(int))); connect(gammaS,SIGNAL(valueChanged(int)),this,SLOT(gammaChanged(int)));
//connect(brightnessS,SIGNAL(valueChanged(int)),this,SIGNAL(changedOptions())); //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(); QHBoxLayout * buttons = new QHBoxLayout();
buttons->addStretch(); buttons->addStretch();
@ -119,13 +120,16 @@ OptionsDialog::OptionsDialog(QWidget * parent)
layoutGeneral->addWidget(colorBox); layoutGeneral->addWidget(colorBox);
layoutGeneral->addWidget(shortcutsBox); layoutGeneral->addWidget(shortcutsBox);
layoutGeneral->addStretch(); layoutGeneral->addStretch();
layoutFlow->addWidget(sw); layoutFlow->addWidget(sw);
#ifndef NO_OPENGL #ifndef NO_OPENGL
layoutFlow->addWidget(gl); layoutFlow->addWidget(gl);
layoutFlow->addWidget(useGL); layoutFlow->addWidget(useGL);
#endif #endif
layoutFlow->addWidget(quickNavi); layoutFlow->addWidget(quickNavi);
layoutFlow->addWidget(disableShowOnMouseOver);
layoutFlow->addStretch(); layoutFlow->addStretch();
layoutImage->addWidget(new QLabel(tr("Brightness")),0,0); layoutImage->addWidget(new QLabel(tr("Brightness")),0,0);
layoutImage->addWidget(new QLabel(tr("Contrast")),1,0); layoutImage->addWidget(new QLabel(tr("Contrast")),1,0);
layoutImage->addWidget(new QLabel(tr("Gamma")),2,0); layoutImage->addWidget(new QLabel(tr("Gamma")),2,0);
@ -194,7 +198,8 @@ void OptionsDialog::saveOptions()
settings->setValue(BACKGROUND_COLOR,colorDialog->currentColor()); settings->setValue(BACKGROUND_COLOR,colorDialog->currentColor());
//settings->setValue(FIT_TO_WIDTH_RATIO,fitToWidthRatioS->sliderPosition()/100.0); //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(); YACReaderOptionsDialog::saveOptions();
} }
@ -225,7 +230,8 @@ void OptionsDialog::restoreOptions(QSettings * settings)
updateColor(settings->value(BACKGROUND_COLOR).value<QColor>()); updateColor(settings->value(BACKGROUND_COLOR).value<QColor>());
//fitToWidthRatioS->setSliderPosition(settings->value(FIT_TO_WIDTH_RATIO).toFloat()*100); //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()); brightnessS->setValue(settings->value(BRIGHTNESS,0).toInt());
contrastS->setValue(settings->value(CONTRAST,100).toInt()); contrastS->setValue(settings->value(CONTRAST,100).toInt());

View File

@ -23,7 +23,8 @@ Q_OBJECT
//QLabel * pathLabel; //QLabel * pathLabel;
QLineEdit * pathEdit; QLineEdit * pathEdit;
QPushButton * pathFindButton; QPushButton * pathFindButton;
QCheckBox * quickNavi; QCheckBox * quickNavi;
QCheckBox * disableShowOnMouseOver;
QLabel * magGlassSizeLabel; QLabel * magGlassSizeLabel;

View File

@ -765,9 +765,14 @@ void Viewer::mouseMoveEvent(QMouseEvent * event)
mglass->move(static_cast<int>(event->x()-float(mglass->width())/2),static_cast<int>(event->y()-float(mglass->height())/2)); mglass->move(static_cast<int>(event->x()-float(mglass->width())/2),static_cast<int>(event->y()-float(mglass->height())/2));
if(render->hasLoadedComic()) if(render->hasLoadedComic())
{ {
if(showGoToFlowAnimation->state()!=QPropertyAnimation::Running) if(showGoToFlowAnimation->state()!=QPropertyAnimation::Running)
{ {
if(Configuration::getConfiguration().getDisableShowOnMouseOver())
{
return;
}
if(goToFlow->isVisible()) if(goToFlow->isVisible())
{ {
QPoint gtfPos = goToFlow->mapFrom(this,event->pos()); QPoint gtfPos = goToFlow->mapFrom(this,event->pos());
@ -776,7 +781,7 @@ void Viewer::mouseMoveEvent(QMouseEvent * event)
//goToFlow->hide(); //goToFlow->hide();
} }
else else
{ {
int umbral = (width()-goToFlow->width())/2; int umbral = (width()-goToFlow->width())/2;
if((event->y()>height()-15)&&(event->x()>umbral)&&(event->x()<width()-umbral)) if((event->y()>height()-15)&&(event->x()>umbral)&&(event->x()<width()-umbral))
{ {
@ -903,6 +908,11 @@ void Viewer::animateHideGoToFlow()
void Viewer::moveCursoToGoToFlow() void Viewer::moveCursoToGoToFlow()
{ {
if(Configuration::getConfiguration().getDisableShowOnMouseOver())
{
return;
}
//Move cursor to goToFlow widget on show (this avoid hide when mouse is moved) //Move cursor to goToFlow widget on show (this avoid hide when mouse is moved)
int y = goToFlow->pos().y(); int y = goToFlow->pos().y();
int x1 = goToFlow->pos().x(); int x1 = goToFlow->pos().x();

View File

@ -28,6 +28,7 @@
#define GAMMA "GAMMA" #define GAMMA "GAMMA"
#define SHOW_INFO "SHOW_INFO" #define SHOW_INFO "SHOW_INFO"
#define QUICK_NAVI_MODE "QUICK_NAVI_MODE" #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 FLOW_TYPE_GL "FLOW_TYPE_GL"
#define Y_POSITION "Y_POSITION" #define Y_POSITION "Y_POSITION"