https://bugs.kde.org/show_bug.cgi?id=452884

--- Comment #2 from linx.system....@gmail.com ---
(In reply to Nate Graham from comment #1)
> Are you using a non-default color scheme or an edited version of one of the
> default color schemes?

I am using non-default color scheme, but it makes no difference. The issue
persist with default color scheme, just make sure that checkbox "Use different
colors for inactive selection" NOT checked. For example how it looks with
Breeze Light scheme: https://i.imgur.com/CBdHkGF.png
Also I noticed if you click on empty space in Dolphin Places panel then it will
use correct text color. But if you click on the files area then it will use
wrong text color.

After some digging I found possible source of the issue. In KIO
src/filewidgets/kfileplacesview.cpp starting from line 175:

    const bool selectedAndActive = (opt.state & QStyle::State_Selected) &&
(opt.state & QStyle::State_Active);
    QIcon::Mode mode = selectedAndActive ? QIcon::Selected : QIcon::Normal;
    QIcon icon = index.model()->data(index, Qt::DecorationRole).value<QIcon>();
    QPixmap pm = icon.pixmap(m_iconSize, m_iconSize, mode);
    QPoint point(isLTR ? opt.rect.left() + s_lateralMargin : opt.rect.right() -
s_lateralMargin - m_iconSize,
                 opt.rect.top() + (opt.rect.height() - m_iconSize) / 2);
    painter->drawPixmap(point, pm);

    if (!actionIcon.isNull()) {
        QPoint actionPos(isLTR ? opt.rect.right() - actionAreaWidth :
opt.rect.left() + s_lateralMargin,
                         opt.rect.top() + (opt.rect.height() -
actionIconSize()) / 2);
        QIcon::Mode actionMode = QIcon::Normal;
        if (selectedAndActive) {
            actionMode = QIcon::Selected;
        } else if (m_hoveredAction == index) {
            actionMode = QIcon::Active;
        }
        QPixmap actionPix = actionIcon.pixmap(actionIconSize(),
actionIconSize(), actionMode);
        painter->drawPixmap(actionPos, actionPix);
    }

    if (changePalette) {
        if (activePalette == QPalette()) {
            KIconLoader::global()->resetPalette();
        } else {
            KIconLoader::global()->setCustomPalette(activePalette);
        }
    }

    if (selectedAndActive) {
        painter->setPen(opt.palette.highlightedText().color());
    } else {
        painter->setPen(opt.palette.text().color());
    }

I'm not very good programmer, but it looks like that Places panel needs to be
active to use correct color, and when it loses focus it using wrong color.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to