Commit 300bc3ad authored by Jan Hambrecht's avatar Jan Hambrecht
Browse files

Make advanced settings visibility of crop tool persistent.

BUG:312356
REVIEW:108885
parent bb3787bb
......@@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <lib/documentview/rasterimageview.h>
#include "cropimageoperation.h"
#include "cropwidget.h"
#include "gwenviewconfig.h"
static const int HANDLE_SIZE = 15;
......@@ -398,10 +399,12 @@ void CropTool::hoverMoveEvent(QGraphicsSceneHoverEvent* event)
void CropTool::toolActivated()
{
imageView()->setCursor(Qt::CrossCursor);
d->mCropWidget->setAdvancedSettingsEnabled(GwenviewConfig::cropAdvancedSettingsEnabled());
}
void CropTool::toolDeactivated()
{
GwenviewConfig::setCropAdvancedSettingsEnabled(d->mCropWidget->advancedSettingsEnabled());
}
void CropTool::slotCropRequested()
......
......@@ -247,6 +247,16 @@ CropWidget::~CropWidget()
delete d;
}
void CropWidget::setAdvancedSettingsEnabled(bool enable)
{
d->advancedCheckBox->setChecked(enable);
}
bool CropWidget::advancedSettingsEnabled() const
{
return d->advancedCheckBox->isChecked();
}
void CropWidget::setCropRect(const QRect& rect)
{
d->mUpdatingFromCropTool = true;
......
......@@ -45,6 +45,9 @@ public:
CropWidget(QWidget* parent, RasterImageView*, CropTool*);
~CropWidget();
void setAdvancedSettingsEnabled(bool enable);
bool advancedSettingsEnabled() const;
Q_SIGNALS:
void cropRequested();
void done();
......
......@@ -241,5 +241,11 @@
</entry>
</group>
<group name="Crop">
<entry name="CropAdvancedSettingsEnabled" type="Bool">
<default>false</default>
</entry>
</group>
</kcfg>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment