D24865: [SystemTray] Support for AttentionIcon
Konrad Materka
noreply at phabricator.kde.org
Tue Oct 22 14:34:01 BST 2019
kmaterka added a comment.
In D24865#552202 <https://phabricator.kde.org/D24865#552202>, @broulik wrote:
> You might want to split that into a proper if statement otherwise it becomes somewhat hard to read. Something like
>
> source: {
> if (taskIcon.status === PlasmaCore.Types.NeedsAttentionStatus && (AttentionIcon || AttentionIconName)) {
> return AttentionIcon || AttentionIconName;
> }
> return Icon || IconName;
> }
>
The problem is that StatusNotifierItemSource always puts empty values for all elements. This is needed to initialize all roleNames (for QML delegate model etc). Anyway, it is always at least: "QVariant(QIcon, QIcon(null))".
In the situation when IconName was passed and not IconPixmap the check:
source: Icon ? Icon : IconName
worked because when there was no IconPixmap (="Icon"), then in StatusNotifierItemSource::refreshCallback Icon was loaded from IconName and replaced empty "Icon". In other works, this check was not needed in QML.
REPOSITORY
R120 Plasma Workspace
BRANCH
master
REVISION DETAIL
https://phabricator.kde.org/D24865
To: kmaterka, #plasma, broulik, #plasma_workspaces
Cc: lbeltrame, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20191022/0ddc9311/attachment-0001.html>
More information about the Plasma-devel
mailing list