Commit 6c3cceb8 authored by Ivan Yossi's avatar Ivan Yossi 👌

Changed composite for preset selection. This makes the selected

preset, brush tip and reference image, much more easier to spot

REVIEW:118599
parent b8fd8168
......@@ -103,6 +103,10 @@ void ImageItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
if(isSelected())
{
painter->setCompositionMode(QPainter::CompositionMode_HardLight);
painter->setOpacity(0.50);
painter->fillRect(boundingRect().toRect(), palette().color(QPalette::Active, QPalette::Highlight));
painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
QPen pen(palette().color(QPalette::Active, QPalette::Highlight), 3);
painter->setPen(pen);
}
......
......@@ -83,6 +83,9 @@ void KisBrushDelegate::paint(QPainter * painter, const QStyleOptionViewItem & op
if (option.state & QStyle::State_Selected) {
painter->setPen(QPen(option.palette.highlight(), 2.0));
painter->drawRect(option.rect);
painter->setCompositionMode(QPainter::CompositionMode_HardLight);
painter->setOpacity(0.65);
painter->fillRect(option.rect, option.palette.highlight());
}
painter->restore();
......
......@@ -77,21 +77,13 @@ void KisPresetDelegate::paint(QPainter * painter, const QStyleOptionViewItem & o
KisPaintOpPreset* preset = static_cast<KisPaintOpPreset*>(index.internalPointer());
if (option.state & QStyle::State_Selected) {
painter->setPen(QPen(option.palette.highlightedText(), 2.0));
painter->fillRect(option.rect, option.palette.highlight());
} else {
painter->setPen(QPen(option.palette.text(), 2.0));
}
QImage preview = preset->image();
if(preview.isNull()) {
return;
}
QRect paintRect = option.rect.adjusted(2, 2, -2, -2);
QRect paintRect = option.rect.adjusted(1, 1, -1, -1);
if (!m_showText) {
painter->drawImage(paintRect.x(), paintRect.y(),
preview.scaled(paintRect.size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
......@@ -108,7 +100,8 @@ void KisPresetDelegate::paint(QPainter * painter, const QStyleOptionViewItem & o
icon.paint(painter, QRect(paintRect.x() + paintRect.height() - 25, paintRect.y() + paintRect.height() - 25, 25, 25));
}
if (option.state & QStyle::State_Selected) {
painter->setOpacity(0.25);
painter->setCompositionMode(QPainter::CompositionMode_HardLight);
painter->setOpacity(0.65);
painter->fillRect(option.rect, option.palette.highlight());
}
painter->restore();
......
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