Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 89d5316c authored by Dmitry Kazakov's avatar Dmitry Kazakov

Rename back methods that were used for refactoring

setKoColor() -> setColor()
selectKoColor() -> selectColor()
parent a34c47bd
......@@ -79,7 +79,7 @@ KisColorSelector::KisColorSelector(QWidget* parent)
KisColorSelectorBase* KisColorSelector::createPopup() const
{
KisColorSelectorBase* popup = new KisColorSelector(0);
popup->setKoColor(m_lastRealColor);
popup->setColor(m_lastRealColor);
return popup;
}
......@@ -224,7 +224,7 @@ void KisColorSelector::resizeEvent(QResizeEvent* e) {
}
// reset the currect color after resizing the widget
setKoColor(m_lastRealColor);
setColor(m_lastRealColor);
KisColorSelectorBase::resizeEvent(e);
}
......@@ -276,10 +276,10 @@ bool KisColorSelector::displaySettingsButton()
return dynamic_cast<KisColorSelectorContainer*>(parent());
}
void KisColorSelector::setKoColor(const KoColor &color)
void KisColorSelector::setColor(const KoColor &color)
{
m_mainComponent->setKoColor(color);
m_subComponent->setKoColor(color);
m_mainComponent->setColor(color);
m_subComponent->setColor(color);
m_lastRealColor = color;
update();
}
......
......@@ -93,7 +93,7 @@ public:
void setConfiguration(Configuration conf);
Configuration configuration() const;
void setKoColor(const KoColor &color);
void setColor(const KoColor &color);
public slots:
void updateSettings();
......
......@@ -315,11 +315,11 @@ void KisColorSelectorBase::updateColor(const KoColor &color, Acs::ColorRole role
commitColor(color, role);
if (needsExplicitColorReset) {
setKoColor(color);
setColor(color);
}
}
void KisColorSelectorBase::setKoColor(const KoColor& color)
void KisColorSelectorBase::setColor(const KoColor& color)
{
Q_UNUSED(color);
}
......@@ -405,7 +405,7 @@ void KisColorSelectorBase::canvasResourceChanged(int key, const QVariant &v)
KoColor realColor(v.value<KoColor>());
updateColorPreview(realColor);
if (m_colorUpdateAllowed && !m_colorUpdateSelf) {
setKoColor(realColor);
setColor(realColor);
}
}
}
......
......@@ -55,7 +55,7 @@ public:
void updateColorPreview(const KoColor &color);
void showColorPreview();
virtual void setKoColor(const KoColor& color);
virtual void setColor(const KoColor& color);
public slots:
virtual void updateSettings();
......
......@@ -67,7 +67,7 @@ public:
item->setMinimumSize(selectorSize, selectorSize);
item->setMouseTracking(true);
item->setEnabled(false);
item->setKoColor(KoColor(QColor(255,0,0), item->colorSpace()));
item->setColor(KoColor(QColor(255,0,0), item->colorSpace()));
item->setDisplayBlip(false);
}
}
......@@ -124,7 +124,7 @@ KisColorSelectorComboBox::KisColorSelectorComboBox(QWidget* parent) :
layout->addWidget(&m_currentSelector);
m_currentSelector.setEnabled(false);
m_currentSelector.setDisplayBlip(false);
m_currentSelector.setKoColor(KoColor(QColor(255,0,0), m_currentSelector.colorSpace()));
m_currentSelector.setColor(KoColor(QColor(255,0,0), m_currentSelector.colorSpace()));
// 30 pixels for the arrow of the combobox
setMinimumSize(m_private->selectorSize+m_private->spacing+30,m_private->selectorSize+m_private->spacing);
......@@ -177,6 +177,6 @@ void KisColorSelectorComboBox::setConfiguration(KisColorSelector::Configuration
{
m_configuration=conf;
m_currentSelector.setConfiguration(conf);
m_currentSelector.setKoColor(KoColor(QColor(255,0,0), m_currentSelector.colorSpace()));
m_currentSelector.setColor(KoColor(QColor(255,0,0), m_currentSelector.colorSpace()));
update();
}
......@@ -69,7 +69,7 @@ void KisColorSelectorComponent::mouseEvent(int x, int y)
int newX=qBound(0, (x-m_x), width());
int newY=qBound(0, (y-m_y), height());
selectKoColor(newX, newY);
selectColor(newX, newY);
m_lastX=newX;
m_lastY=newY;
}
......@@ -96,7 +96,7 @@ bool KisColorSelectorComponent::containsPointInComponentCoords(int x, int y) con
KoColor KisColorSelectorComponent::currentColor()
{
return selectKoColor(m_lastX, m_lastY);
return selectColor(m_lastX, m_lastY);
}
void KisColorSelectorComponent::setParam(qreal hue, qreal hsvSaturation, qreal value, qreal hslSaturation, qreal lightness)
......
......@@ -53,7 +53,7 @@ public:
void setConfiguration(Parameter param, Type type);
/// set the color, blibs etc
virtual void setKoColor(const KoColor& color) = 0;
virtual void setColor(const KoColor& color) = 0;
/// returns true, if this component wants to grab the mouse (normaly true, if containsPoint returns true)
bool wantsGrab(int x, int y) {return containsPointInComponentCoords(x-m_x, y-m_y);}
......@@ -73,7 +73,7 @@ protected:
bool isDirty() const;
/// this method must be overloaded to return the colour at position x/y and draw a marker on that position
virtual KoColor selectKoColor(int x, int y) = 0;
virtual KoColor selectColor(int x, int y) = 0;
/// paint component using given painter
/// the component should respect width() and height() (eg. scale to width and height), but doesn't
......
......@@ -102,7 +102,7 @@ void KisColorSelectorRing::paint(QPainter* painter)
}
}
KoColor KisColorSelectorRing::selectKoColor(int x, int y)
KoColor KisColorSelectorRing::selectColor(int x, int y)
{
QPoint ringMiddle(width()/2, height()/2);
QPoint ringCoord = QPoint(x, y)-ringMiddle;
......@@ -115,7 +115,7 @@ KoColor KisColorSelectorRing::selectKoColor(int x, int y)
return KoColor();
}
void KisColorSelectorRing::setKoColor(const KoColor &color)
void KisColorSelectorRing::setColor(const KoColor &color)
{
qreal h, s, v;
m_parent->converter()->getHsvF(color, &h, &s, &v);
......
......@@ -28,11 +28,11 @@ class KisColorSelectorRing : public KisColorSelectorComponent
public:
explicit KisColorSelectorRing(KisColorSelector *parent);
int innerRadius() const;
void setKoColor(const KoColor &color);
void setColor(const KoColor &color);
protected:
void paint(QPainter*);
KoColor selectKoColor(int x, int y);
KoColor selectColor(int x, int y);
bool containsPointInComponentCoords(int x, int y) const;
private:
......
......@@ -29,7 +29,7 @@ KisColorSelectorSimple::KisColorSelectorSimple(KisColorSelector *parent) :
{
}
KoColor KisColorSelectorSimple::selectKoColor(int x, int y)
KoColor KisColorSelectorSimple::selectColor(int x, int y)
{
m_lastClickPos.setX(x/qreal(width()));
m_lastClickPos.setY(y/qreal(height()));
......@@ -83,7 +83,7 @@ KoColor KisColorSelectorSimple::selectKoColor(int x, int y)
return colorAt(x, y);
}
void KisColorSelectorSimple::setKoColor(const KoColor &color)
void KisColorSelectorSimple::setColor(const KoColor &color)
{
qreal hsvH, hsvS, hsvV;
qreal hslH, hslS, hslL;
......
......@@ -31,11 +31,11 @@ class KisColorSelectorSimple : public KisColorSelectorComponent
Q_OBJECT
public:
explicit KisColorSelectorSimple(KisColorSelector *parent);
void setKoColor(const KoColor &color);
void setColor(const KoColor &color);
protected:
void paint(QPainter*);
KoColor selectKoColor(int x, int y);
KoColor selectColor(int x, int y);
private:
KoColor colorAt(int x, int y);
......
......@@ -90,7 +90,7 @@ void KisColorSelectorTriangle::updatePixelCache()
}
}
KoColor KisColorSelectorTriangle::selectKoColor(int x, int y)
KoColor KisColorSelectorTriangle::selectColor(int x, int y)
{
emit update();
......@@ -112,7 +112,7 @@ KoColor KisColorSelectorTriangle::selectKoColor(int x, int y)
return colorAt(triangleCoords.x(), triangleCoords.y());
}
void KisColorSelectorTriangle::setKoColor(const KoColor &color)
void KisColorSelectorTriangle::setColor(const KoColor &color)
{
qreal h, s, v;
m_parent->converter()->getHsvF(color, &h, &s, &v);
......
......@@ -28,11 +28,11 @@ class KisColorSelectorTriangle : public KisColorSelectorComponent
Q_OBJECT
public:
explicit KisColorSelectorTriangle(KisColorSelector* parent);
void setKoColor(const KoColor &color);
void setColor(const KoColor &color);
protected:
void paint(QPainter*);
KoColor selectKoColor(int x, int y);
KoColor selectColor(int x, int y);
bool containsPointInComponentCoords(int x, int y) const;
private:
......
......@@ -30,7 +30,7 @@ KisColorSelectorWheel::KisColorSelectorWheel(KisColorSelector *parent) :
{
}
KoColor KisColorSelectorWheel::selectKoColor(int x, int y)
KoColor KisColorSelectorWheel::selectColor(int x, int y)
{
int xWheel = x-width()/2;
int yWheel = y-height()/2;
......@@ -75,7 +75,7 @@ KoColor KisColorSelectorWheel::selectKoColor(int x, int y)
return colorAt(x, y, true);
}
void KisColorSelectorWheel::setKoColor(const KoColor &color)
void KisColorSelectorWheel::setColor(const KoColor &color)
{
qreal hsvH, hsvS, hsvV;
qreal hslH, hslS, hslL;
......
......@@ -31,10 +31,10 @@ class KisColorSelectorWheel : public KisColorSelectorComponent
Q_OBJECT
public:
explicit KisColorSelectorWheel(KisColorSelector *parent);
void setKoColor(const KoColor &color);
void setColor(const KoColor &color);
protected:
KoColor selectKoColor(int x, int y);
KoColor selectColor(int x, int y);
void paint(QPainter*);
private:
......
......@@ -66,7 +66,7 @@ void KisMinimalShadeSelector::setCanvas(KisCanvas2 *canvas)
m_canvas = canvas;
}
void KisMinimalShadeSelector::setKoColor(const KoColor& color)
void KisMinimalShadeSelector::setColor(const KoColor& color)
{
m_lastRealColor = color;
......@@ -164,7 +164,7 @@ void KisMinimalShadeSelector::canvasResourceChanged(int key, const QVariant &v)
if ((key == KoCanvasResourceManager::ForegroundColor && onForeground)
|| (key == KoCanvasResourceManager::BackgroundColor && onBackground)) {
setKoColor(v.value<KoColor>());
setColor(v.value<KoColor>());
}
}
......@@ -177,6 +177,6 @@ void KisMinimalShadeSelector::paintEvent(QPaintEvent *)
KisColorSelectorBase* KisMinimalShadeSelector::createPopup() const
{
KisMinimalShadeSelector* popup = new KisMinimalShadeSelector(0);
popup->setKoColor(m_lastRealColor);
popup->setColor(m_lastRealColor);
return popup;
}
......@@ -37,7 +37,7 @@ public:
void setCanvas(KisCanvas2* canvas);
protected:
void setKoColor(const KoColor& color);
void setColor(const KoColor& color);
void mouseMoveEvent(QMouseEvent *);
void mousePressEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
......
......@@ -61,7 +61,7 @@ KisMyPaintShadeSelector::KisMyPaintShadeSelector(QWidget *parent) :
updateSettings();
setMinimumSize(80, 80);
setKoColor(KoColor(Qt::red, colorSpace()));
setColor(KoColor(Qt::red, colorSpace()));
m_updateTimer->setInterval(1);
m_updateTimer->setSingleShot(true);
......@@ -228,11 +228,11 @@ void KisMyPaintShadeSelector::mouseReleaseEvent(QMouseEvent *e)
KisColorSelectorBase* KisMyPaintShadeSelector::createPopup() const
{
KisColorSelectorBase* popup = new KisMyPaintShadeSelector(0);
popup->setKoColor(m_lastRealColor);
popup->setColor(m_lastRealColor);
return popup;
}
void KisMyPaintShadeSelector::setKoColor(const KoColor &color) {
void KisMyPaintShadeSelector::setColor(const KoColor &color) {
this->converter()->getHsvF(color, &m_colorH, &m_colorS, &m_colorV);
m_lastRealColor = color;
......@@ -252,7 +252,7 @@ void KisMyPaintShadeSelector::canvasResourceChanged(int key, const QVariant &v)
if ((key == KoCanvasResourceManager::ForegroundColor && onForeground) ||
(key == KoCanvasResourceManager::BackgroundColor && onBackground)) {
setKoColor(v.value<KoColor>());
setColor(v.value<KoColor>());
}
}
......
......@@ -41,7 +41,7 @@ public:
void mouseReleaseEvent(QMouseEvent *);
public:
void setKoColor(const KoColor &color);
void setColor(const KoColor &color);
protected slots:
void canvasResourceChanged(int key, const QVariant& v);
......
......@@ -198,7 +198,7 @@ void ColorSelectorItem::geometryChanged(const QRectF& newGeometry, const QRectF&
}
if (d->view) {
d->selector->setKoColor(Acs::currentColor(d->view->resourceProvider(), d->colorRole));
d->selector->setColor(Acs::currentColor(d->view->resourceProvider(), d->colorRole));
}
d->repaintTimer->start();
......@@ -279,8 +279,8 @@ void ColorSelectorItem::setChangeBackground(bool newChangeBackground)
d->currentColor = Acs::currentColor(d->view->resourceProvider(), d->colorRole);
d->main->setKoColor(d->currentColor);
d->sub->setKoColor(d->currentColor);
d->main->setColor(d->currentColor);
d->sub->setColor(d->currentColor);
d->repaintTimer->start();
}
......@@ -312,8 +312,8 @@ void ColorSelectorItem::Private::colorChangedImpl(const KoColor &newColor, Acs::
if(newColor == currentColor) return;
currentColor = newColor;
main->setKoColor(newColor);
sub->setKoColor(newColor);
main->setColor(newColor);
sub->setColor(newColor);
commitColor(currentColor, colorRole);
QColor qcolor = selector->converter()->toQColor(currentColor);
emit q->colorChanged(qcolor, currentColor.opacityF(), false);
......
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