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

@ -106,6 +106,7 @@ OptionsDialog::OptionsDialog(QWidget * parent)
//connect(brightnessS,SIGNAL(valueChanged(int)),this,SIGNAL(changedOptions()));
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);
@ -195,6 +199,7 @@ 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(DISABLE_MOUSE_OVER_GOTO_FLOW,disableShowOnMouseOver->isChecked());
YACReaderOptionsDialog::saveOptions();
}
@ -226,6 +231,7 @@ void OptionsDialog::restoreOptions(QSettings * settings)
//fitToWidthRatioS->setSliderPosition(settings->value(FIT_TO_WIDTH_RATIO).toFloat()*100);
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

@ -24,6 +24,7 @@ Q_OBJECT
QLineEdit * pathEdit;
QPushButton * pathFindButton;
QCheckBox * quickNavi;
QCheckBox * disableShowOnMouseOver;
QLabel * magGlassSizeLabel;

View File

@ -768,6 +768,11 @@ void Viewer::mouseMoveEvent(QMouseEvent * event)
{
if(showGoToFlowAnimation->state()!=QPropertyAnimation::Running)
{
if(Configuration::getConfiguration().getDisableShowOnMouseOver())
{
return;
}
if(goToFlow->isVisible())
{
QPoint gtfPos = goToFlow->mapFrom(this,event->pos());
@ -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"