mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Reader: Add option to show covers as single pages in double page mode
This commit is contained in:
parent
ce90796aed
commit
5bb6ab276a
@ -10,6 +10,7 @@ Version counting is based on semantic versioning (Major.Feature.Patch)
|
||||
### YACReader
|
||||
* Image enlargement/stretching can now be disabled for fit
|
||||
to width and height
|
||||
* New option to show covers as single pages in double page mode (enabled by default)
|
||||
|
||||
### YACReaderLibrary
|
||||
* update QsLog logger to version 2.1, snapshot 46b643d5bcbc
|
||||
|
@ -146,6 +146,19 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
||||
scaleLayout->addWidget(scaleCheckbox);
|
||||
scaleBox->setLayout(scaleLayout);
|
||||
layoutImageV->addWidget(scaleBox);
|
||||
|
||||
auto doublePageBox = new QGroupBox(tr("Double Page options"));
|
||||
auto doublePageBoxLayout = new QVBoxLayout();
|
||||
coverSPCheckBox = new QCheckBox(tr("Show covers as single page"));
|
||||
connect(coverSPCheckBox, &QCheckBox::clicked,
|
||||
[=](bool checked) {
|
||||
settings->setValue(COVER_IS_SP, checked);
|
||||
emit(changedImageOptions());
|
||||
});
|
||||
|
||||
doublePageBoxLayout->addWidget(coverSPCheckBox);
|
||||
doublePageBox->setLayout(doublePageBoxLayout);
|
||||
layoutImageV->addWidget(doublePageBox);
|
||||
layoutImageV->addStretch();
|
||||
|
||||
pageGeneral->setLayout(layoutGeneral);
|
||||
@ -236,6 +249,7 @@ void OptionsDialog::restoreOptions(QSettings *settings)
|
||||
gammaS->setValue(settings->value(GAMMA, 100).toInt());
|
||||
|
||||
scaleCheckbox->setChecked(settings->value(ENLARGE_IMAGES, true).toBool());
|
||||
coverSPCheckBox->setChecked(settings->value(COVER_IS_SP, true).toBool());
|
||||
}
|
||||
|
||||
void OptionsDialog::updateColor(const QColor &color)
|
||||
|
@ -26,6 +26,7 @@ private:
|
||||
QCheckBox *quickNavi;
|
||||
QCheckBox *disableShowOnMouseOver;
|
||||
QCheckBox *scaleCheckbox;
|
||||
QCheckBox *coverSPCheckBox;
|
||||
|
||||
QLabel *magGlassSizeLabel;
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include "comic_db.h"
|
||||
#include "yacreader_global_gui.h"
|
||||
#include "configuration.h"
|
||||
|
||||
template<class T>
|
||||
inline const T &kClamp(const T &x, const T &low, const T &high)
|
||||
@ -544,6 +545,9 @@ QPixmap *Render::getCurrentDoubleMangaPage()
|
||||
|
||||
bool Render::currentPageIsDoublePage()
|
||||
{
|
||||
if (currentIndex == 0 && Configuration::getConfiguration().getSettings()->value(COVER_IS_SP, true).toBool()) {
|
||||
return false;
|
||||
}
|
||||
if (buffer[currentPageBufferedIndex]->isNull() || buffer[currentPageBufferedIndex + 1]->isNull()) {
|
||||
return false;
|
||||
}
|
||||
@ -583,6 +587,12 @@ bool Render::nextPageIsDoublePage()
|
||||
|
||||
bool Render::previousPageIsDoublePage()
|
||||
{
|
||||
qWarning("Previous page is doublepage!");
|
||||
qWarning("%d", currentIndex);
|
||||
qWarning("%d", currentPageBufferedIndex);
|
||||
if (currentIndex == 2 && Configuration::getConfiguration().getSettings()->value(COVER_IS_SP, true).toBool()) {
|
||||
return false;
|
||||
}
|
||||
if (buffer[currentPageBufferedIndex - 1]->isNull() || buffer[currentPageBufferedIndex - 2]->isNull()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
#define START_TO_TRAY "START_TO_TRAY"
|
||||
#define DOUBLE_PAGE "DOUBLE_PAGE"
|
||||
#define DOUBLE_MANGA_PAGE "DOUBLE_MANGA_PAGE"
|
||||
#define COVER_IS_SP "COVER_IS_SP"
|
||||
#define BACKGROUND_COLOR "BACKGROUND_COLOR"
|
||||
#define ALWAYS_ON_TOP "ALWAYS_ON_TOP"
|
||||
#define SHOW_TOOLBARS "SHOW_TOOLBARS"
|
||||
|
Loading…
Reference in New Issue
Block a user