mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-01-11 20:31:04 +03:00
Color property drawing has been changed
This commit is contained in:
parent
b65292dea8
commit
891622e2b3
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user