mirror of
https://github.com/YACReader/yacreader
synced 2025-07-22 06:54:39 -04:00
Merge
This commit is contained in:
@ -3,6 +3,9 @@
|
||||
# #####################################################################
|
||||
TEMPLATE = app
|
||||
TARGET = YACReader
|
||||
|
||||
QMAKE_TARGET_BUNDLE_PREFIX = "com.yacreader"
|
||||
|
||||
DEPENDPATH += . \
|
||||
release
|
||||
|
||||
@ -11,6 +14,7 @@ QMAKE_MAC_SDK = macosx10.12
|
||||
|
||||
#load default build flags
|
||||
include (../config.pri)
|
||||
include (../dependencies/pdf_backend.pri)
|
||||
|
||||
unix:!macx{
|
||||
QMAKE_CXXFLAGS += -std=c++11
|
||||
@ -27,7 +31,7 @@ CONFIG(force_angle) {
|
||||
SOURCES += main.cpp
|
||||
|
||||
INCLUDEPATH += ../common \
|
||||
../custom_widgets
|
||||
../custom_widgets
|
||||
|
||||
!CONFIG(no_opengl):CONFIG(legacy_gl_widget) {
|
||||
INCLUDEPATH += ../common/gl_legacy \
|
||||
@ -39,51 +43,24 @@ INCLUDEPATH += ../common \
|
||||
win32 {
|
||||
CONFIG(force_angle) {
|
||||
message("using ANGLE")
|
||||
LIBS += -L../dependencies/poppler/lib -loleaut32 -lole32 -lshell32 -lopengl32 -lglu32 -luser32
|
||||
LIBS += -loleaut32 -lole32 -lshell32 -lopengl32 -lglu32 -luser32
|
||||
#linking extra libs are necesary for a successful compilation, a better approach should be
|
||||
#to remove any OpenGL (desktop) dependencies
|
||||
#the OpenGL stuff should be migrated to OpenGL ES
|
||||
DEFINES += FORCE_ANGLE
|
||||
} else {
|
||||
LIBS += -L../dependencies/poppler/lib -loleaut32 -lole32 -lshell32 -lopengl32 -lglu32 -luser32
|
||||
LIBS += -loleaut32 -lole32 -lshell32 -lopengl32 -lglu32 -luser32
|
||||
}
|
||||
|
||||
!CONFIG(no_pdf) {
|
||||
LIBS += -lpoppler-qt5
|
||||
INCLUDEPATH += ../dependencies/poppler/include/qt5
|
||||
} else {
|
||||
DEFINES += "NO_PDF"
|
||||
}
|
||||
|
||||
QMAKE_CXXFLAGS_RELEASE += /MP /Ob2 /Oi /Ot /GT /GL
|
||||
QMAKE_LFLAGS_RELEASE += /LTCG
|
||||
CONFIG -= embed_manifest_exe
|
||||
}
|
||||
|
||||
unix:!macx{
|
||||
!CONFIG(no_pdf){
|
||||
!CONFIG(pdfium){
|
||||
INCLUDEPATH += /usr/include/poppler/qt5
|
||||
LIBS += -L/usr/lib -lpoppler-qt5
|
||||
} else {
|
||||
#static pdfium libraries have to be included *before* dynamic libraries
|
||||
DEFINES += "USE_PDFIUM"
|
||||
INCLUDEPATH += /usr/include/pdfium
|
||||
LIBS += -L/usr/lib/pdfium -Wl,--start-group -lpdfium -lfpdfapi -lfxge -lfpdfdoc \
|
||||
-lfxcrt -lfx_agg -lfxcodec -lfx_lpng -lfx_libopenjpeg -lfx_lcms2 -ljpeg \
|
||||
-lfx_zlib -lfdrm -lfxedit -lformfiller -lpdfwindow -lpdfium -lbigint -ljavascript \
|
||||
-lfxedit -Wl,--end-group -lfreetype
|
||||
}
|
||||
} else {
|
||||
DEFINES += "NO_PDF"
|
||||
}
|
||||
|
||||
!CONFIG(no_opengl) {
|
||||
unix:!macx:!CONFIG(no_opengl) {
|
||||
LIBS += -lGLU
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
macx{
|
||||
#INCLUDEPATH += "/Volumes/Mac OS X Lion/usr/X11/include"
|
||||
#isEqual(QT_MAJOR_VERSION, 5) {
|
||||
@ -95,20 +72,11 @@ macx{
|
||||
#LIBS += -L/usr/local/lib -lpoppler-qt4
|
||||
#}
|
||||
|
||||
#TODO: pdfium support
|
||||
!CONFIG(no_pdf) {
|
||||
DEFINES += "USE_PDFKIT"
|
||||
} else {
|
||||
DEFINES += "NO_PDF"
|
||||
}
|
||||
|
||||
CONFIG += objective_c
|
||||
QT += macextras gui-private
|
||||
|
||||
|
||||
LIBS += -framework Foundation -framework ApplicationServices -framework AppKit
|
||||
|
||||
OBJECTIVE_SOURCES += ../common/pdf_comic.mm
|
||||
}
|
||||
|
||||
QT += network widgets core
|
||||
@ -155,7 +123,7 @@ HEADERS += ../common/comic.h \
|
||||
../common/exit_check.h \
|
||||
../common/scroll_management.h \
|
||||
../common/opengl_checker.h \
|
||||
../common/pdf_comic.h
|
||||
../common/pdf_comic.h
|
||||
|
||||
!CONFIG(no_opengl) {
|
||||
CONFIG(legacy_gl_widget) {
|
||||
@ -294,4 +262,4 @@ manpage.files = ../YACReader.1
|
||||
|
||||
#remove leftover doc files when 'make clean' is invoked
|
||||
QMAKE_CLEAN += "../changelog" "../README"
|
||||
}
|
||||
}
|
@ -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
|
||||
|
@ -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());
|
||||
|
@ -23,7 +23,8 @@ Q_OBJECT
|
||||
//QLabel * pathLabel;
|
||||
QLineEdit * pathEdit;
|
||||
QPushButton * pathFindButton;
|
||||
QCheckBox * quickNavi;
|
||||
QCheckBox * quickNavi;
|
||||
QCheckBox * disableShowOnMouseOver;
|
||||
|
||||
QLabel * magGlassSizeLabel;
|
||||
|
||||
|
@ -765,27 +765,30 @@ 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(goToFlow->isVisible())
|
||||
{
|
||||
QPoint gtfPos = goToFlow->mapFrom(this,event->pos());
|
||||
if(gtfPos.y() < 0 || gtfPos.x()<0 || gtfPos.x()>goToFlow->width())//TODO this extra check is for Mavericks (mouseMove over goToFlowGL seems to be broken)
|
||||
animateHideGoToFlow();
|
||||
//goToFlow->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
int umbral = (width()-goToFlow->width())/2;
|
||||
if((event->y()>height()-15)&&(event->x()>umbral)&&(event->x()<width()-umbral))
|
||||
{
|
||||
if(Configuration::getConfiguration().getDisableShowOnMouseOver() == false)
|
||||
{
|
||||
if(goToFlow->isVisible())
|
||||
{
|
||||
QPoint gtfPos = goToFlow->mapFrom(this,event->pos());
|
||||
if(gtfPos.y() < 0 || gtfPos.x()<0 || gtfPos.x()>goToFlow->width())//TODO this extra check is for Mavericks (mouseMove over goToFlowGL seems to be broken)
|
||||
animateHideGoToFlow();
|
||||
//goToFlow->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
int umbral = (width()-goToFlow->width())/2;
|
||||
if((event->y()>height()-15)&&(event->x()>umbral)&&(event->x()<width()-umbral))
|
||||
{
|
||||
|
||||
animateShowGoToFlow();
|
||||
hideCursorTimer->stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
animateShowGoToFlow();
|
||||
hideCursorTimer->stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(drag)
|
||||
{
|
||||
@ -903,6 +906,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();
|
||||
|
Reference in New Issue
Block a user