Commit 541a0c94 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Synchronize the other color selectors with the advanced color selector

BUG:297532
parent bc0b447c
......@@ -295,12 +295,21 @@ void KisColorSelector::setColor(const QColor &color)
void KisColorSelector::mouseEvent(QMouseEvent *e)
{
if(m_grabbingComponent && (e->buttons()&Qt::LeftButton || e->buttons()&Qt::RightButton)) {
if (m_grabbingComponent && (e->buttons() & Qt::LeftButton || e->buttons() & Qt::RightButton)) {
m_grabbingComponent->mouseEvent(e->x(), e->y());
m_currentColor=m_mainComponent->currentColor();
KoColor kocolor(m_currentColor, colorSpace());
updateColorPreview(kocolor.toQColor());
if (e->buttons() & Qt::LeftButton) {
commitColor(kocolor, Foreground);
}
else if (e->buttons() & Qt::RightButton) {
commitColor(kocolor, Background);
}
}
}
......
......@@ -134,6 +134,7 @@ private:
bool m_blipDisplay;
ColorRole m_lastColorRole;
public:
void setDisplayBlip(bool disp) {m_blipDisplay = disp;}
bool displayBlip() const {return m_blipDisplay;}
......
......@@ -416,7 +416,7 @@ void KisColorSelectorBase::commitColor(const KoColor& color, ColorRole role)
m_colorUpdateAllowed=false;
if (role==Foreground)
if (role == Foreground)
m_canvas->resourceManager()->setForegroundColor(color);
else
m_canvas->resourceManager()->setBackgroundColor(color);
......@@ -434,9 +434,9 @@ void KisColorSelectorBase::canvasResourceChanged(int key, const QVariant &v)
if (key == KoCanvasResourceManager::ForegroundColor || key == KoCanvasResourceManager::BackgroundColor) {
QColor c = findGeneratingColor(v.value<KoColor>());
updateColorPreview(c);
if(m_colorUpdateAllowed==false)
return;
setColor(c);
if (m_colorUpdateAllowed) {
setColor(c);
}
}
}
......
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