Commit a8832a6e authored by Boudewijn Rempt's avatar Boudewijn Rempt

Make it possible to hide the whitepoint cursor

parent 30a513fd
......@@ -51,6 +51,7 @@ KisGradientSlider::KisGradientSlider(QWidget *parent)
, m_white(255)
, m_gamma(1.0)
, m_gammaEnabled(false)
, m_whiteEnabled(true)
, m_feedback(false)
{
m_grabCursor = None;
......@@ -133,11 +134,13 @@ void KisGradientSlider::paintEvent(QPaintEvent *e)
p1.drawPolygon(a, 3);
}
a[0] = QPoint(m_whiteCursor - MARGIN, y);
a[1] = QPoint(m_whiteCursor - MARGIN + cursorHalfBase, wHeight - 1);
a[2] = QPoint(m_whiteCursor - MARGIN - cursorHalfBase, wHeight - 1);
p1.setBrush(Qt::white);
p1.drawPolygon(a, 3);
if (m_whiteEnabled) {
a[0] = QPoint(m_whiteCursor - MARGIN, y);
a[1] = QPoint(m_whiteCursor - MARGIN + cursorHalfBase, wHeight - 1);
a[2] = QPoint(m_whiteCursor - MARGIN - cursorHalfBase, wHeight - 1);
p1.setBrush(Qt::white);
p1.drawPolygon(a, 3);
}
}
void KisGradientSlider::resizeEvent(QResizeEvent *)
......@@ -331,6 +334,13 @@ double KisGradientSlider::getGamma(void)
return m_gamma;
}
void KisGradientSlider::enableWhite(bool b)
{
m_whiteEnabled = b;
update();
}
void KisGradientSlider::slotModifyBlack(int v)
{
if (v >= 0 && v <= (int)m_white && !m_feedback) {
......
......@@ -74,6 +74,8 @@ public:
void enableGamma(bool b);
double getGamma(void);
void enableWhite(bool b);
private:
int m_leftmost;
int m_rightmost;
......@@ -89,9 +91,8 @@ private:
double m_gamma;
bool m_gammaEnabled;
bool m_whiteEnabled;
bool m_feedback;
};
#endif /* KIS_GRADIENT_SLIDER_H */
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