Commit 9e448fe8 authored by Halla Rempt's avatar Halla Rempt
Browse files

BUG:311241

Patch by Sahil
CCMAIl:nagpal.sahil01@gmail.com

Fixes using the mousewheel in the superslider
parent 93611f67
......@@ -53,12 +53,12 @@ KisAutoBrushWidget::KisAutoBrushWidget(QWidget *parent, const char* name)
inputRadius->addMultiplier(100.0);
inputRadius->setExponentRatio(3.0);
inputRadius->setValue(5.0);
connect(inputRadius, SIGNAL(valueChanged(qreal)), this, SLOT(paramChanged()));
connect(inputRadius, SIGNAL(valueChanged(qreal)), this, SLOT(spinBoxRadiusChanged(qreal)));
inputRatio->setRange(0.0, 1.0, 2);
inputRatio->setSingleStep(0.1);
inputRatio->setValue(1.0);
connect(inputRatio, SIGNAL(valueChanged(qreal)), this, SLOT(paramChanged()));
connect(inputRatio, SIGNAL(valueChanged(qreal)), this, SLOT(spinBoxRatioChanged(qreal)));
inputHFade->setRange(0.0, 1.0, 2);
inputHFade->setSingleStep(0.1);
......@@ -72,27 +72,27 @@ KisAutoBrushWidget::KisAutoBrushWidget(QWidget *parent, const char* name)
inputSpikes->setRange(2, 20);
inputSpikes->setValue(2);
connect(inputSpikes, SIGNAL(valueChanged(int)), this, SLOT(paramChanged()));
connect(inputSpikes, SIGNAL(valueChanged(int)), this, SLOT(spinBoxSpikesChanged(int)));
inputRandomness->setRange(0, 100);
inputRandomness->setValue(0);
connect(inputRandomness, SIGNAL(valueChanged(qreal)), this, SLOT(paramChanged()));
connect(inputRandomness, SIGNAL(valueChanged(qreal)), this, SLOT(spinBoxRandomnessChanged(qreal)));
inputAngle->setRange(0, 360);
inputAngle->setSuffix(QChar(Qt::Key_degree));
inputAngle->setValue(0);
connect(inputAngle, SIGNAL(valueChanged(int)), this, SLOT(paramChanged()));
connect(inputAngle, SIGNAL(valueChanged(int)), this, SLOT(spinBoxAngleChanged(int)));
inputSpacing->setRange(0.0, 10.0, 2);
inputSpacing->setSingleStep(0.1);
inputSpacing->setValue(0.1);
connect(inputSpacing, SIGNAL(valueChanged(qreal)), this, SLOT(paramChanged()));
connect(inputSpacing, SIGNAL(valueChanged(qreal)), this, SLOT(spinBoxSpacingChanged(qreal)));
density->setRange(0, 100, 0);
density->setSingleStep(1);
density->setValue(100);
density->setSuffix("%");
connect(density, SIGNAL(valueChanged(qreal)),this, SLOT(paramChanged()));
connect(density, SIGNAL(valueChanged(qreal)),this, SLOT(spinBoxDensityChanged(qreal)));
KisCubicCurve topLeftBottomRightLinearCurve;
topLeftBottomRightLinearCurve.setPoint(0, QPointF(0.0,1.0));
......@@ -189,10 +189,18 @@ void KisAutoBrushWidget::setStackedWidget(int index)
void KisAutoBrushWidget::spinBoxHorizontalChanged(qreal a)
{
if (m_linkFade) {
inputHFade->blockSignals(true);
inputHFade->setValue(a);
inputHFade->blockSignals(false);
inputVFade->blockSignals(true);
inputVFade->setValue(a);
inputVFade->blockSignals(false);
}
else {
inputHFade->blockSignals(true);
inputHFade->setValue(a);
inputHFade->blockSignals(false);
}
paramChanged();
}
......@@ -202,10 +210,75 @@ void KisAutoBrushWidget::spinBoxVerticalChanged(qreal a)
inputHFade->blockSignals(true);
inputHFade->setValue(a);
inputHFade->blockSignals(false);
inputVFade->blockSignals(true);
inputVFade->setValue(a);
inputVFade->blockSignals(false);
}
else {
inputVFade->blockSignals(true);
inputVFade->setValue(a);
inputVFade->blockSignals(false);
}
paramChanged();
}
void KisAutoBrushWidget::spinBoxRatioChanged(qreal a)
{
inputRatio->blockSignals(true);
inputRatio->setValue(a);
inputRatio->blockSignals(false);
paramChanged();
}
void KisAutoBrushWidget::spinBoxRandomnessChanged(qreal a)
{
inputRandomness->blockSignals(true);
inputRandomness->setValue(a);
inputRandomness->blockSignals(false);
paramChanged();
}
void KisAutoBrushWidget::spinBoxRadiusChanged(qreal a)
{
inputRadius->blockSignals(true);
inputRadius->setValue(a);
inputRadius->blockSignals(false);
paramChanged();
}
void KisAutoBrushWidget::spinBoxSpikesChanged(int a)
{
inputSpikes->blockSignals(true);
inputSpikes->setValue(a);
inputSpikes->blockSignals(false);
paramChanged();
}
void KisAutoBrushWidget::spinBoxAngleChanged(int a)
{
inputAngle->blockSignals(true);
inputAngle->setValue(a);
inputAngle->blockSignals(false);
paramChanged();
}
void KisAutoBrushWidget::spinBoxSpacingChanged(qreal a)
{
inputSpacing->blockSignals(true);
inputSpacing->setValue(a);
inputSpacing->blockSignals(false);
paramChanged();
}
void KisAutoBrushWidget::spinBoxDensityChanged(qreal a)
{
density->blockSignals(true);
density->setValue(a);
density->blockSignals(false);
paramChanged();
}
void KisAutoBrushWidget::linkFadeToggled(bool b)
{
m_linkFade = b;
......
......@@ -25,6 +25,7 @@
#include "ui_wdgautobrush.h"
#include <kis_auto_brush.h>
class KisWidgetChooser;
class PAINTOP_EXPORT KisWdgAutobrush : public QWidget, public Ui::KisWdgAutobrush
{
Q_OBJECT
......@@ -54,13 +55,18 @@ public:
QSizeF brushSize() const;
private slots:
void paramChanged();
void setStackedWidget(int);
void spinBoxHorizontalChanged(qreal);
void spinBoxVerticalChanged(qreal);
void linkFadeToggled(bool);
void spinBoxRatioChanged(qreal);
void spinBoxRandomnessChanged(qreal);
void spinBoxRadiusChanged(qreal);
void spinBoxSpikesChanged(int);
void spinBoxSpacingChanged(qreal);
void spinBoxAngleChanged(int);
void spinBoxDensityChanged(qreal);
signals:
......@@ -73,6 +79,7 @@ private:
QImage m_brush;
KisBrushSP m_autoBrush;
bool m_linkFade;
KisWidgetChooser* m_sliderChooser[2];
};
......
......@@ -246,7 +246,9 @@ void KisBrushSelectionWidget::precisionChanged(int value)
"The slowest performance. Best quality.");
break;
}
uiWdgBrushChooser.sliderPrecision->blockSignals(true);
uiWdgBrushChooser.sliderPrecision->setValue(value);
uiWdgBrushChooser.sliderPrecision->blockSignals(false);
uiWdgBrushChooser.sliderPrecision->setToolTip(toolTip);
m_precisionOption.setPrecisionLevel(value);
emit sigPrecisionChanged();
......
Supports Markdown
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