Commit c6d302a0 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Make sure the paintop box's opacity slider follows the keyboard input

parent ac84de78
......@@ -80,7 +80,6 @@ void KisCanvasResourceProvider::setResourceManager(KoCanvasResourceManager *reso
connect(m_resourceManager, SIGNAL(resourceChanged(int, const QVariant &)),
this, SLOT(slotResourceChanged(int, const QVariant&)));
}
......@@ -317,6 +316,10 @@ void KisCanvasResourceProvider::slotResourceChanged(int key, const QVariant & re
break;
case(CurrentCompositeOp) :
emit sigCompositeOpChanged(currentCompositeOp());
case (Opacity):
{
emit sigOpacityChanged(res.toDouble());
}
default:
;
// Do nothing
......
......@@ -161,6 +161,7 @@ signals:
void sigFGColorUsed(const KoColor&);
void sigCompositeOpChanged(const QString &);
void sigOnScreenResolutionChanged(qreal scaleX, qreal scaleY);
void sigOpacityChanged(qreal);
private:
......
......@@ -246,8 +246,9 @@ KisPaintopBox::KisPaintopBox(KisView2 * view, QWidget *parent, const char * name
connect(m_sliderChooser[1]->getWidget<KisDoubleSliderSpinBox>("flow") , SIGNAL(valueChanged(qreal)), SLOT(slotSlider2Changed()));
connect(m_sliderChooser[1]->getWidget<KisDoubleSliderSpinBox>("size") , SIGNAL(valueChanged(qreal)), SLOT(slotSlider2Changed()));
//Needed to connect canvas to favoriate resource manager
//Needed to connect canvas to favorite resource manager
m_view->canvasBase()->createFavoriteResourceManager(this);
connect(m_view->resourceProvider(), SIGNAL(sigOpacityChanged(qreal)), SLOT(slotOpacityChanged(qreal)));
}
KisPaintopBox::~KisPaintopBox()
......@@ -692,3 +693,13 @@ void KisPaintopBox::slotToolChanged(KoCanvasController* canvas, int toolId)
}
else setWidgetState(DISABLE_ALL);
}
void KisPaintopBox::slotOpacityChanged(qreal opacity)
{
for (int i = 0; i < 2; ++i) {
KisDoubleSliderSpinBox *opacitySlider = m_sliderChooser[i]->getWidget<KisDoubleSliderSpinBox>("opacity");
opacitySlider->blockSignals(true);
opacitySlider->setValue(opacity);
opacitySlider->blockSignals(false);
}
}
......@@ -125,6 +125,7 @@ private slots:
void slotSlider1Changed();
void slotSlider2Changed();
void slotToolChanged(KoCanvasController* canvas, int toolId);
void slotOpacityChanged(qreal);
private:
KisCanvasResourceProvider* m_resourceProvider;
......
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