Added magnifier for more precise selections (#2219)

* added a magnifierwidget

* added option to show magnifier and added option to switch to square shaped magnifier

* integrated magnifierwidget into capture

this could probably be done in a nicer way.
right now the magnifier wont show if you select via the move tool.

Co-authored-by: Silas Dohm <silas@sdohm.xyz>
This commit is contained in:
SilasDo
2022-02-06 02:51:28 +01:00
committed by GitHub
parent 4affa92b91
commit cf08755c8b
9 changed files with 252 additions and 0 deletions

View File

@@ -57,6 +57,8 @@ GeneralConf::GeneralConf(QWidget* parent)
m_layout->addStretch();
initShowMagnifier();
initSquareMagnifier();
// this has to be at the end
initConfigButtons();
updateComponents();
@@ -79,6 +81,8 @@ void GeneralConf::_updateComponents(bool allowEmptySavePath)
config.historyConfirmationToDelete());
m_checkForUpdates->setChecked(config.checkForUpdates());
m_allowMultipleGuiInstances->setChecked(config.allowMultipleGuiInstances());
m_showMagnifier->setChecked(config.showMagnifier());
m_squareMagnifier->setChecked(config.squareMagnifier());
#if !defined(Q_OS_WIN)
m_autoCloseIdleDaemon->setChecked(config.autoCloseIdleDaemon());
@@ -622,6 +626,24 @@ const QString GeneralConf::chooseFolder(const QString pathDefault)
return path;
}
void GeneralConf::initShowMagnifier()
{
m_showMagnifier = new QCheckBox(tr("Show magnifier"), this);
m_scrollAreaLayout->addWidget(m_showMagnifier);
connect(m_showMagnifier, &QCheckBox::clicked, [](bool checked) {
ConfigHandler().setShowMagnifier(checked);
});
}
void GeneralConf::initSquareMagnifier()
{
m_squareMagnifier = new QCheckBox(tr("Square shaped magnifier"), this);
m_scrollAreaLayout->addWidget(m_squareMagnifier);
connect(m_squareMagnifier, &QCheckBox::clicked, [](bool checked) {
ConfigHandler().setSquareMagnifier(checked);
});
}
void GeneralConf::togglePathFixed()
{
ConfigHandler().setSavePathFixed(m_screenshotPathFixedCheck->isChecked());