Commit b2d3c9a7 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Unset Erase mode when changing colors

As suggested at LGM by MyPaint's MNaxy. It turns out to be _extremely_
irritating to have to remember to unselect erase more -- when you pick
a color, it's a 100% chance you want to paint, not to go on erasing.
parent f2c269b5
......@@ -276,6 +276,7 @@ KisPaintopBox::KisPaintopBox(KisView2 * view, QWidget *parent, const char * name
//Needed to connect canvas to favorite resource manager
m_view->canvasBase()->createFavoriteResourceManager(this);
connect(m_view->resourceProvider(), SIGNAL(sigOpacityChanged(qreal)), SLOT(slotOpacityChanged(qreal)));
connect(m_view->resourceProvider(), SIGNAL(sigFGColorChanged(KoColor)), SLOT(slotUnsetEraseMode()));
}
KisPaintopBox::~KisPaintopBox()
......@@ -437,10 +438,12 @@ void KisPaintopBox::updateCompositeOp(QString compositeOpID)
m_cmbCompositeOp->setCurrentIndex(index);
m_cmbCompositeOp->blockSignals(false);
m_eraseModeButton->defaultAction()->blockSignals(true);
m_eraseModeButton->blockSignals(true);
m_eraseModeButton->setChecked(compositeOpID == COMPOSITE_ERASE);
m_eraseModeButton->blockSignals(false);
m_eraseModeButton->defaultAction()->blockSignals(false);
if(compositeOpID != m_currCompositeOpID) {
m_activePreset->settings()->setProperty("CompositeOp", compositeOpID);
m_optionWidget->setConfiguration(m_activePreset->settings().data());
......@@ -798,3 +801,10 @@ void KisPaintopBox::slotSwitchToPreviousPreset()
setCurrentPaintop(m_previousPreset->paintOp(), m_previousPreset);
}
}
void KisPaintopBox::slotUnsetEraseMode()
{
if (m_currCompositeOpID == COMPOSITE_ERASE) {
updateCompositeOp(m_prevCompositeOpID);
}
}
......@@ -126,7 +126,7 @@ private slots:
void slotPreviousFavoritePreset();
void slotNextFavoritePreset();
void slotSwitchToPreviousPreset();
void slotUnsetEraseMode();
private:
KisCanvasResourceProvider* m_resourceProvider;
QHBoxLayout* m_layout;
......@@ -150,7 +150,7 @@ private:
QString m_prevCompositeOpID;
QString m_currCompositeOpID;
KisNodeSP m_previousNode;
struct TabletToolID
{
TabletToolID(const KoInputDevice& dev) {
......
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