Commit 9a55699c authored by Dmitry Kazakov's avatar Dmitry Kazakov

Allow editing gradient stops with usual Krita Color Selectors

Just make sure the stop is selected atm
parent 4e6fd27c
......@@ -24,6 +24,7 @@
#include <QMetaType>
#include "kritapigment_export.h"
#include "KoColorConversionTransformation.h"
#include <boost/operators.hpp>
class QDomDocument;
......@@ -36,7 +37,7 @@ class KoColorSpace;
* A KoColor describes a color in a certain colorspace. The color is stored in a buffer
* that can be manipulated by the function of the color space.
*/
class KRITAPIGMENT_EXPORT KoColor
class KRITAPIGMENT_EXPORT KoColor : public boost::equality_comparable<KoColor>
{
public:
......
......@@ -92,6 +92,15 @@ void KisStopGradientEditor::setGradient(KoStopGradient *gradient)
emit sigGradientChanged();
}
void KisStopGradientEditor::notifyGlobalColorChanged(const KoColor &color)
{
if (colorButton->isEnabled() &&
color != colorButton->color()) {
colorButton->setColor(color);
}
}
void KisStopGradientEditor::stopChanged(int stop)
{
const bool hasStopSelected = stop >= 0;
......
......@@ -37,6 +37,8 @@ public:
void setGradient(KoStopGradient* gradient);
void notifyGlobalColorChanged(const KoColor &color);
Q_SIGNALS:
void sigGradientChanged();
......
......@@ -351,6 +351,8 @@ void KoFillConfigWidget::slotCanvasResourceChanged(int key, const QVariant &valu
d->ui->stackWidget->setCurrentIndex(Solid);
d->colorAction->setCurrentColor(color);
d->colorChangedCompressor.start();
} else if (checkedId == Gradient) {
d->ui->wdgGradientEditor->notifyGlobalColorChanged(color);
}
}
}
......
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