8 |
8 |
9 class ColorSelectDialog : public QDialog |
9 class ColorSelectDialog : public QDialog |
10 { |
10 { |
11 Q_OBJECT |
11 Q_OBJECT |
12 public: |
12 public: |
13 explicit ColorSelectDialog(const ldraw::ColorTable& colorTable, QWidget* parent = nullptr); |
13 explicit ColorSelectDialog(const ColorTable& colorTable, QWidget* parent = nullptr); |
14 ~ColorSelectDialog(); |
14 ~ColorSelectDialog(); |
15 void setCurrentColor(ldraw::Color color); |
15 void setCurrentColor(ColorIndex color); |
16 ldraw::Color currentColor() const; |
16 ldraw::Color currentColor() const; |
17 private Q_SLOTS: |
17 private Q_SLOTS: |
18 void populateColors(); |
18 void populateColors(); |
19 void updateSelectedColorTexts(); |
19 void updateSelectedColorTexts(); |
20 void handleButtonClick(); |
20 void handleButtonClick(); |
22 void chooseDirectColor(); |
22 void chooseDirectColor(); |
23 private: |
23 private: |
24 void makeColorButtons(); |
24 void makeColorButtons(); |
25 bool filterColor(ldraw::Color color) const; |
25 bool filterColor(ldraw::Color color) const; |
26 class Ui_ColorSelectDialog& ui; |
26 class Ui_ColorSelectDialog& ui; |
27 const ldraw::ColorTable& colorTable; |
27 const ColorTable& colorTable; |
28 std::vector<QPushButton*> buttons; |
28 std::vector<QPushButton*> buttons; |
29 ldraw::Color selectedColor = ldraw::MAIN_COLOR; |
29 ColorIndex selectedColor = MAIN_COLOR; |
30 }; |
30 }; |