--- a/src/colorSelector.h Thu Jun 05 23:18:13 2014 +0300 +++ b/src/colorSelector.h Sat Jun 14 09:05:29 2014 +0300 @@ -19,32 +19,37 @@ #pragma once #include <QDialog> #include "main.h" +#include "colors.h" -class LDColor; class Ui_ColorSelUI; class QGraphicsScene; class ColorSelector : public QDialog { Q_OBJECT - PROPERTY (private, LDColor*, selection, setSelection, STOCK_WRITE) + PROPERTY (private, LDColor, selection, setSelection, STOCK_WRITE) public: - explicit ColorSelector (int defval = -1, QWidget* parent = null); + explicit ColorSelector (LDColor defval = null, QWidget* parent = null); virtual ~ColorSelector(); - static bool selectColor (int& val, int defval = -1, QWidget* parent = null); + static bool selectColor (LDColor& val, LDColor defval = null, QWidget* parent = null); protected: void mousePressEvent (QMouseEvent* event); void resizeEvent (QResizeEvent* ev); private: - Ui_ColorSelUI* ui; - QGraphicsScene* m_scene; - bool m_firstResize; + Ui_ColorSelUI* ui; + QGraphicsScene* m_scene; + bool m_firstResize; int numRows() const; int viewportWidth() const; void drawScene(); void drawColorInfo(); + void selectDirectColor (QColor col); + +private slots: + void chooseDirectColor(); + void transparentCheckboxClicked(); };