41 // ============================================================================= |
41 // ============================================================================= |
42 // ============================================================================= |
42 // ============================================================================= |
43 ColorSelector::ColorSelector (int defval, QWidget* parent) : QDialog (parent) |
43 ColorSelector::ColorSelector (int defval, QWidget* parent) : QDialog (parent) |
44 { |
44 { |
45 // Remove the default color if it's invalid |
45 // Remove the default color if it's invalid |
46 if (!getColor (defval)) |
46 if (not getColor (defval)) |
47 defval = -1; |
47 defval = -1; |
48 |
48 |
49 m_firstResize = true; |
49 m_firstResize = true; |
50 ui = new Ui_ColorSelUI; |
50 ui = new Ui_ColorSelUI; |
51 ui->setupUi (this); |
51 ui->setupUi (this); |
91 |
91 |
92 for (int i = 0; i < MAX_COLORS; ++i) |
92 for (int i = 0; i < MAX_COLORS; ++i) |
93 { |
93 { |
94 LDColor* info = ::getColor (i); |
94 LDColor* info = ::getColor (i); |
95 |
95 |
96 if (!info) |
96 if (not info) |
97 continue; |
97 continue; |
98 |
98 |
99 const double x = (i % numCols) * square; |
99 const double x = (i % numCols) * square; |
100 const double y = (i / numCols) * square; |
100 const double y = (i / numCols) * square; |
101 const double w = square - (penWidth / 2); |
101 const double w = square - (penWidth / 2); |