mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 04:54:29 -04:00
New quick navitation mode option for go to flow.
This commit is contained in:
@ -49,6 +49,8 @@ void Configuration::load(QSettings * settings)
|
|||||||
settings->setValue(ALWAYS_ON_TOP,false);
|
settings->setValue(ALWAYS_ON_TOP,false);
|
||||||
if(!settings->contains(SHOW_TOOLBARS))
|
if(!settings->contains(SHOW_TOOLBARS))
|
||||||
settings->setValue(SHOW_TOOLBARS, true);
|
settings->setValue(SHOW_TOOLBARS, true);
|
||||||
|
if(!settings->contains(QUICK_NAVI_MODE))
|
||||||
|
settings->setValue(QUICK_NAVI_MODE, true);
|
||||||
//old fit stuff
|
//old fit stuff
|
||||||
/*if(!settings->contains(FIT))
|
/*if(!settings->contains(FIT))
|
||||||
settings->setValue(FIT,false);
|
settings->setValue(FIT,false);
|
||||||
|
@ -108,6 +108,7 @@ using namespace YACReader;
|
|||||||
void setLastVersionCheck(const QDate & date){ settings->setValue(LAST_VERSION_CHECK,date);}
|
void setLastVersionCheck(const QDate & date){ settings->setValue(LAST_VERSION_CHECK,date);}
|
||||||
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();}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
|
|
||||||
GoToFlow::GoToFlow(QWidget *parent,FlowType flowType)
|
GoToFlow::GoToFlow(QWidget *parent,FlowType flowType)
|
||||||
:GoToFlowWidget(parent),ready(false)
|
:GoToFlowWidget(parent),ready(false)
|
||||||
{
|
{
|
||||||
updateTimer = new QTimer;
|
updateTimer = new QTimer;
|
||||||
connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateImageData()));
|
connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateImageData()));
|
||||||
@ -214,16 +214,14 @@ void GoToFlow::setFlowType(FlowType flowType)
|
|||||||
flow->setFlowType(flowType);
|
flow->setFlowType(flowType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToFlow::updateSize() //TODO : fix. it doesn't work.
|
|
||||||
{
|
|
||||||
imageSize = Configuration::getConfiguration().getGotoSlideSize();
|
|
||||||
flow->setSlideSize(imageSize);
|
|
||||||
resize(static_cast<int>(5*imageSize.width()),static_cast<int>(imageSize.height()*1.7));
|
|
||||||
}
|
|
||||||
|
|
||||||
void GoToFlow::updateConfig(QSettings * settings)
|
void GoToFlow::updateConfig(QSettings * settings)
|
||||||
{
|
{
|
||||||
Q_UNUSED(settings)
|
GoToFlowWidget::updateConfig(settings);
|
||||||
|
|
||||||
|
imageSize = Configuration::getConfiguration().getGotoSlideSize();
|
||||||
|
flow->setFlowType(Configuration::getConfiguration().getFlowType());
|
||||||
|
resize(5*imageSize.width(), toolBar->height() + imageSize.height()*1.7);
|
||||||
|
updateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToFlow::setFlowRightToLeft(bool b)
|
void GoToFlow::setFlowRightToLeft(bool b)
|
||||||
@ -235,7 +233,7 @@ void GoToFlow::setFlowRightToLeft(bool b)
|
|||||||
//SlideInitializer
|
//SlideInitializer
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
SlideInitializer::SlideInitializer(QMutex * m,PictureFlow * flow,int slides)
|
SlideInitializer::SlideInitializer(QMutex * m,PictureFlow * flow,int slides)
|
||||||
:QThread(),mutex(m),_flow(flow),_slides(slides)
|
:QThread(),mutex(m),_flow(flow),_slides(slides)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -256,7 +254,7 @@ void SlideInitializer::run()
|
|||||||
|
|
||||||
|
|
||||||
PageLoader::PageLoader(QMutex * m):
|
PageLoader::PageLoader(QMutex * m):
|
||||||
QThread(),mutex(m), restart(false), working(false), idx(-1)
|
QThread(),mutex(m), restart(false), working(false), idx(-1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,6 @@ private slots:
|
|||||||
void setNumSlides(unsigned int slides);
|
void setNumSlides(unsigned int slides);
|
||||||
void setImageReady(int index,const QByteArray & image);
|
void setImageReady(int index,const QByteArray & image);
|
||||||
void setFlowType(FlowType flowType);
|
void setFlowType(FlowType flowType);
|
||||||
void updateSize();
|
|
||||||
void updateConfig(QSettings * settings);
|
void updateConfig(QSettings * settings);
|
||||||
void setFlowRightToLeft(bool b);
|
void setFlowRightToLeft(bool b);
|
||||||
|
|
||||||
|
@ -77,15 +77,11 @@ void GoToFlowGL::setImageReady(int index,const QByteArray & imageData)
|
|||||||
flow->imagesReady[index] = true;
|
flow->imagesReady[index] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToFlowGL::updateSize()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void GoToFlowGL::updateConfig(QSettings * settings)
|
void GoToFlowGL::updateConfig(QSettings * settings)
|
||||||
{
|
{
|
||||||
Performance performance = medium;
|
GoToFlowWidget::updateConfig(settings);
|
||||||
|
|
||||||
|
Performance performance = medium;
|
||||||
switch (settings->value(PERFORMANCE).toInt())
|
switch (settings->value(PERFORMANCE).toInt())
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
@ -102,30 +98,30 @@ void GoToFlowGL::updateConfig(QSettings * settings)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
imageSize = Configuration::getConfiguration().getGotoSlideSize();
|
||||||
|
resize(5*imageSize.width(), toolBar->height() + imageSize.height()*1.7);
|
||||||
|
updateSize();
|
||||||
|
|
||||||
flow->setPerformance(performance);
|
flow->setPerformance(performance);
|
||||||
|
|
||||||
switch (settings->value(FLOW_TYPE_GL).toInt())
|
switch (settings->value(FLOW_TYPE_GL).toInt())
|
||||||
{
|
{
|
||||||
case 0:
|
case FlowType::CoverFlowLike:
|
||||||
flow->setPreset(presetYACReaderFlowClassicConfig);
|
flow->setPreset(presetYACReaderFlowClassicConfig);
|
||||||
return;
|
break;
|
||||||
case 1:
|
case FlowType::Strip:
|
||||||
flow->setPreset(presetYACReaderFlowStripeConfig);
|
flow->setPreset(presetYACReaderFlowStripeConfig);
|
||||||
return;
|
break;
|
||||||
case 2:
|
case FlowType::StripOverlapped:
|
||||||
flow->setPreset(presetYACReaderFlowOverlappedStripeConfig);
|
flow->setPreset(presetYACReaderFlowOverlappedStripeConfig);
|
||||||
return;
|
break;
|
||||||
case 3:
|
case FlowType::Modern:
|
||||||
flow->setPreset(defaultYACReaderFlowConfig);
|
flow->setPreset(defaultYACReaderFlowConfig);
|
||||||
return;
|
break;
|
||||||
case 4:
|
case FlowType::Roulette:
|
||||||
flow->setPreset(pressetYACReaderFlowDownConfig);
|
flow->setPreset(pressetYACReaderFlowDownConfig);
|
||||||
return;
|
break;
|
||||||
}
|
case FlowType::Custom:
|
||||||
|
|
||||||
|
|
||||||
//custom config
|
|
||||||
|
|
||||||
flow->setCF_RX(settings->value(X_ROTATION).toInt());
|
flow->setCF_RX(settings->value(X_ROTATION).toInt());
|
||||||
flow->setCF_Y(settings->value(Y_POSITION).toInt());
|
flow->setCF_Y(settings->value(Y_POSITION).toInt());
|
||||||
flow->setX_Distance(settings->value(COVER_DISTANCE).toInt());
|
flow->setX_Distance(settings->value(COVER_DISTANCE).toInt());
|
||||||
@ -137,10 +133,10 @@ void GoToFlowGL::updateConfig(QSettings * settings)
|
|||||||
flow->setFadeOutDist(settings->value(FADE_OUT_DIST).toInt());
|
flow->setFadeOutDist(settings->value(FADE_OUT_DIST).toInt());
|
||||||
flow->setLightStrenght(settings->value(LIGHT_STRENGTH).toInt());
|
flow->setLightStrenght(settings->value(LIGHT_STRENGTH).toInt());
|
||||||
flow->setMaxAngle(settings->value(MAX_ANGLE).toInt());
|
flow->setMaxAngle(settings->value(MAX_ANGLE).toInt());
|
||||||
|
break;
|
||||||
/* flow->setVisibility(settings->value("visibilityDistance").toInt());
|
}
|
||||||
flow->setLightStrenght(settings->value("lightStrength").toInt())*/;
|
if (Configuration::getConfiguration().getQuickNaviMode())
|
||||||
|
flow->setFadeOutDist(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToFlowGL::keyPressEvent(QKeyEvent* event)
|
void GoToFlowGL::keyPressEvent(QKeyEvent* event)
|
||||||
|
@ -23,7 +23,6 @@ public:
|
|||||||
void setFlowType(FlowType flowType);
|
void setFlowType(FlowType flowType);
|
||||||
void setNumSlides(unsigned int slides);
|
void setNumSlides(unsigned int slides);
|
||||||
void setImageReady(int index,const QByteArray & image);
|
void setImageReady(int index,const QByteArray & image);
|
||||||
void updateSize();
|
|
||||||
|
|
||||||
void updateConfig(QSettings * settings);
|
void updateConfig(QSettings * settings);
|
||||||
void setFlowRightToLeft(bool b);
|
void setFlowRightToLeft(bool b);
|
||||||
|
@ -2,18 +2,42 @@
|
|||||||
|
|
||||||
#include <QtWidgets>
|
#include <QtWidgets>
|
||||||
|
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
GoToFlowToolBar::GoToFlowToolBar(QWidget * parent)
|
GoToFlowToolBar::GoToFlowToolBar(QWidget * parent)
|
||||||
:QWidget(parent)
|
:QStackedWidget(parent)
|
||||||
{
|
{
|
||||||
//elementos interactivos
|
//elementos interactivos
|
||||||
QVBoxLayout * mainLayout = new QVBoxLayout;
|
QWidget * normal = new QWidget(this); // container widget
|
||||||
bar = new QWidget(this);
|
QWidget * quickNavi = new QWidget(this); // container widget
|
||||||
QHBoxLayout * bottom = new QHBoxLayout(bar);
|
addWidget(normal);
|
||||||
bottom->addStretch();
|
addWidget(quickNavi);
|
||||||
bottom->addWidget(new QLabel("<b>" + tr("Page : ") + "</b>",bar));
|
QHBoxLayout * normalLayout = new QHBoxLayout(normal);
|
||||||
bottom->addWidget(edit = new QLineEdit(bar));
|
QHBoxLayout * naviLayout = new QHBoxLayout(quickNavi);
|
||||||
v = new QIntValidator(bar);
|
normal->setLayout(normalLayout);
|
||||||
|
quickNavi->setLayout(naviLayout);
|
||||||
|
|
||||||
|
slider = new QSlider(Qt::Horizontal,this);
|
||||||
|
slider->setStyleSheet(
|
||||||
|
"QSlider::groove:horizontal {"
|
||||||
|
" border: 1px solid white;"
|
||||||
|
" border-radius: 6px;"
|
||||||
|
" background: rgba(255, 255, 255, 50);"
|
||||||
|
" margin: 2px 0;"
|
||||||
|
"}"
|
||||||
|
"QSlider::handle:horizontal {"
|
||||||
|
" background: rgba(0, 0, 0, 200);"
|
||||||
|
" border: 1px solid white;"
|
||||||
|
" width: 24px;"
|
||||||
|
" border-radius: 6px;"
|
||||||
|
"}"
|
||||||
|
);
|
||||||
|
connect(slider, &QSlider::valueChanged, this, [&](int v) { emit(setCenter(v)); });
|
||||||
|
|
||||||
|
pageHint = new QLabel("<b>" + tr("Page : ") + "</b>",this);
|
||||||
|
v = new QIntValidator(this);
|
||||||
v->setBottom(1);
|
v->setBottom(1);
|
||||||
|
edit = new QLineEdit(this);
|
||||||
edit->setValidator(v);
|
edit->setValidator(v);
|
||||||
edit->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
edit->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||||
edit->setStyleSheet("QLineEdit {border: 1px solid #77000000; background: #55000000; color: white; padding: 3px 5px 5px 5px; margin: 13px 5px 12px 5px; font-weight:bold}");
|
edit->setStyleSheet("QLineEdit {border: 1px solid #77000000; background: #55000000; color: white; padding: 3px 5px 5px 5px; margin: 13px 5px 12px 5px; font-weight:bold}");
|
||||||
@ -29,41 +53,51 @@ GoToFlowToolBar::GoToFlowToolBar(QWidget * parent)
|
|||||||
QString centerButtonCSS = "QPushButton {background-image: url(:/images/imgCenterSlide.png); width: 100%; height:100%; background-repeat: none; border: none;} "
|
QString centerButtonCSS = "QPushButton {background-image: url(:/images/imgCenterSlide.png); width: 100%; height:100%; background-repeat: none; border: none;} "
|
||||||
"QPushButton:focus { border: none; outline: none;}"
|
"QPushButton:focus { border: none; outline: none;}"
|
||||||
"QPushButton:pressed {background-image: url(:/images/imgCenterSlidePressed.png); width: 100%; height:100%; background-repeat: none; border: none;} ";
|
"QPushButton:pressed {background-image: url(:/images/imgCenterSlidePressed.png); width: 100%; height:100%; background-repeat: none; border: none;} ";
|
||||||
centerButton = new QPushButton(bar);
|
centerButton = new QPushButton(this);
|
||||||
//centerButton->setIcon(QIcon(":/images/center.png"));
|
//centerButton->setIcon(QIcon(":/images/center.png"));
|
||||||
centerButton->setStyleSheet(centerButtonCSS);
|
centerButton->setStyleSheet(centerButtonCSS);
|
||||||
centerButton->setFixedSize(26,50);
|
centerButton->setFixedSize(26,50);
|
||||||
centerButton->setAttribute(Qt::WA_LayoutUsesWidgetRect,true);
|
centerButton->setAttribute(Qt::WA_LayoutUsesWidgetRect,true);
|
||||||
connect(centerButton,SIGNAL(clicked()),this,SLOT(centerSlide()));
|
connect(centerButton,SIGNAL(clicked()),this,SLOT(centerSlide()));
|
||||||
bottom->addWidget(centerButton);
|
|
||||||
|
|
||||||
QString goToButtonCSS = "QPushButton {background-image: url(:/images/imgGoToSlide.png); width: 100%; height:100%; background-repeat: none; border: none;} "
|
QString goToButtonCSS = "QPushButton {background-image: url(:/images/imgGoToSlide.png); width: 100%; height:100%; background-repeat: none; border: none;} "
|
||||||
"QPushButton:focus { border: none; outline: none;}"
|
"QPushButton:focus { border: none; outline: none;}"
|
||||||
"QPushButton:pressed {background-image: url(:/images/imgGoToSlidePressed.png); width: 100%; height:100%; background-repeat: none; border: none;} ";
|
"QPushButton:pressed {background-image: url(:/images/imgGoToSlidePressed.png); width: 100%; height:100%; background-repeat: none; border: none;} ";
|
||||||
goToButton = new QPushButton(bar);
|
goToButton = new QPushButton(this);
|
||||||
//goToButton->setIcon(QIcon(":/images/goto.png"));
|
//goToButton->setIcon(QIcon(":/images/goto.png"));
|
||||||
goToButton->setStyleSheet(goToButtonCSS);
|
goToButton->setStyleSheet(goToButtonCSS);
|
||||||
goToButton->setFixedSize(32,50);
|
goToButton->setFixedSize(32,50);
|
||||||
goToButton->setAttribute(Qt::WA_LayoutUsesWidgetRect,true);
|
goToButton->setAttribute(Qt::WA_LayoutUsesWidgetRect,true);
|
||||||
|
|
||||||
connect(goToButton,SIGNAL(clicked()),this,SLOT(goTo()));
|
connect(goToButton,SIGNAL(clicked()),this,SLOT(goTo()));
|
||||||
bottom->addWidget(goToButton);
|
|
||||||
|
|
||||||
bottom->addStretch();
|
normalLayout->setMargin(0);
|
||||||
bottom->setMargin(0);
|
normalLayout->setSpacing(0);
|
||||||
bottom->setSpacing(0);
|
normalLayout->addStretch();
|
||||||
|
normalLayout->addWidget(pageHint);
|
||||||
|
normalLayout->addWidget(edit);
|
||||||
|
normalLayout->addWidget(centerButton);
|
||||||
|
normalLayout->addWidget(goToButton);
|
||||||
|
normalLayout->addStretch();
|
||||||
|
|
||||||
bar->setLayout(bottom);
|
naviLayout->setContentsMargins(5, 0, 0, 0);
|
||||||
|
naviLayout->setSpacing(2);
|
||||||
|
naviLayout->addWidget(slider);
|
||||||
|
naviLayout->addWidget(goToButton);
|
||||||
|
|
||||||
mainLayout->setMargin(0);
|
switchLayout();
|
||||||
mainLayout->setSpacing(0);
|
|
||||||
mainLayout->addWidget(bar);
|
|
||||||
|
|
||||||
setLayout(mainLayout);
|
|
||||||
|
|
||||||
setFixedHeight(50);
|
setFixedHeight(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GoToFlowToolBar::switchLayout()
|
||||||
|
{
|
||||||
|
if (Configuration::getConfiguration().getQuickNaviMode())
|
||||||
|
setCurrentIndex(1);
|
||||||
|
else
|
||||||
|
setCurrentIndex(0);
|
||||||
|
}
|
||||||
|
|
||||||
void GoToFlowToolBar::paintEvent(QPaintEvent *)
|
void GoToFlowToolBar::paintEvent(QPaintEvent *)
|
||||||
{
|
{
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
@ -78,11 +112,13 @@ void GoToFlowToolBar::paintEvent(QPaintEvent *)
|
|||||||
void GoToFlowToolBar::setPage(int pageNumber)
|
void GoToFlowToolBar::setPage(int pageNumber)
|
||||||
{
|
{
|
||||||
edit->setText(QString::number(pageNumber+1));
|
edit->setText(QString::number(pageNumber+1));
|
||||||
|
slider->setValue(pageNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToFlowToolBar::setTop(int numPages)
|
void GoToFlowToolBar::setTop(int numPages)
|
||||||
{
|
{
|
||||||
v->setTop(numPages);
|
v->setTop(numPages);
|
||||||
|
slider->setMaximum(numPages-1); // min is 0
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToFlowToolBar::goTo()
|
void GoToFlowToolBar::goTo()
|
||||||
|
@ -2,24 +2,30 @@
|
|||||||
#define GOTO_FLOW_TOOLBAR_H
|
#define GOTO_FLOW_TOOLBAR_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QStackedWidget.h>
|
||||||
|
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QIntValidator;
|
class QIntValidator;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
|
class QSlider;
|
||||||
|
class QLabel;
|
||||||
|
|
||||||
class GoToFlowToolBar : public QWidget
|
class GoToFlowToolBar : public QStackedWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
QLineEdit * edit;
|
QLineEdit * edit;
|
||||||
|
QSlider * slider;
|
||||||
QIntValidator * v;
|
QIntValidator * v;
|
||||||
QPushButton * centerButton;
|
QPushButton * centerButton;
|
||||||
QPushButton * goToButton;
|
QPushButton * goToButton;
|
||||||
|
QLabel * pageHint;
|
||||||
QWidget * bar;
|
QWidget * bar;
|
||||||
void paintEvent(QPaintEvent *);
|
void paintEvent(QPaintEvent *);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GoToFlowToolBar(QWidget * parent = 0);
|
GoToFlowToolBar(QWidget * parent = 0);
|
||||||
|
void switchLayout();
|
||||||
public slots:
|
public slots:
|
||||||
void setPage(int pageNumber);
|
void setPage(int pageNumber);
|
||||||
void setTop(int numPages);
|
void setTop(int numPages);
|
||||||
|
@ -6,20 +6,17 @@
|
|||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
#include "goto_flow_toolbar.h"
|
#include "goto_flow_toolbar.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
GoToFlowWidget::GoToFlowWidget(QWidget * parent)
|
GoToFlowWidget::GoToFlowWidget(QWidget * parent)
|
||||||
:QWidget(parent)
|
:QWidget(parent)
|
||||||
{
|
{
|
||||||
mainLayout = new QVBoxLayout;
|
mainLayout = new QVBoxLayout;
|
||||||
|
|
||||||
mainLayout->setMargin(0);
|
mainLayout->setMargin(0);
|
||||||
mainLayout->setSpacing(0);
|
mainLayout->setSpacing(0);
|
||||||
|
|
||||||
toolBar = new GoToFlowToolBar(this);
|
toolBar = new GoToFlowToolBar(this);
|
||||||
|
|
||||||
mainLayout->setMargin(0);
|
|
||||||
mainLayout->setSpacing(0);
|
|
||||||
|
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
//toolBar->installEventFilter(this);
|
//toolBar->installEventFilter(this);
|
||||||
@ -54,6 +51,21 @@ void GoToFlowWidget::keyPressEvent(QKeyEvent* event)
|
|||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GoToFlowWidget::updateConfig(QSettings * settings)
|
||||||
|
{
|
||||||
|
Q_UNUSED(settings)
|
||||||
|
toolBar->switchLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GoToFlowWidget::updateSize()
|
||||||
|
{
|
||||||
|
// called by parent in resizeEvent
|
||||||
|
// no need to update width when QuickNaviMode disabled
|
||||||
|
// height is set in updateConfig
|
||||||
|
if (Configuration::getConfiguration().getQuickNaviMode() && parentWidget() != nullptr)
|
||||||
|
resize(parentWidget()->width(),height());
|
||||||
|
}
|
||||||
|
|
||||||
/*bool GoToFlowWidget::eventFilter(QObject * target, QEvent * event)
|
/*bool GoToFlowWidget::eventFilter(QObject * target, QEvent * event)
|
||||||
{
|
{
|
||||||
if(event->type() == QEvent::KeyPress)
|
if(event->type() == QEvent::KeyPress)
|
||||||
|
@ -27,8 +27,8 @@ public slots:
|
|||||||
virtual void setFlowType(FlowType flowType) = 0;
|
virtual void setFlowType(FlowType flowType) = 0;
|
||||||
virtual void setNumSlides(unsigned int slides) = 0;
|
virtual void setNumSlides(unsigned int slides) = 0;
|
||||||
virtual void setImageReady(int index,const QByteArray & image) = 0;
|
virtual void setImageReady(int index,const QByteArray & image) = 0;
|
||||||
virtual void updateSize() = 0;
|
virtual void updateSize();
|
||||||
virtual void updateConfig(QSettings * settings) = 0;
|
virtual void updateConfig(QSettings * settings);
|
||||||
virtual void setFlowRightToLeft(bool b) = 0;
|
virtual void setFlowRightToLeft(bool b) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -938,7 +938,7 @@ void MainWindowViewer::openFolderFromPath(QString pathDir, QString atFileName)
|
|||||||
if(i < list.count())
|
if(i < list.count())
|
||||||
index = i;
|
index = i;
|
||||||
|
|
||||||
viewer->open(pathDir,i);
|
viewer->open(pathDir,index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindowViewer::saveImage()
|
void MainWindowViewer::saveImage()
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
OptionsDialog::OptionsDialog(QWidget * parent)
|
OptionsDialog::OptionsDialog(QWidget * parent)
|
||||||
:YACReaderOptionsDialog(parent)
|
:YACReaderOptionsDialog(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
QTabWidget * tabWidget = new QTabWidget();
|
QTabWidget * tabWidget = new QTabWidget();
|
||||||
@ -105,6 +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"));
|
||||||
|
|
||||||
QHBoxLayout * buttons = new QHBoxLayout();
|
QHBoxLayout * buttons = new QHBoxLayout();
|
||||||
buttons->addStretch();
|
buttons->addStretch();
|
||||||
buttons->addWidget(new QLabel(tr("Restart is needed")));
|
buttons->addWidget(new QLabel(tr("Restart is needed")));
|
||||||
@ -122,6 +124,7 @@ OptionsDialog::OptionsDialog(QWidget * parent)
|
|||||||
layoutFlow->addWidget(gl);
|
layoutFlow->addWidget(gl);
|
||||||
layoutFlow->addWidget(useGL);
|
layoutFlow->addWidget(useGL);
|
||||||
#endif
|
#endif
|
||||||
|
layoutFlow->addWidget(quickNavi);
|
||||||
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);
|
||||||
@ -191,6 +194,7 @@ 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());
|
||||||
|
|
||||||
YACReaderOptionsDialog::saveOptions();
|
YACReaderOptionsDialog::saveOptions();
|
||||||
}
|
}
|
||||||
@ -221,6 +225,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());
|
||||||
|
|
||||||
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());
|
||||||
gammaS->setValue(settings->value(GAMMA,100).toInt());
|
gammaS->setValue(settings->value(GAMMA,100).toInt());
|
||||||
|
@ -23,6 +23,7 @@ Q_OBJECT
|
|||||||
//QLabel * pathLabel;
|
//QLabel * pathLabel;
|
||||||
QLineEdit * pathEdit;
|
QLineEdit * pathEdit;
|
||||||
QPushButton * pathFindButton;
|
QPushButton * pathFindButton;
|
||||||
|
QCheckBox * quickNavi;
|
||||||
|
|
||||||
QLabel * magGlassSizeLabel;
|
QLabel * magGlassSizeLabel;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ class Render;
|
|||||||
class ImageFilter {
|
class ImageFilter {
|
||||||
public:
|
public:
|
||||||
ImageFilter(){};
|
ImageFilter(){};
|
||||||
|
virtual ~ImageFilter() {};
|
||||||
virtual QImage setFilter(const QImage & image) = 0;
|
virtual QImage setFilter(const QImage & image) = 0;
|
||||||
inline int getLevel() {return level;};
|
inline int getLevel() {return level;};
|
||||||
inline void setLevel(int l) {level = l;};
|
inline void setLevel(int l) {level = l;};
|
||||||
|
@ -23,22 +23,21 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
Viewer::Viewer(QWidget * parent)
|
Viewer::Viewer(QWidget * parent)
|
||||||
:QScrollArea(parent),
|
:QScrollArea(parent),
|
||||||
currentPage(0),
|
currentPage(0),
|
||||||
magnifyingGlassShowed(false),
|
magnifyingGlassShowed(false),
|
||||||
fullscreen(false),
|
fullscreen(false),
|
||||||
information(false),
|
information(false),
|
||||||
adjustToWidthRatio(1),
|
doublePage(false),
|
||||||
doublePage(false),
|
doubleMangaPage(false),
|
||||||
doubleMangaPage(false),
|
wheelStop(false),
|
||||||
wheelStop(false),
|
direction(1),
|
||||||
direction(1),
|
restoreMagnifyingGlass(false),
|
||||||
restoreMagnifyingGlass(false),
|
drag(false),
|
||||||
drag(false),
|
numScrollSteps(22),
|
||||||
numScrollSteps(22),
|
shouldOpenNext(false),
|
||||||
shouldOpenNext(false),
|
shouldOpenPrevious(false),
|
||||||
shouldOpenPrevious(false),
|
zoom(100)
|
||||||
zoom(100)
|
|
||||||
{
|
{
|
||||||
translator = new YACReaderTranslator(this);
|
translator = new YACReaderTranslator(this);
|
||||||
translator->hide();
|
translator->hide();
|
||||||
@ -751,7 +750,8 @@ void Viewer::wheelEvent(QWheelEvent * event)
|
|||||||
void Viewer::resizeEvent(QResizeEvent * event)
|
void Viewer::resizeEvent(QResizeEvent * event)
|
||||||
{
|
{
|
||||||
updateContentSize();
|
updateContentSize();
|
||||||
goToFlow->move(QPoint((width()-goToFlow->width())/2,height()-goToFlow->height()));
|
goToFlow->updateSize();
|
||||||
|
goToFlow->move((width()-goToFlow->width())/2,height()-goToFlow->height());
|
||||||
informationLabel->updatePosition();
|
informationLabel->updatePosition();
|
||||||
QScrollArea::resizeEvent(event);
|
QScrollArea::resizeEvent(event);
|
||||||
}
|
}
|
||||||
@ -1030,7 +1030,6 @@ void Viewer::updateOptions()
|
|||||||
goToFlow->setFlowType(Configuration::getConfiguration().getFlowType());
|
goToFlow->setFlowType(Configuration::getConfiguration().getFlowType());
|
||||||
updateBackgroundColor(Configuration::getConfiguration().getBackgroundColor());
|
updateBackgroundColor(Configuration::getConfiguration().getBackgroundColor());
|
||||||
updateContentSize();
|
updateContentSize();
|
||||||
//goToFlow->updateSize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Viewer::updateBackgroundColor(const QColor & color)
|
void Viewer::updateBackgroundColor(const QColor & color)
|
||||||
|
@ -121,7 +121,6 @@ virtual void mouseReleaseEvent ( QMouseEvent * event );
|
|||||||
QPropertyAnimation * showGoToFlowAnimation;
|
QPropertyAnimation * showGoToFlowAnimation;
|
||||||
GoToDialog * goToDialog;
|
GoToDialog * goToDialog;
|
||||||
//!Image properties
|
//!Image properties
|
||||||
float adjustToWidthRatio;
|
|
||||||
//! Comic
|
//! Comic
|
||||||
//Comic * comic;
|
//Comic * comic;
|
||||||
int index;
|
int index;
|
||||||
|
@ -17,6 +17,7 @@ public:
|
|||||||
QVariant data(int column) const;
|
QVariant data(int column) const;
|
||||||
virtual qulonglong getId() const;
|
virtual qulonglong getId() const;
|
||||||
QList<QVariant> itemData;
|
QList<QVariant> itemData;
|
||||||
|
virtual ~ListItem() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
|
@ -1460,7 +1460,8 @@ QImage ImageLoaderGL::loadImage(const QString& fileName)
|
|||||||
case high:
|
case high:
|
||||||
image = image.scaledToWidth(320,Qt::SmoothTransformation);
|
image = image.scaledToWidth(320,Qt::SmoothTransformation);
|
||||||
break;
|
break;
|
||||||
|
case ultraHigh:
|
||||||
|
break; //no scaling in ultraHigh
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!result)
|
if(!result)
|
||||||
|
@ -1406,7 +1406,8 @@ QImage ImageLoaderGL::loadImage(const QString& fileName)
|
|||||||
case high:
|
case high:
|
||||||
image = image.scaledToWidth(320,Qt::SmoothTransformation);
|
image = image.scaledToWidth(320,Qt::SmoothTransformation);
|
||||||
break;
|
break;
|
||||||
|
case ultraHigh:
|
||||||
|
break; //no scaling in ultraHigh
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!result)
|
if(!result)
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#define CONTRAST "CONTRAST"
|
#define CONTRAST "CONTRAST"
|
||||||
#define GAMMA "GAMMA"
|
#define GAMMA "GAMMA"
|
||||||
#define SHOW_INFO "SHOW_INFO"
|
#define SHOW_INFO "SHOW_INFO"
|
||||||
|
#define QUICK_NAVI_MODE "QUICK_NAVI_MODE"
|
||||||
|
|
||||||
#define FLOW_TYPE_GL "FLOW_TYPE_GL"
|
#define FLOW_TYPE_GL "FLOW_TYPE_GL"
|
||||||
#define Y_POSITION "Y_POSITION"
|
#define Y_POSITION "Y_POSITION"
|
||||||
|
Reference in New Issue
Block a user