81 |
81 |
82 m_scene->setSceneRect (sceneRect); |
82 m_scene->setSceneRect (sceneRect); |
83 ui->viewport->setSceneRect (sceneRect); |
83 ui->viewport->setSceneRect (sceneRect); |
84 |
84 |
85 const double penWidth = 1.0f; |
85 const double penWidth = 1.0f; |
86 QPen pen (Qt::black, penWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin); |
|
87 |
86 |
88 // Draw the color rectangles. |
87 // Draw the color rectangles. |
89 m_scene->clear(); |
88 m_scene->clear(); |
90 |
89 |
91 for (short i = 0; i < MAX_COLORS; ++i) { |
90 for (short i = 0; i < MAX_COLORS; ++i) { |
104 // Use the user preferences for main color here |
103 // Use the user preferences for main color here |
105 col = QColor (gl_maincolor); |
104 col = QColor (gl_maincolor); |
106 col.setAlpha (gl_maincolor_alpha * 255.0f); |
105 col.setAlpha (gl_maincolor_alpha * 255.0f); |
107 } |
106 } |
108 |
107 |
|
108 QPen pen (info->edgeColor, penWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin); |
109 m_scene->addRect (x, y, w, w, pen, col); |
109 m_scene->addRect (x, y, w, w, pen, col); |
110 QGraphicsTextItem* numtext = m_scene->addText (fmt ("%1", i)); |
110 QGraphicsTextItem* numtext = m_scene->addText (fmt ("%1", i)); |
111 numtext->setDefaultTextColor ( (luma (col) < 80) ? Qt::white : Qt::black); |
111 numtext->setDefaultTextColor ((luma (col) < 80) ? Qt::white : Qt::black); |
112 numtext->setPos (x, y); |
112 numtext->setPos (x, y); |
113 |
113 |
114 if (sel() && i == sel()->index) { |
114 if (sel() && i == sel()->index) { |
115 auto curspic = m_scene->addPixmap (getIcon ("colorcursor")); |
115 auto curspic = m_scene->addPixmap (getIcon ("colorcursor")); |
116 curspic->setPos (x, y); |
116 curspic->setPos (x, y); |