|
|
|
@ -287,16 +287,17 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call) |
|
|
|
QIcon overlay; |
|
|
|
QIcon overlay; |
|
|
|
QStringList overlayNames; |
|
|
|
QStringList overlayNames; |
|
|
|
|
|
|
|
|
|
|
|
// Icon
|
|
|
|
// Overlay icon
|
|
|
|
{ |
|
|
|
{ |
|
|
|
QIcon icon; |
|
|
|
m_overlayIconName = QString(); |
|
|
|
QString iconName; |
|
|
|
|
|
|
|
|
|
|
|
const QString iconName = properties[QStringLiteral("OverlayIconName")].toString(); |
|
|
|
// Prefer icon over pixmap. If the icon is unavailable fallback to pixmap.
|
|
|
|
if (!iconName.isEmpty()) { |
|
|
|
m_overlayIconName = properties[QStringLiteral("OverlayIconName")].toString(); |
|
|
|
overlay = QIcon(new KIconEngine(iconName, iconLoader())); |
|
|
|
if (!m_overlayIconName.isEmpty()) { |
|
|
|
if (!overlay.isNull()) { |
|
|
|
overlayNames << m_overlayIconName; |
|
|
|
m_overlayIconName = iconName; |
|
|
|
overlay = QIcon(new KIconEngine(m_overlayIconName, iconLoader())); |
|
|
|
overlayNames << iconName; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (overlay.isNull()) { |
|
|
|
if (overlay.isNull()) { |
|
|
|
KDbusImageVector image; |
|
|
|
KDbusImageVector image; |
|
|
|
@ -305,53 +306,60 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call) |
|
|
|
overlay = imageVectorToPixmap(image); |
|
|
|
overlay = imageVectorToPixmap(image); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Prefer icon over pixmap. If the icon is unavailable fallback to pixmap.
|
|
|
|
// Icon
|
|
|
|
iconName = properties[QStringLiteral("IconName")].toString(); |
|
|
|
{ |
|
|
|
|
|
|
|
m_icon = QIcon(); |
|
|
|
|
|
|
|
m_iconName = QString(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QString iconName = properties[QStringLiteral("IconName")].toString(); |
|
|
|
if (!iconName.isEmpty()) { |
|
|
|
if (!iconName.isEmpty()) { |
|
|
|
icon = QIcon(new KIconEngine(iconName, iconLoader(), overlayNames)); |
|
|
|
m_icon = QIcon(new KIconEngine(iconName, iconLoader(), overlayNames)); |
|
|
|
if (!icon.isNull() && !overlay.isNull() && overlayNames.isEmpty()) { |
|
|
|
if (!m_icon.isNull()) { |
|
|
|
overlayIcon(&icon, &overlay); |
|
|
|
m_iconName = iconName; |
|
|
|
|
|
|
|
if (!overlay.isNull() && overlayNames.isEmpty()) { |
|
|
|
|
|
|
|
overlayIcon(&m_icon, &overlay); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (icon.isNull()) { |
|
|
|
if (m_icon.isNull()) { |
|
|
|
KDbusImageVector image; |
|
|
|
KDbusImageVector image; |
|
|
|
properties[QStringLiteral("IconPixmap")].value<QDBusArgument>() >> image; |
|
|
|
properties[QStringLiteral("IconPixmap")].value<QDBusArgument>() >> image; |
|
|
|
if (!image.isEmpty()) { |
|
|
|
if (!image.isEmpty()) { |
|
|
|
icon = imageVectorToPixmap(image); |
|
|
|
m_icon = imageVectorToPixmap(image); |
|
|
|
if (!icon.isNull() && !overlay.isNull()) { |
|
|
|
if (!m_icon.isNull() && !overlay.isNull()) { |
|
|
|
overlayIcon(&icon, &overlay); |
|
|
|
overlayIcon(&m_icon, &overlay); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
m_icon = icon; |
|
|
|
|
|
|
|
m_iconName = iconName; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Attention icon
|
|
|
|
// Attention icon
|
|
|
|
{ |
|
|
|
{ |
|
|
|
QIcon attentionIcon; |
|
|
|
m_attentionIcon = QIcon(); |
|
|
|
|
|
|
|
m_attentionIconName = QString(); |
|
|
|
|
|
|
|
|
|
|
|
m_attentionIconName = properties[QStringLiteral("AttentionIconName")].toString(); |
|
|
|
const QString iconName = properties[QStringLiteral("AttentionIconName")].toString(); |
|
|
|
if (!m_attentionIconName.isEmpty()) { |
|
|
|
if (!iconName.isEmpty()) { |
|
|
|
attentionIcon = QIcon(new KIconEngine(m_attentionIconName, iconLoader(), overlayNames)); |
|
|
|
m_attentionIcon = QIcon(new KIconEngine(iconName, iconLoader(), overlayNames)); |
|
|
|
if (!attentionIcon.isNull() && !overlay.isNull() && overlayNames.isEmpty()) { |
|
|
|
if (!m_attentionIcon.isNull()) { |
|
|
|
overlayIcon(&attentionIcon, &overlay); |
|
|
|
m_attentionIconName = iconName; |
|
|
|
|
|
|
|
if (!overlay.isNull() && overlayNames.isEmpty()) { |
|
|
|
|
|
|
|
overlayIcon(&m_attentionIcon, &overlay); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (attentionIcon.isNull()) { |
|
|
|
if (m_attentionIcon.isNull()) { |
|
|
|
KDbusImageVector image; |
|
|
|
KDbusImageVector image; |
|
|
|
properties[QStringLiteral("AttentionIconPixmap")].value<QDBusArgument>() >> image; |
|
|
|
properties[QStringLiteral("AttentionIconPixmap")].value<QDBusArgument>() >> image; |
|
|
|
if (!image.isEmpty()) { |
|
|
|
if (!image.isEmpty()) { |
|
|
|
attentionIcon = imageVectorToPixmap(image); |
|
|
|
m_attentionIcon = imageVectorToPixmap(image); |
|
|
|
if (!attentionIcon.isNull() && !overlay.isNull()) { |
|
|
|
if (!m_attentionIcon.isNull() && !overlay.isNull()) { |
|
|
|
overlayIcon(&attentionIcon, &overlay); |
|
|
|
overlayIcon(&m_attentionIcon, &overlay); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
m_attentionIcon = attentionIcon; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ToolTip
|
|
|
|
// ToolTip
|
|
|
|
|