From 89f1f1a8af0552784cee7d51655a3f5a54fa29f8 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 4 Sep 2017 14:16:51 +0200 Subject: [PATCH] notifications count in the compact representation --- applets/notifications/contents/ui/main.qml | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/applets/notifications/contents/ui/main.qml b/applets/notifications/contents/ui/main.qml index 713810e6..8b501e48 100644 --- a/applets/notifications/contents/ui/main.qml +++ b/applets/notifications/contents/ui/main.qml @@ -129,10 +129,35 @@ Item { text: i18n("No recent notifications") } + Plasmoid.compactRepresentation: PlasmaCore.SvgItem { + id: notificationSvgItem + anchors.centerIn: parent + width: units.roundToIconSize(Math.min(parent.width, parent.height)) + height: width + + svg: PlasmaCore.Svg { + imagePath: "icons/notification" + colorGroup: PlasmaCore.ColorScope.colorGroup + } + + elementId: { + if (notificationsModel.count > 0) { + return "notification-empty" + } + return "notification-disabled" + } + PlasmaComponents.Label { + anchors.fill: parent + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + visible: notificationsModel.count > 0 + text: notificationsModel.count + } + } ListModel { id: notificationsModel - /* ListElement { + /* ListElement { source: "call1Source" appIcon: "call-start" summary: "Missed call from Joe"