mirror of
https://github.com/YACReader/yacreader
synced 2025-07-21 22:44:56 -04:00
Setting to control whether the time is shown in the 'current page/total' label.
Apparently I am going to make millions with this new feature :D
This commit is contained in:
@ -7,6 +7,7 @@ Version counting is based on semantic versioning (Major.Feature.Patch)
|
|||||||
* Don't use scroll animations on macos by default, it where hdpi scroll is most likely to be used.
|
* Don't use scroll animations on macos by default, it where hdpi scroll is most likely to be used.
|
||||||
* New toolbar on macos.
|
* New toolbar on macos.
|
||||||
* New mouse modes to turn pages. You can setup the app to use the left/right buttons to turn pages directly or you can click on the left/right part of the screen to turn pages.
|
* New mouse modes to turn pages. You can setup the app to use the left/right buttons to turn pages directly or you can click on the left/right part of the screen to turn pages.
|
||||||
|
* New setting to control whether the time is shown in the 'current page/total' label.
|
||||||
|
|
||||||
### YACReaderLibrary
|
### YACReaderLibrary
|
||||||
* Improve flexibility of the open comic in third party app setting so more complex commands can be used. e.g. `open -a "/Applications/My Reader.app" "{comic_file_path}"`.
|
* Improve flexibility of the open comic in third party app setting so more complex commands can be used. e.g. `open -a "/Applications/My Reader.app" "{comic_file_path}"`.
|
||||||
|
@ -91,6 +91,8 @@ public:
|
|||||||
void setShowToolbars(bool b) { settings->setValue(SHOW_TOOLBARS, b); }
|
void setShowToolbars(bool b) { settings->setValue(SHOW_TOOLBARS, b); }
|
||||||
bool getShowInformation() { return settings->value(SHOW_INFO, false).toBool(); }
|
bool getShowInformation() { return settings->value(SHOW_INFO, false).toBool(); }
|
||||||
void setShowInformation(bool b) { settings->setValue(SHOW_INFO, b); }
|
void setShowInformation(bool b) { settings->setValue(SHOW_INFO, b); }
|
||||||
|
bool getShowTimeInInformation() { return settings->value(SHOW_TIME_IN_INFO, true).toBool(); }
|
||||||
|
void setShowTimeInInformation(bool b) { settings->setValue(SHOW_TIME_IN_INFO, b); }
|
||||||
QDate getLastVersionCheck() { return settings->value(LAST_VERSION_CHECK).toDate(); }
|
QDate getLastVersionCheck() { return settings->value(LAST_VERSION_CHECK).toDate(); }
|
||||||
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(); }
|
||||||
|
@ -38,6 +38,12 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
|||||||
path->addWidget(pathFindButton = new QPushButton(QIcon(":/images/find_folder.png"), ""));
|
path->addWidget(pathFindButton = new QPushButton(QIcon(":/images/find_folder.png"), ""));
|
||||||
pathBox->setLayout(path);
|
pathBox->setLayout(path);
|
||||||
|
|
||||||
|
QGroupBox *displayBox = new QGroupBox(tr("Display"));
|
||||||
|
auto displayLayout = new QHBoxLayout();
|
||||||
|
showTimeInInformationLabel = new QCheckBox(tr("Show time in current page information label"));
|
||||||
|
displayLayout->addWidget(showTimeInInformationLabel);
|
||||||
|
displayBox->setLayout(displayLayout);
|
||||||
|
|
||||||
connect(pathFindButton, &QAbstractButton::clicked, this, &OptionsDialog::findFolder);
|
connect(pathFindButton, &QAbstractButton::clicked, this, &OptionsDialog::findFolder);
|
||||||
|
|
||||||
QGroupBox *slideSizeBox = new QGroupBox(tr("\"Go to flow\" size"));
|
QGroupBox *slideSizeBox = new QGroupBox(tr("\"Go to flow\" size"));
|
||||||
@ -95,6 +101,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
|||||||
mouseModeBox->setLayout(mouseModeLayout);
|
mouseModeBox->setLayout(mouseModeLayout);
|
||||||
|
|
||||||
layoutGeneral->addWidget(pathBox);
|
layoutGeneral->addWidget(pathBox);
|
||||||
|
layoutGeneral->addWidget(displayBox);
|
||||||
layoutGeneral->addWidget(slideSizeBox);
|
layoutGeneral->addWidget(slideSizeBox);
|
||||||
// layoutGeneral->addWidget(fitBox);
|
// layoutGeneral->addWidget(fitBox);
|
||||||
layoutGeneral->addWidget(colorBox);
|
layoutGeneral->addWidget(colorBox);
|
||||||
@ -251,6 +258,8 @@ void OptionsDialog::saveOptions()
|
|||||||
|
|
||||||
settings->setValue(PATH, pathEdit->text());
|
settings->setValue(PATH, pathEdit->text());
|
||||||
|
|
||||||
|
Configuration::getConfiguration().setShowTimeInInformation(showTimeInInformationLabel->isChecked());
|
||||||
|
|
||||||
settings->setValue(BACKGROUND_COLOR, currentColor);
|
settings->setValue(BACKGROUND_COLOR, 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());
|
settings->setValue(QUICK_NAVI_MODE, quickNavi->isChecked());
|
||||||
@ -297,6 +306,8 @@ void OptionsDialog::restoreOptions(QSettings *settings)
|
|||||||
|
|
||||||
pathEdit->setText(settings->value(PATH).toString());
|
pathEdit->setText(settings->value(PATH).toString());
|
||||||
|
|
||||||
|
showTimeInInformationLabel->setChecked(Configuration::getConfiguration().getShowTimeInInformation());
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
@ -22,6 +22,9 @@ private:
|
|||||||
// QLabel * pathLabel;
|
// QLabel * pathLabel;
|
||||||
QLineEdit *pathEdit;
|
QLineEdit *pathEdit;
|
||||||
QPushButton *pathFindButton;
|
QPushButton *pathFindButton;
|
||||||
|
|
||||||
|
QCheckBox *showTimeInInformationLabel;
|
||||||
|
|
||||||
QCheckBox *quickNavi;
|
QCheckBox *quickNavi;
|
||||||
QCheckBox *disableShowOnMouseOver;
|
QCheckBox *disableShowOnMouseOver;
|
||||||
QCheckBox *scaleCheckbox;
|
QCheckBox *scaleCheckbox;
|
||||||
|
@ -18,32 +18,35 @@ PageLabelWidget::PageLabelWidget(QWidget *parent)
|
|||||||
|
|
||||||
auto layout = new QHBoxLayout;
|
auto layout = new QHBoxLayout;
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
setContentsMargins(0, 0, 0, 0);
|
|
||||||
|
|
||||||
QSize labelSize;
|
|
||||||
if (verticalRes <= 1024)
|
|
||||||
labelSize = QSize(135, 30);
|
|
||||||
else if (verticalRes <= 1200)
|
|
||||||
labelSize = QSize(170, 35);
|
|
||||||
else
|
|
||||||
labelSize = QSize(205, 45);
|
|
||||||
|
|
||||||
textLabel = new QLabel(this);
|
textLabel = new QLabel(this);
|
||||||
textLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
textLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||||
if (verticalRes <= 1024)
|
textLabel->setWordWrap(true); // Allow wrapping
|
||||||
textLabel->setStyleSheet("QLabel { color : white; font-size:12px; padding-left:8px; }");
|
|
||||||
else if (verticalRes <= 1200)
|
|
||||||
textLabel->setStyleSheet("QLabel { color : white; font-size:16px; padding-left:8px;}");
|
|
||||||
else
|
|
||||||
textLabel->setStyleSheet("QLabel { color : white; font-size:20px; padding-left:8px; }");
|
|
||||||
|
|
||||||
setFixedSize(labelSize);
|
int contentMargin = 0;
|
||||||
|
if (verticalRes <= 1024) {
|
||||||
|
textLabel->setStyleSheet("QLabel { color : white; font-size:12px; }");
|
||||||
|
contentMargin = 12;
|
||||||
|
} else if (verticalRes <= 1200) {
|
||||||
|
textLabel->setStyleSheet("QLabel { color : white; font-size:16px; }");
|
||||||
|
contentMargin = 16;
|
||||||
|
} else {
|
||||||
|
textLabel->setStyleSheet("QLabel { color : white; font-size:20px; }");
|
||||||
|
contentMargin = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
setContentsMargins(contentMargin * 2.3, contentMargin / 2.3, contentMargin * 2.3, contentMargin / 2.3);
|
||||||
|
|
||||||
|
// Instead of fixed size, allow dynamic sizing
|
||||||
|
textLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||||
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||||
|
layout->addWidget(textLabel, 0, Qt::AlignCenter);
|
||||||
|
setLayout(layout);
|
||||||
|
|
||||||
|
adjustSize(); // Resize to fit content
|
||||||
|
|
||||||
if (parent != nullptr)
|
if (parent != nullptr)
|
||||||
move(QPoint((parent->geometry().size().width() - this->width()), -this->height()));
|
move(QPoint((parent->geometry().size().width() - this->width()), -this->height()));
|
||||||
|
|
||||||
layout->addWidget(textLabel, 0, Qt::AlignCenter);
|
|
||||||
setLayout(layout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageLabelWidget::show()
|
void PageLabelWidget::show()
|
||||||
|
@ -825,6 +825,7 @@ void Viewer::setMagnifyingGlassShown(bool shown)
|
|||||||
|
|
||||||
void Viewer::informationSwitch()
|
void Viewer::informationSwitch()
|
||||||
{
|
{
|
||||||
|
informationLabel->updatePosition();
|
||||||
information ? informationLabel->hide() : informationLabel->show();
|
information ? informationLabel->hide() : informationLabel->show();
|
||||||
// informationLabel->move(QPoint((width()-informationLabel->width())/2,0));
|
// informationLabel->move(QPoint((width()-informationLabel->width())/2,0));
|
||||||
information = !information;
|
information = !information;
|
||||||
@ -837,9 +838,16 @@ void Viewer::informationSwitch()
|
|||||||
void Viewer::updateInformation()
|
void Viewer::updateInformation()
|
||||||
{
|
{
|
||||||
if (render->hasLoadedComic()) {
|
if (render->hasLoadedComic()) {
|
||||||
informationLabel->setText(render->getCurrentPagesInformation() + " - " + QTime::currentTime().toString("HH:mm"));
|
auto displayTime = Configuration::getConfiguration().getShowTimeInInformation();
|
||||||
|
if (displayTime) {
|
||||||
|
informationLabel->setText(render->getCurrentPagesInformation() + " - " + QTime::currentTime().toString("HH:mm"));
|
||||||
|
} else {
|
||||||
|
informationLabel->setText(render->getCurrentPagesInformation());
|
||||||
|
}
|
||||||
|
|
||||||
informationLabel->adjustSize();
|
informationLabel->adjustSize();
|
||||||
informationLabel->update(); // TODO it shouldn't be neccesary
|
informationLabel->update(); // TODO it shouldn't be neccesary
|
||||||
|
informationLabel->updatePosition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1024,10 +1032,10 @@ void Viewer::showCursor()
|
|||||||
|
|
||||||
void Viewer::updateOptions()
|
void Viewer::updateOptions()
|
||||||
{
|
{
|
||||||
|
|
||||||
goToFlow->setFlowType(Configuration::getConfiguration().getFlowType());
|
goToFlow->setFlowType(Configuration::getConfiguration().getFlowType());
|
||||||
updateBackgroundColor(Configuration::getConfiguration().getBackgroundColor());
|
updateBackgroundColor(Configuration::getConfiguration().getBackgroundColor());
|
||||||
updateContentSize();
|
updateContentSize();
|
||||||
|
updateInformation();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Viewer::updateBackgroundColor(const QColor &color)
|
void Viewer::updateBackgroundColor(const QColor &color)
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#define CONTRAST "CONTRAST"
|
#define CONTRAST "CONTRAST"
|
||||||
#define GAMMA "GAMMA"
|
#define GAMMA "GAMMA"
|
||||||
#define SHOW_INFO "SHOW_INFO"
|
#define SHOW_INFO "SHOW_INFO"
|
||||||
|
#define SHOW_TIME_IN_INFO "SHOW_TIME_IN_INFO"
|
||||||
#define QUICK_NAVI_MODE "QUICK_NAVI_MODE"
|
#define QUICK_NAVI_MODE "QUICK_NAVI_MODE"
|
||||||
#define DISABLE_MOUSE_OVER_GOTO_FLOW "DISABLE_MOUSE_OVER_GOTO_FLOW"
|
#define DISABLE_MOUSE_OVER_GOTO_FLOW "DISABLE_MOUSE_OVER_GOTO_FLOW"
|
||||||
#define ENLARGE_IMAGES "ENLARGE_IMAGES"
|
#define ENLARGE_IMAGES "ENLARGE_IMAGES"
|
||||||
|
Reference in New Issue
Block a user