Commit 2d7b6c23 authored by Konrad Materka's avatar Konrad Materka
Browse files

[SystemTray] Support for AttentionIcon

Summary:
Adding support for Attention Icon to StatusNotifier tray icons.
Binding is working correctly only when "Status" is used, not derived "status".

BUG: 341255

Test Plan: As described in bug report, Konversation can be used for tests.

Reviewers: #plasma, broulik, #plasma_workspaces

Reviewed By: #plasma, broulik, #plasma_workspaces

Subscribers: lbeltrame, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24865
parent a1404ce2
......@@ -43,16 +43,22 @@ AbstractItem {
}
}
onStatusChanged: {
//binding is not working in PlasmaCore.IconItem
iconItem.source = status === PlasmaCore.Types.NeedsAttentionStatus ? (AttentionIcon ? AttentionIcon : AttentionIconName) : (Icon ? Icon : IconName)
}
iconItem: iconItem
PlasmaCore.IconItem {
id: iconItem
source: Icon ? Icon : IconName
source: {
if (taskIcon.status === PlasmaCore.Types.NeedsAttentionStatus) {
if (AttentionIcon) {
return AttentionIcon
}
if (AttentionIconName) {
return AttentionIconName
}
}
return Icon ? Icon : IconName
}
width: Math.min(parent.width, parent.height)
height: width
active: taskIcon.containsMouse
......
......@@ -303,7 +303,7 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call)
overlayIcon(&icon, &overlay);
}
}
setData(QStringLiteral("Icon"), icon);
setData(QStringLiteral("Icon"), icon.isNull() ? QVariant() : icon);
setData(QStringLiteral("IconName"), iconName);
}
......@@ -329,7 +329,7 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call)
overlayIcon(&attentionIcon, &overlay);
}
}
setData(QStringLiteral("AttentionIcon"), attentionIcon);
setData(QStringLiteral("AttentionIcon"), attentionIcon.isNull() ? QVariant() : attentionIcon);
}
//ToolTip
......
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