Pin antialiasing option (#1997)

* adds a config option to toggle antialiasing for the pin zoom

* fix C++ scope error thanks for @veracioux

* set the default value of antialiasing of pin tool to be true

* fix the clang-format
This commit is contained in:
Mehrad Mahmoudian
2021-10-22 20:36:21 +03:00
committed by GitHub
parent 988dcab9de
commit 08e532f787
6 changed files with 34 additions and 2 deletions

View File

@@ -40,6 +40,7 @@ GeneralConf::GeneralConf(QWidget* parent)
initShowStartupLaunchMessage();
initCopyAndCloseAfterUpload();
initCopyPathAfterSave();
initAntialiasingPinZoom();
initUseJpgForClipboard();
initSaveAfterCopy();
inituploadHistoryMax();
@@ -62,6 +63,7 @@ void GeneralConf::_updateComponents(bool allowEmptySavePath)
m_copyAndCloseAfterUpload->setChecked(config.copyAndCloseAfterUpload());
m_saveAfterCopy->setChecked(config.saveAfterCopy());
m_copyPathAfterSave->setChecked(config.copyPathAfterSave());
m_antialiasingPinZoom->setChecked(config.antialiasingPinZoom());
m_useJpgForClipboard->setChecked(config.useJpgForClipboard());
m_historyConfirmationToDelete->setChecked(
config.historyConfirmationToDelete());
@@ -488,6 +490,19 @@ void GeneralConf::initCopyPathAfterSave()
});
}
void GeneralConf::initAntialiasingPinZoom()
{
m_antialiasingPinZoom =
new QCheckBox(tr("Anti-aliasing image when zoom the pinned image"), this);
m_antialiasingPinZoom->setToolTip(
tr("After zooming the pinned image, should the image get smoothened or "
"stay pixelated"));
m_scrollAreaLayout->addWidget(m_antialiasingPinZoom);
connect(m_antialiasingPinZoom, &QCheckBox::clicked, [](bool checked) {
ConfigHandler().setAntialiasingPinZoom(checked);
});
}
const QString GeneralConf::chooseFolder(const QString pathDefault)
{
QString path;