mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 04:54:29 -04:00
Make the new quick navigation go to flow 'manga mode aware'.
This commit is contained in:
@ -12,7 +12,12 @@
|
||||
Configuration::Configuration()
|
||||
{
|
||||
//read configuration
|
||||
//load("/YACReader.conf");
|
||||
//load("/YACReader.conf");
|
||||
}
|
||||
|
||||
QSettings *Configuration::getSettings()
|
||||
{
|
||||
return settings;
|
||||
}
|
||||
|
||||
/*Configuration::Configuration(const Configuration & conf)
|
||||
|
@ -51,6 +51,7 @@ using namespace YACReader;
|
||||
static Configuration configuration;
|
||||
return configuration;
|
||||
};
|
||||
QSettings *getSettings();
|
||||
void load(QSettings * settings);
|
||||
QString getDefaultPath() { return settings->value(PATH).toString(); }
|
||||
void setDefaultPath(QString defaultPath){settings->setValue(PATH,defaultPath);}
|
||||
|
@ -32,6 +32,7 @@ GoToFlowToolBar::GoToFlowToolBar(QWidget * parent)
|
||||
" border-radius: 1px;"
|
||||
"}"
|
||||
);
|
||||
|
||||
connect(slider, &QSlider::valueChanged, this, [&](int v) { emit(setCenter(v)); });
|
||||
|
||||
pageHint = new QLabel("<b>" + tr("Page : ") + "</b>",this);
|
||||
@ -85,19 +86,11 @@ GoToFlowToolBar::GoToFlowToolBar(QWidget * parent)
|
||||
naviLayout->addWidget(slider);
|
||||
naviLayout->addWidget(goToButton);
|
||||
|
||||
switchLayout();
|
||||
updateOptions();
|
||||
|
||||
setFixedHeight(50);
|
||||
}
|
||||
|
||||
void GoToFlowToolBar::switchLayout()
|
||||
{
|
||||
if (Configuration::getConfiguration().getQuickNaviMode())
|
||||
setCurrentIndex(1);
|
||||
else
|
||||
setCurrentIndex(0);
|
||||
}
|
||||
|
||||
void GoToFlowToolBar::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
@ -130,5 +123,15 @@ void GoToFlowToolBar::goTo()
|
||||
void GoToFlowToolBar::centerSlide()
|
||||
{
|
||||
if(edit->text().toInt()!=0)
|
||||
emit(setCenter(edit->text().toInt()-1));
|
||||
emit(setCenter(edit->text().toInt()-1));
|
||||
}
|
||||
|
||||
void GoToFlowToolBar::updateOptions()
|
||||
{
|
||||
if (Configuration::getConfiguration().getQuickNaviMode())
|
||||
setCurrentIndex(1);
|
||||
else
|
||||
setCurrentIndex(0);
|
||||
|
||||
slider->setInvertedAppearance(Configuration::getConfiguration().getDoubleMangaPage());
|
||||
}
|
||||
|
@ -25,12 +25,13 @@ class GoToFlowToolBar : public QStackedWidget
|
||||
|
||||
public:
|
||||
GoToFlowToolBar(QWidget * parent = 0);
|
||||
void switchLayout();
|
||||
|
||||
public slots:
|
||||
void setPage(int pageNumber);
|
||||
void setTop(int numPages);
|
||||
void goTo();
|
||||
void centerSlide();
|
||||
void updateOptions();
|
||||
signals:
|
||||
void setCenter(unsigned int);
|
||||
void goTo(unsigned int);
|
||||
|
@ -54,7 +54,7 @@ void GoToFlowWidget::keyPressEvent(QKeyEvent* event)
|
||||
void GoToFlowWidget::updateConfig(QSettings * settings)
|
||||
{
|
||||
Q_UNUSED(settings)
|
||||
toolBar->switchLayout();
|
||||
toolBar->updateOptions();
|
||||
}
|
||||
|
||||
void GoToFlowWidget::updateSize()
|
||||
|
@ -962,8 +962,10 @@ void Viewer::doubleMangaPageSwitch()
|
||||
{
|
||||
doubleMangaPage = !doubleMangaPage;
|
||||
render->doubleMangaPageSwitch();
|
||||
Configuration::getConfiguration().setDoubleMangaPage(doubleMangaPage);
|
||||
Configuration &config = Configuration::getConfiguration();
|
||||
config.setDoubleMangaPage(doubleMangaPage);
|
||||
goToFlow->setFlowRightToLeft(doubleMangaPage);
|
||||
goToFlow->updateConfig(config.getSettings());
|
||||
}
|
||||
|
||||
void Viewer::resetContent()
|
||||
|
Reference in New Issue
Block a user