From 121eda16596056698cefae24e8af0e7d4be246f2 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <Thomas.Hartmann@nokia.com> Date: Tue, 2 Mar 2010 10:22:32 +0100 Subject: [PATCH] QmlDesigner.propertyEditor: add borders to color widgets --- .../components/propertyeditor/colorwidget.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp b/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp index 108f25fad5a..391ec439d58 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp @@ -98,14 +98,14 @@ namespace QmlDesigner { QPainter p(this); - int height = 120; + int localHeight = 120; if (m_cache.isNull()) { - m_cache = QPixmap(10, height); + m_cache = QPixmap(10, localHeight); QPainter cacheP(&m_cache); - for (int i = 0; i < height; i++) + for (int i = 0; i < localHeight; i++) { QColor c; c.setHsv( (i*359) / 120.0, 255,255); @@ -123,6 +123,10 @@ namespace QmlDesigner { points.append(QPointF(25, y + 5)); points.append(QPointF(25, y - 5)); + p.setPen(Qt::black); + p.setBrush(Qt::NoBrush); + p.drawRect(QRect(0, 0, width() - 1, height() - 1).adjusted(8, 4, -18, -4)); + p.setPen(Qt::black); p.setBrush(QColor("#707070")); p.drawPolygon(points); @@ -185,6 +189,9 @@ namespace QmlDesigner { p.setPen(Qt::white); p.drawEllipse(x - 2, y - 2, 4, 4); + + p.setPen(Qt::black); + p.drawRect(QRect(0, 0, width() - 1, height() -1).adjusted(4, 4, -4, -4)); } } -- GitLab