Commit 8ca5abd4 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Add a reset button to the per-channel filter

And make the curves widget stretchable.

BUG:379519
CCMAIL:22shubh22@gmail.com

Patch by Shubham Goyal. Thanks!
parent 9dd5c1a6
......@@ -158,6 +158,11 @@ void KisCurveWidget::reset(void)
emit pointSelectedChanged();
d->m_guideVisible = false;
//remove total - 2 points.
while (d->m_curve.points().count() - 2 ) {
d->m_curve.removePoint(d->m_curve.points().count() - 2);
}
d->setCurveModified();
}
......
......@@ -111,7 +111,7 @@ KisPerChannelConfigWidget::KisPerChannelConfigWidget(QWidget * parent, KisPaintD
connect(m_page->cmbChannel, SIGNAL(activated(int)), this, SLOT(setActiveChannel(int)));
connect((QObject*)(m_page->chkLogarithmic), SIGNAL(toggled(bool)), this, SLOT(logHistView()));
connect((QObject*)(m_page->resetButton), SIGNAL(clicked()), this, SLOT(resetCurve()));
// create the horizontal and vertical gradient labels
m_page->hgradient->setPixmap(createGradient(Qt::Horizontal));
......@@ -193,11 +193,13 @@ inline QPixmap KisPerChannelConfigWidget::getHistogram()
const VirtualChannelInfo &info = m_virtualChannels[m_activeVChannel];
if (m_histogram && info.type() == VirtualChannelInfo::REAL)
{
m_histogram->setChannel(info.pixelIndex());
double highest = (double)m_histogram->calculations().getHighest();
qint32 bins = m_histogram->producer()->numberOfBins();
if (m_histogram->getHistogramType() == LINEAR) {
......@@ -629,3 +631,8 @@ void KisPerChannelConfigWidget::logHistView()
{
m_page->curveWidget->setPixmap(getHistogram());
}
void KisPerChannelConfigWidget::resetCurve()
{
m_page->curveWidget->reset();
}
......@@ -111,6 +111,8 @@ public:
private Q_SLOTS:
virtual void setActiveChannel(int ch);
void logHistView();
void resetCurve();
private:
......@@ -131,6 +133,7 @@ private:
// scales for displaying color numbers
double m_scale;
double m_shift;
bool checkReset;
};
#endif
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