Commit 000937fa authored by Sven Langkamp's avatar Sven Langkamp

allow to change the name with the gradient editor

parent 9005226c
......@@ -7,16 +7,30 @@
<x>0</x>
<y>0</y>
<width>500</width>
<height>200</height>
<height>250</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>200</height>
<height>250</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0,0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="nameedit"/>
</item>
</layout>
</item>
<item>
<widget class="KisGradientSliderWidget" name="gradientSlider" native="true">
<property name="sizePolicy">
......
......@@ -41,11 +41,13 @@ KisAutogradient::KisAutogradient(KisAutogradientResource* gradient, QWidget *par
setupUi(this);
setWindowTitle(caption);
gradientSlider->setGradientResource(m_autogradientResource);
nameedit->setText(gradient->name());
KoGradientSegment* segment = gradientSlider->selectedSegment();
if (segment) {
slotSelectedSegment(segment);
}
connect(nameedit, SIGNAL(editingFinished()), this, SLOT(slotChangedName()));
connect(gradientSlider, SIGNAL(sigSelectedSegment(KoGradientSegment*)), SLOT(slotSelectedSegment(KoGradientSegment*)));
connect(gradientSlider, SIGNAL(sigChangedSegment(KoGradientSegment*)), SLOT(slotChangedSegment(KoGradientSegment*)));
connect(comboBoxColorInterpolationType, SIGNAL(activated(int)), SLOT(slotChangedColorInterpolation(int)));
......@@ -163,6 +165,11 @@ void KisAutogradient::slotChangedRightOpacity(int value)
paramChanged();
}
void KisAutogradient::slotChangedName()
{
m_autogradientResource->setName(nameedit->text());
}
void KisAutogradient::paramChanged()
{
m_autogradientResource->updatePreview();
......
......@@ -46,6 +46,7 @@ private slots:
void slotChangedRightColor(const QColor& color);
void slotChangedLeftOpacity(int value);
void slotChangedRightOpacity(int value);
void slotChangedName();
void paramChanged();
};
......
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