Color property drawing has been changed

This commit is contained in:
Arin Alexander 2018-03-29 23:18:15 +03:00
parent b65292dea8
commit 891622e2b3
2 changed files with 12 additions and 9 deletions

View File

@ -100,11 +100,12 @@ void ColorIndicator::paintEvent(QPaintEvent* event)
QPainter painter(this);
painter.save();
painter.setBrush(m_color);
painter.setPen(Qt::gray);
painter.setPen(Qt::transparent);
QRect rect = event->rect().adjusted(3,3,-4,-4);
rect.setWidth(rect.height());
painter.setRenderHint(QPainter::Antialiasing);
painter.drawEllipse(rect);
// painter.drawEllipse(rect);
painter.drawRoundedRect(rect,2,2);
painter.restore();
}

View File

@ -60,20 +60,22 @@ bool ColorPropItem::paint(QPainter *painter, const StyleOptionViewItem &option,
painter->save();
QPen pen;
if (option.state & QStyle::State_Selected){
pen.setWidth(2);
pen.setColor(option.palette.brightText().color());
}else {
pen.setColor(Qt::gray);
}
// if (option.state & QStyle::State_Selected){
// pen.setWidth(1);
// pen.setColor(option.palette.brightText().color());
// }else {
// pen.setColor(Qt::darkGray);
// }
pen.setColor(Qt::transparent);
painter->setPen(pen);
painter->setBrush(propertyValue().value<QColor>());
QRect rect = option.rect.adjusted(4,4,-4,-6);
rect.setWidth(rect.height());
painter->setRenderHint(QPainter::Antialiasing);
painter->drawEllipse(rect);
painter->drawRoundedRect(rect,2,2);
// painter->drawEllipse(rect);
painter->restore();
return true;
} else return false;