Commit 87c714da authored by Dan Leinir Turthra Jensen's avatar Dan Leinir Turthra Jensen Committed by Boudewijn Rempt

React to resource changes on the canvas and change UI accordingly

parent 72a1dc83
......@@ -527,6 +527,24 @@ void KisPaintopBox::slotCurrentNodeChanged(KisNodeSP node)
}
}
void KisPaintopBox::slotCanvasResourceChanged(int /*key*/, const QVariant& /*v*/)
{
if(m_view)
{
sender()->blockSignals(true);
KisPaintOpPresetSP preset = m_view->canvasBase()->resourceManager()->resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
if(preset && m_activePreset->name() != preset->name())
{
QString compositeOp = preset->settings()->getString("CompositeOp");
updateCompositeOp(compositeOp);
resourceSelected(preset.data());
}
if(m_resourceProvider->currentCompositeOp() != m_currCompositeOpID)
updateCompositeOp(m_resourceProvider->currentCompositeOp());
sender()->blockSignals(false);
}
}
void KisPaintopBox::slotSaveActivePreset()
{
KisPaintOpPresetSP curPreset = m_resourceProvider->currentPreset();
......
......@@ -95,6 +95,7 @@ public slots:
void slotColorSpaceChanged(const KoColorSpace* colorSpace);
void slotInputDeviceChanged(const KoInputDevice & inputDevice);
void slotCurrentNodeChanged(KisNodeSP node);
void slotCanvasResourceChanged(int key, const QVariant& v);
void slotSaveActivePreset();
void slotUpdatePreset();
void slotSetupDefaultPreset();
......
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