Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/NotificationIcon.qml
Show All 27 Lines | 27 | PlasmaCore.SvgItem { | |||
---|---|---|---|---|---|
28 | id: notificationSvgItem | 28 | id: notificationSvgItem | ||
29 | anchors.centerIn: parent | 29 | anchors.centerIn: parent | ||
30 | width: units.roundToIconSize(Math.min(parent.width, parent.height)) | 30 | width: units.roundToIconSize(Math.min(parent.width, parent.height)) | ||
31 | height: width | 31 | height: width | ||
32 | 32 | | |||
33 | svg: notificationSvg | 33 | svg: notificationSvg | ||
34 | 34 | | |||
35 | elementId: { | 35 | elementId: { | ||
36 | if (totalCount > 0) { | 36 | if (activeItemsCount > 0) { | ||
37 | if (jobs && jobs.count > 0) { | 37 | if (jobs && jobs.count > 0) { | ||
38 | return "notification-progress-inactive" | 38 | return "notification-progress-inactive" | ||
39 | } else { | 39 | } else { | ||
40 | return "notification-empty" | 40 | return "notification-empty" | ||
41 | } | 41 | } | ||
42 | } | 42 | } | ||
43 | return "notification-disabled" | 43 | return "notification-disabled" | ||
44 | } | 44 | } | ||
Show All 35 Lines | 79 | PlasmaComponents.BusyIndicator { | |||
80 | anchors.fill: parent | 80 | anchors.fill: parent | ||
81 | 81 | | |||
82 | visible: jobs ? jobs.count > 0 : false | 82 | visible: jobs ? jobs.count > 0 : false | ||
83 | running: visible | 83 | running: visible | ||
84 | } | 84 | } | ||
85 | 85 | | |||
86 | PlasmaComponents.Label { | 86 | PlasmaComponents.Label { | ||
87 | id: notificationCountLabel | 87 | id: notificationCountLabel | ||
88 | property int oldTotalCount: 0 | 88 | property int oldActiveItemsCount: 0 | ||
89 | 89 | | |||
90 | // anchors.fill: parent breaks at small sizes for some reason | 90 | // anchors.fill: parent breaks at small sizes for some reason | ||
91 | anchors.centerIn: parent | 91 | anchors.centerIn: parent | ||
92 | width: parent.width - (units.smallSpacing * 2.5 * text.length) | 92 | width: parent.width - (units.smallSpacing * 2.5 * text.length) | ||
93 | height: width | 93 | height: width | ||
94 | 94 | | |||
95 | horizontalAlignment: Text.AlignHCenter | 95 | horizontalAlignment: Text.AlignHCenter | ||
96 | verticalAlignment: Text.AlignVCenter | 96 | verticalAlignment: Text.AlignVCenter | ||
97 | text: notificationsApplet.totalCount | 97 | text: notificationsApplet.activeItemsCount | ||
98 | font.pointSize: 100 | 98 | font.pointSize: 100 | ||
99 | fontSizeMode: Text.Fit | 99 | fontSizeMode: Text.Fit | ||
100 | minimumPointSize: theme.smallestFont.pointSize | 100 | minimumPointSize: theme.smallestFont.pointSize | ||
101 | visible: notificationsApplet.totalCount > 0 | 101 | visible: notificationsApplet.activeItemsCount > 0 | ||
102 | 102 | | |||
103 | Connections { | 103 | Connections { | ||
104 | target: notificationsApplet | 104 | target: notificationsApplet | ||
105 | onTotalCountChanged: { | 105 | onActiveItemsCountChanged: { | ||
106 | if (notificationsApplet.totalCount > notificationCountLabel.oldTotalCount) { | 106 | if (notificationsApplet.activeItemsCount > notificationCountLabel.oldActiveItemsCount) { | ||
107 | notificationAnimation.running = true | 107 | notificationAnimation.running = true | ||
108 | } | 108 | } | ||
109 | notificationCountLabel.oldTotalCount = notificationsApplet.totalCount | 109 | notificationCountLabel.oldActiveItemsCount = notificationsApplet.activeItemsCount | ||
110 | } | 110 | } | ||
111 | 111 | | |||
112 | } | 112 | } | ||
113 | } | 113 | } | ||
114 | 114 | | |||
115 | PlasmaCore.SvgItem { | 115 | PlasmaCore.SvgItem { | ||
116 | id: notificationAnimatedItem | 116 | id: notificationAnimatedItem | ||
117 | anchors.fill: parent | 117 | anchors.fill: parent | ||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |