diff --git a/flameshot.example.ini b/flameshot.example.ini index a33eb071ed..15d842c704 100644 --- a/flameshot.example.ini +++ b/flameshot.example.ini @@ -78,6 +78,9 @@ ;; Anti-aliasing image when zoom the pinned image (bool) ;antialiasingPinZoom=true ; +;; Hide border effect around the pinned image (bool) +;pinHideDropShadow=false +; ;; Use JPG format instead of PNG (bool) ;useJpgForClipboard=false ; diff --git a/src/config/generalconf.cpp b/src/config/generalconf.cpp index 8c8024def7..ff0d69205b 100644 --- a/src/config/generalconf.cpp +++ b/src/config/generalconf.cpp @@ -54,6 +54,7 @@ GeneralConf::GeneralConf(QWidget* parent) initUploadWithoutConfirmation(); initHistoryConfirmationToDelete(); initAntialiasingPinZoom(); + initPinHideDropShadow(); initUploadHistoryMax(); initUndoLimit(); initUploadClientSecret(); @@ -81,6 +82,7 @@ void GeneralConf::_updateComponents(bool allowEmptySavePath) m_saveAfterCopy->setChecked(config.saveAfterCopy()); m_copyPathAfterSave->setChecked(config.copyPathAfterSave()); m_antialiasingPinZoom->setChecked(config.antialiasingPinZoom()); + m_pinHideDropShadow->setChecked(config.pinHideDropShadow()); m_useJpgForClipboard->setChecked(config.useJpgForClipboard()); m_copyOnDoubleClick->setChecked(config.copyOnDoubleClick()); m_uploadWithoutConfirmation->setChecked(config.uploadWithoutConfirmation()); @@ -427,6 +429,7 @@ void GeneralConf::initPredefinedColorPaletteLarge() ConfigHandler().setPredefinedColorPaletteLarge(checked); }); } + void GeneralConf::initCopyOnDoubleClick() { m_copyOnDoubleClick = new QCheckBox(tr("Copy on double click"), this); @@ -663,6 +666,19 @@ void GeneralConf::initAntialiasingPinZoom() }); } +void GeneralConf::initPinHideDropShadow() +{ + m_pinHideDropShadow = + new QCheckBox(tr("Hide border effect around the pinned image"), this); + m_pinHideDropShadow->setToolTip( + tr("Remove the drop shadow which lets the pinned image stand out" + "visually")); + m_scrollAreaLayout->addWidget(m_pinHideDropShadow); + connect(m_pinHideDropShadow, &QCheckBox::clicked, [](bool checked) { + ConfigHandler().setPinHideDropShadow(checked); + }); +} + void GeneralConf::initUploadWithoutConfirmation() { m_uploadWithoutConfirmation = diff --git a/src/config/generalconf.h b/src/config/generalconf.h index e1f4979163..df5c567283 100644 --- a/src/config/generalconf.h +++ b/src/config/generalconf.h @@ -74,6 +74,7 @@ private slots: void initCopyOnDoubleClick(); void initCopyPathAfterSave(); void initHistoryConfirmationToDelete(); + void initPinHideDropShadow(); void initPredefinedColorPaletteLarge(); void initSaveAfterCopy(); void initScrollArea(); @@ -113,6 +114,7 @@ private slots: QCheckBox* m_copyURLAfterUpload; QCheckBox* m_copyPathAfterSave; QCheckBox* m_antialiasingPinZoom; + QCheckBox* m_pinHideDropShadow; QCheckBox* m_saveLastRegion; QCheckBox* m_uploadWithoutConfirmation; QPushButton* m_importButton; diff --git a/src/tools/pin/pinwidget.cpp b/src/tools/pin/pinwidget.cpp index 8baa19e783..45c3a56d99 100644 --- a/src/tools/pin/pinwidget.cpp +++ b/src/tools/pin/pinwidget.cpp @@ -42,13 +42,16 @@ PinWidget::PinWidget(const QPixmap& pixmap, ConfigHandler conf; m_baseColor = conf.uiColor(); m_hoverColor = conf.contrastUiColor(); + const bool hideDropShadow = conf.pinHideDropShadow(); m_layout->setContentsMargins(MARGIN, MARGIN, MARGIN, MARGIN); m_shadowEffect->setColor(m_baseColor); m_shadowEffect->setBlurRadius(BLUR_RADIUS); m_shadowEffect->setOffset(0, 0); - setGraphicsEffect(m_shadowEffect); + if (!hideDropShadow) { + setGraphicsEffect(m_shadowEffect); + } setWindowOpacity(m_opacity); m_label->setPixmap(m_pixmap); diff --git a/src/utils/confighandler.cpp b/src/utils/confighandler.cpp index cb9ae5d7e0..0c22ce577c 100644 --- a/src/utils/confighandler.cpp +++ b/src/utils/confighandler.cpp @@ -93,6 +93,7 @@ static QMap> OPTION("copyURLAfterUpload" ,Bool ( true )), OPTION("copyPathAfterSave" ,Bool ( false )), OPTION("antialiasingPinZoom" ,Bool ( true )), + OPTION("pinHideDropShadow" ,Bool ( false )), OPTION("useJpgForClipboard" ,Bool ( false )), OPTION("uploadWithoutConfirmation" ,Bool ( false )), OPTION("saveAfterCopy" ,Bool ( false )), diff --git a/src/utils/confighandler.h b/src/utils/confighandler.h index aedd732915..4cd2c356d0 100644 --- a/src/utils/confighandler.h +++ b/src/utils/confighandler.h @@ -111,6 +111,7 @@ class ConfigHandler : public QObject CONFIG_GETTER_SETTER(copyPathAfterSave, setCopyPathAfterSave, bool) CONFIG_GETTER_SETTER(saveAsFileExtension, setSaveAsFileExtension, QString) CONFIG_GETTER_SETTER(antialiasingPinZoom, setAntialiasingPinZoom, bool) + CONFIG_GETTER_SETTER(pinHideDropShadow, setPinHideDropShadow, bool) CONFIG_GETTER_SETTER(useJpgForClipboard, setUseJpgForClipboard, bool) CONFIG_GETTER_SETTER(uploadWithoutConfirmation, setUploadWithoutConfirmation,