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

Add triangle and elliptical visual selectors and set default to ring+triangle

This is a bit finicky still. Also weird bugs with Qt cause flickering when changing widgets, due to having to force them to show. :/ Might need to think a bit longer about this...

Ref T2438
parent fd5f3a2d
......@@ -178,7 +178,6 @@ protected:
void mouseMoveEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void paintEvent(QPaintEvent*);
void resizeEvent(QResizeEvent *);
private:
struct Private;
const QScopedPointer<Private> m_d;
......@@ -258,4 +257,61 @@ private:
virtual void drawCursor();
};
class KisVisualEllipticalSelectorShape : public KisVisualColorSelectorShape
{
Q_OBJECT
public:
enum singelDTypes{border, borderMirrored};
explicit KisVisualEllipticalSelectorShape(QWidget *parent,
Dimensions dimension,
ColorModel model,
const KoColorSpace *cs,
int channel1, int channel2,
const KoColorDisplayRendererInterface *displayRenderer = KoDumbColorDisplayRenderer::instance(), int borwidth=20,
KisVisualEllipticalSelectorShape::singelDTypes d = KisVisualEllipticalSelectorShape::border
);
~KisVisualEllipticalSelectorShape();
void setBarWidth(int width);
private:
virtual QPointF convertShapeCoordinateToWidgetCoordinate(QPointF coordinate);
virtual QPointF convertWidgetCoordinateToShapeCoordinate(QPoint coordinate);
singelDTypes m_type;
int m_barWidth;
virtual QRegion getMaskMap();
virtual void drawCursor();
QSize sizeHint() const;
};
class KisVisualTriangleSelectorShape : public KisVisualColorSelectorShape
{
Q_OBJECT
public:
enum singelDTypes{border, borderMirrored};
explicit KisVisualTriangleSelectorShape(QWidget *parent,
Dimensions dimension,
ColorModel model,
const KoColorSpace *cs,
int channel1, int channel2,
const KoColorDisplayRendererInterface *displayRenderer = KoDumbColorDisplayRenderer::instance(),
int borwidth=20
);
~KisVisualTriangleSelectorShape();
void setBarWidth(int width);
void setTriangle();
QRect setGeometryByRadius(QLineF radius);
private:
virtual QPointF convertShapeCoordinateToWidgetCoordinate(QPointF coordinate);
virtual QPointF convertWidgetCoordinateToShapeCoordinate(QPoint coordinate);
singelDTypes m_type;
int m_barWidth;
QPolygon m_triangle;
virtual QRegion getMaskMap();
virtual void drawCursor();
};
#endif // KISVISUALCOLORSELECTOR_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