From 9adfbde5120aff35a33bebbf94c1402b92a3a610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Poizl?= Date: Tue, 27 Aug 2024 13:43:17 +0200 Subject: [PATCH] Remember auto stretch on load --- stretchtoolbar.cpp | 9 +++++++++ stretchtoolbar.h | 1 + 2 files changed, 10 insertions(+) diff --git a/stretchtoolbar.cpp b/stretchtoolbar.cpp index 88adc93..98fef5b 100644 --- a/stretchtoolbar.cpp +++ b/stretchtoolbar.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "imageringlist.h" const float BLACK_POINT_SIGMA = -2.8f; @@ -91,6 +92,14 @@ StretchToolbar::StretchToolbar(QWidget *parent) : QToolBar(tr("Stretch toolbar") m_autoStretchOnLoad = addAction(QIcon(":/nuke_a.png"), tr("Apply auto stretch on load")); m_autoStretchOnLoad->setCheckable(true); + QSettings settings; + m_autoStretchOnLoad->setChecked(settings.value("stretchtoolbar/autostretch", false).toBool()); +} + +StretchToolbar::~StretchToolbar() +{ + QSettings settings; + settings.setValue("stretchtoolbar/autostretch", m_autoStretchOnLoad->isChecked()); } void StretchToolbar::stretchImage(Image *img) diff --git a/stretchtoolbar.h b/stretchtoolbar.h index d4f941c..60693e0 100644 --- a/stretchtoolbar.h +++ b/stretchtoolbar.h @@ -27,6 +27,7 @@ class StretchToolbar : public QToolBar MTFParam m_mtfParam; public: explicit StretchToolbar(QWidget *parent = nullptr); + ~StretchToolbar(); public slots: void stretchImage(Image *img); void resetMTF();