24 class ColorSelector : public QDialog, public HierarchyElement |
24 class ColorSelector : public QDialog, public HierarchyElement |
25 { |
25 { |
26 Q_OBJECT |
26 Q_OBJECT |
27 |
27 |
28 public: |
28 public: |
29 explicit ColorSelector (QWidget* parent, LDColor defaultvalue = LDColor::nullColor()); |
29 explicit ColorSelector(QWidget* parent, LDColor defaultvalue = LDColor::nullColor()); |
30 virtual ~ColorSelector(); |
30 virtual ~ColorSelector(); |
31 static bool selectColor (QWidget* parent, LDColor& val, LDColor defval = LDColor::nullColor()); |
31 static bool selectColor(QWidget* parent, LDColor& val, LDColor defval = LDColor::nullColor()); |
32 LDColor selection() const; |
32 LDColor selection() const; |
33 |
33 |
34 private: |
34 private: |
35 class Ui_ColorSelUi& ui; |
35 class Ui_ColorSelUi& ui; |
36 QMap<int, QPushButton*> m_buttons; |
36 QMap<int, QPushButton*> m_buttons; |
37 QMap<QPushButton*, int> m_buttonsReversed; |
37 QMap<QPushButton*, int> m_buttonsReversed; |
38 bool m_firstResize; |
38 bool m_firstResize; |
39 LDColor m_selection; |
39 LDColor m_selection; |
40 |
40 |
41 void drawColorInfo(); |
41 void drawColorInfo(); |
42 void selectDirectColor (QColor col); |
42 void selectDirectColor(QColor col); |
43 |
43 |
44 private slots: |
44 private slots: |
45 void colorButtonClicked(); |
45 void colorButtonClicked(); |
46 void chooseDirectColor(); |
46 void chooseDirectColor(); |
47 void transparentCheckboxClicked(); |
47 void transparentCheckboxClicked(); |