Commit 12799aca authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Make mouse press event select a color too.

Also speed up the timers a little bit.
parent b97cef85
...@@ -227,8 +227,8 @@ KisVisualColorSelectorShape::KisVisualColorSelectorShape(QWidget *parent, ...@@ -227,8 +227,8 @@ KisVisualColorSelectorShape::KisVisualColorSelectorShape(QWidget *parent,
m_d->channel1 = qBound(0, channel1, maxchannel); m_d->channel1 = qBound(0, channel1, maxchannel);
m_d->channel2 = qBound(0, channel2, maxchannel); m_d->channel2 = qBound(0, channel2, maxchannel);
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_d->updateTimer = new KisSignalCompressor(100 /* ms */, KisSignalCompressor::POSTPONE, this); m_d->updateTimer = new KisSignalCompressor(30 /* ms */, KisSignalCompressor::POSTPONE, this);
m_d->siblingTimer = new KisSignalCompressor(100 /* ms */, KisSignalCompressor::POSTPONE, this); m_d->siblingTimer = new KisSignalCompressor(30 /* ms */, KisSignalCompressor::POSTPONE, this);
setDisplayRenderer(displayRenderer); setDisplayRenderer(displayRenderer);
show(); show();
...@@ -556,6 +556,11 @@ QVector<qreal> KisVisualColorSelectorShape::convertvectorfloatToqreal(QVector <f ...@@ -556,6 +556,11 @@ QVector<qreal> KisVisualColorSelectorShape::convertvectorfloatToqreal(QVector <f
void KisVisualColorSelectorShape::mousePressEvent(QMouseEvent *e) void KisVisualColorSelectorShape::mousePressEvent(QMouseEvent *e)
{ {
m_d->mousePressActive = true; m_d->mousePressActive = true;
QPointF coordinates = convertWidgetCoordinateToShapeCoordinate(e->pos());
KoColor col = convertShapeCoordinateToKoColor(coordinates);
setColor(col);
Q_EMIT sigNewColor(col);
m_d->updateTimer->start();
} }
void KisVisualColorSelectorShape::mouseMoveEvent(QMouseEvent *e) void KisVisualColorSelectorShape::mouseMoveEvent(QMouseEvent *e)
......
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