improve background circle visual

pull/11/head
Michail Vourlakos 5 years ago
parent 4deaa3bc0b
commit 79936a662d

@ -122,12 +122,16 @@ void BackgroundCmbBox::paint(QPainter *painter, const QStyleOptionViewItem &opti
QString colorPath = backgroundStr.startsWith("/") ? backgroundStr : m_iconsPath + backgroundStr + "print.jpg"; QString colorPath = backgroundStr.startsWith("/") ? backgroundStr : m_iconsPath + backgroundStr + "print.jpg";
if (QFileInfo(colorPath).exists()) { if (QFileInfo(colorPath).exists()) {
bool isSelected{Latte::isSelected(option)};
QPalette::ColorRole textColorRole = isSelected ? QPalette::HighlightedText : QPalette::Text;
QPen pen; QPen pen;
QBrush colorBrush; QBrush colorBrush;
colorBrush.setTextureImage(QImage(colorPath)); colorBrush.setTextureImage(QImage(colorPath));
pen.setColor("black"); pen.setWidth(1);
pen.setColor(option.palette.color(Latte::colorGroup(option), textColorRole));
painter->setPen(pen); painter->setPen(pen);
painter->setBrush(colorBrush); painter->setBrush(colorBrush);

Loading…
Cancel
Save