diff --git a/applets/notifications/package/contents/ui/NotificationIcon.qml b/applets/notifications/package/contents/ui/NotificationIcon.qml --- a/applets/notifications/package/contents/ui/NotificationIcon.qml +++ b/applets/notifications/package/contents/ui/NotificationIcon.qml @@ -31,7 +31,17 @@ height: width svg: notificationSvg - elementId: "notification-disabled" + + elementId: { + if (totalCount > 0) { + if (jobs && jobs.count > 0) { + return "notification-progress-inactive" + } else { + return "notification-empty" + } + } + return "notification-disabled" + } state: notificationsApplet.state @@ -88,7 +98,7 @@ font.pointSize: 100 fontSizeMode: Text.Fit minimumPointSize: theme.smallestFont.pointSize - visible: false + visible: notificationsApplet.totalCount > 0 Connections { target: notificationsApplet @@ -151,39 +161,5 @@ onPressed: wasExpanded = plasmoid.expanded onClicked: plasmoid.expanded = !wasExpanded } - - states: [ - State { - name: "default" - PropertyChanges { - target: notificationSvgItem - elementId: "notification-disabled" - } - PropertyChanges { - target: notificationCountLabel - visible: false - } - PropertyChanges { - target: plasmoid - status: PlasmaCore.Types.PassiveStatus - } - }, - - State { - name: "new-notifications" - PropertyChanges { - target: notificationSvgItem - elementId: jobs.count > 0 ? "notification-progress-inactive" : "notification-empty" - } - PropertyChanges { - target: notificationCountLabel - visible: true - } - PropertyChanges { - target: plasmoid - status: PlasmaCore.Types.ActiveStatus - } - } - ] } } diff --git a/applets/notifications/package/contents/ui/main.qml b/applets/notifications/package/contents/ui/main.qml --- a/applets/notifications/package/contents/ui/main.qml +++ b/applets/notifications/package/contents/ui/main.qml @@ -88,16 +88,10 @@ } } - state: "default" hoverEnabled: !UiProperties.touchInput onTotalCountChanged: { - print(" totalCountChanged " + totalCount) - if (totalCount > 0) { - state = "new-notifications" - } else { - state = "default" - //plasmoid.hidePopup() + if (!totalCount) { plasmoid.expanded = false; } }