when the tooltips are dark, monochrome icons can be black on black
use kiconloader with a custom palette to color any eventual monochrome icon
Details
- Reviewers
sitter - Group Reviewers
Plasma - Commits
- R102:23fa36983170: color monochrome icons to tooltip colors
monochrome icons appear white
Diff Detail
- Repository
- R102 KInfoCenter
- Branch
- phab/iconColor
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 9499 Build 9517: arc lint + arc unit
That seems to break the category icons because KDE::icon(menuItem->kcm().icon() is only working on Kcm entries, while KcmCategory entries overload ::icon with divergent behavior.
I think what we need is to change KcmTreeItem::icon() (and its derived class KcmCategoryItem) to QString KcmTreeItem::iconName() and use that on the KDE::icon call. And InfoKcmModel::data needs changing to QIcon::fromTheme(item->iconName()) I guess.
Sweet, could you do the same thing for System Settings' tooltip too? It's a fork of this code (or maybe the reverse is true).
hmm, not sure?
that ::icon() call would be used also on the main view, in which you need *not* to change the colors
The sidepanel (which I guess is the mainview) gets the icon from InfoKcmModel::data from what I can tell. ::data and ::generateToolTipLine are the only places where I see ::icon get called. So what I am thinking is these changes:
::icon goes away in favor of
QString KcmTreeItem::iconName() { return m_kcm.icon() }
and
QString KcmCategoryItem::iconName() { return m_category.icon() }
and the model creates a regular unaltered QIcon
QVariant InfoKcmModel::data(const QModelIndex &index, int role) const { ... case Qt::DecorationRole: return QIcon::fromTheme(item->iconName()); ... }
What's the need for this wrapper class rather than just making the KIconLoader global static?
Following Kai's question... wouldn't KIconLoader::global make the entire static obsolete?
we need a second one, not the one used by the app, because we are altering how it colores the icons
Nice! Would you mind doing the same for System Settings, which has the same code?
Dolphin's Tooltip could use the same treatment too, see https://bugs.kde.org/show_bug.cgi?id=404858