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();}
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

View File

@ -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<QColor>());
//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());

View File

@ -23,7 +23,8 @@ Q_OBJECT
//QLabel * pathLabel;
QLineEdit * pathEdit;
QPushButton * pathFindButton;
QCheckBox * quickNavi;
QCheckBox * quickNavi;
QCheckBox * disableShowOnMouseOver;
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));
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()<width()-umbral))
{
@ -903,6 +908,11 @@ void Viewer::animateHideGoToFlow()
void Viewer::moveCursoToGoToFlow()
{
if(Configuration::getConfiguration().getDisableShowOnMouseOver())
{
return;
}
//Move cursor to goToFlow widget on show (this avoid hide when mouse is moved)
int y = goToFlow->pos().y();
int x1 = goToFlow->pos().x();

View File

@ -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"