From kde-commits Sun Sep 11 15:33:52 2016 From: Sven Langkamp Date: Sun, 11 Sep 2016 15:33:52 +0000 To: kde-commits Subject: [krita/langkamp/stopgradienteditor] libs/ui: Port stop based gradient editor to KisColorButton Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=147360804031419 Git commit a835c75899dde3e7a93ad2fba02657ccf645a304 by Sven Langkamp. Committed on 11/09/2016 at 15:33. Pushed by langkamp into branch 'langkamp/stopgradienteditor'. Port stop based gradient editor to KisColorButton M +3 -4 libs/ui/forms/wdgstopgradienteditor.ui M +6 -6 libs/ui/kis_stopgradient_editor.cpp M +1 -1 libs/ui/kis_stopgradient_editor.h http://commits.kde.org/krita/a835c75899dde3e7a93ad2fba02657ccf645a304 diff --git a/libs/ui/forms/wdgstopgradienteditor.ui b/libs/ui/forms/wdgstop= gradienteditor.ui index 694799a..5dc6ea2 100644 --- a/libs/ui/forms/wdgstopgradienteditor.ui +++ b/libs/ui/forms/wdgstopgradienteditor.ui @@ -54,7 +54,7 @@ - + 0 @@ -92,10 +92,9 @@ - KColorButton + KisColorButton QPushButton -
kcolorbutton.h
- 1 +
kis_color_button.h
KisStopGradientSliderWidget diff --git a/libs/ui/kis_stopgradient_editor.cpp b/libs/ui/kis_stopgradient= _editor.cpp index dd1d2b9..9c33bf1 100644 --- a/libs/ui/kis_stopgradient_editor.cpp +++ b/libs/ui/kis_stopgradient_editor.cpp @@ -45,7 +45,7 @@ KisStopGradientEditor::KisStopGradientEditor(KoStopGradie= nt* gradient, QWidget * nameedit->setText(gradient->name()); connect(nameedit, SIGNAL(editingFinished()), this, SLOT(nameChanged())= ); = - connect(colorButton, SIGNAL(changed(const QColor&)), SLOT(colorChanged= (const QColor&))); + connect(colorButton, SIGNAL(changed(const KoColor&)), SLOT(colorChange= d(const KoColor&))); = opacitySlider->setRange(0.0, 1.0, 2); connect(opacitySlider, SIGNAL(valueChanged(qreal)), this, SLOT(opacity= Changed(qreal))); @@ -64,16 +64,16 @@ void KisStopGradientEditor::activate() = void KisStopGradientEditor::stopChanged(int stop) { - QColor color =3D m_gradient->stops()[stop].second.toQColor(); - opacitySlider->setValue(color.alphaF()); - = - color.setAlphaF(1.0); + KoColor color =3D m_gradient->stops()[stop].second; + opacitySlider->setValue(color.opacityF()); + = + color.setOpacity(1.0); colorButton->setColor(color); = paramChanged(); } = -void KisStopGradientEditor::colorChanged(const QColor& color) +void KisStopGradientEditor::colorChanged(const KoColor& color) { QList stops =3D m_gradient->stops(); = diff --git a/libs/ui/kis_stopgradient_editor.h b/libs/ui/kis_stopgradient_e= ditor.h index 88f9eeb..c3017ca 100644 --- a/libs/ui/kis_stopgradient_editor.h +++ b/libs/ui/kis_stopgradient_editor.h @@ -35,7 +35,7 @@ private: KoStopGradient* m_gradient; private Q_SLOTS: void stopChanged(int stop); - void colorChanged(const QColor& color); + void colorChanged(const KoColor& color); void opacityChanged(qreal value); void nameChanged(); void reverse();