Commit 65f3a961 authored by Pino Toscano's avatar Pino Toscano

StatusItemNotifier: fix overlays by name with icons by name

Summary:
Setting an overlay by name results in a QIcon for it created; OTOH,
this icon is never used to create the final image in case the
main/attention icons are set by name too.

Since KIconEngine supports overlays natively, directly pass the list of
overlays (with just one element -- the overlay set) to it.  As result,
main/attention icons by name are created directly with the requested
overlay by name.

Test Plan:
- builds fine
- main/attention icon by name + overlay by name works now, showing the requested overlay
- main/attention icon by name + overlay by pixmap still works as before
- main/attention icon by pixmap is unaffected, no matter whether/which overlay is set
- the system tray icons of juk, and amarok now have the play/pause overlays

Reviewers: apol

Reviewed By: apol

Subscribers: davidedmundson, apol, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D17983
parent 91633c6c
......@@ -291,7 +291,7 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call)
if (image.isEmpty()) {
iconName = properties[QStringLiteral("IconName")].toString();
if (!iconName.isEmpty()) {
icon = QIcon(new KIconEngine(iconName, iconLoader()));
icon = QIcon(new KIconEngine(iconName, iconLoader(), overlayNames));
if (overlayNames.isEmpty() && !overlay.isNull()) {
overlayIcon(&icon, &overlay);
......@@ -317,7 +317,7 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call)
QString iconName = properties[QStringLiteral("AttentionIconName")].toString();
setData(QStringLiteral("AttentionIconName"), iconName);
if (!iconName.isEmpty()) {
attentionIcon = QIcon(new KIconEngine(iconName, iconLoader()));
attentionIcon = QIcon(new KIconEngine(iconName, iconLoader(), overlayNames));
if (overlayNames.isEmpty() && !overlay.isNull()) {
overlayIcon(&attentionIcon, &overlay);
......
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