1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 13:33:50 +03:00

improve background circle visual

This commit is contained in:
Michail Vourlakos 2020-03-16 13:31:53 +02:00
parent 4deaa3bc0b
commit 79936a662d

View File

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