Commit 18f95431 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.colorWidget: improve visuals of GradientLine

parent 9b43909a
......@@ -599,10 +599,15 @@ void GradientLine::paintEvent(QPaintEvent *event)
{
QWidget::paintEvent(event);
if (!isEnabled())
return;
QPainter p(this);
if (!isEnabled()) {
p.setBrush(Qt::NoBrush);
p.setPen(QColor(0x444444));
p.drawRect(9, 31, width() - 14, height() - 32);
p.drawTiledPixmap(10, 32, width() - 16, height() - 34, tilePixMap(8));
} else {
QLinearGradient linearGradient(QPointF(0, 0), QPointF(width(), 0));
......@@ -647,13 +652,16 @@ void GradientLine::paintEvent(QPaintEvent *event)
p.setBrush(Qt::NoBrush);
p.setPen(QColor(0x424242));
p.drawRect(pos - 4, 9 + localYOffset, 10, 11);
p.setPen(QColor(0x141414));
p.drawTiledPixmap(pos - 4, 9 + localYOffset, 9, 10, tilePixMap(5));
p.setPen(QColor(0x424242));
p.setBrush(m_colorList.at(i));
p.drawRect(pos - 5, 8 + localYOffset, 10, 11);
p.setBrush(Qt::NoBrush);
p.setPen(QColor(255, 255, 255, 30));
p.drawRect(pos - 4, 9 + localYOffset, 8, 9);
}
}
}
void GradientLine::mousePressEvent(QMouseEvent *event)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment