Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/NotificationIcon.qml
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 69 | PlasmaComponents.BusyIndicator { | |||
---|---|---|---|---|---|
70 | anchors.fill: parent | 70 | anchors.fill: parent | ||
71 | 71 | | |||
72 | visible: jobs ? jobs.count > 0 : false | 72 | visible: jobs ? jobs.count > 0 : false | ||
73 | running: visible | 73 | running: visible | ||
74 | } | 74 | } | ||
75 | 75 | | |||
76 | PlasmaComponents.Label { | 76 | PlasmaComponents.Label { | ||
77 | id: notificationCountLabel | 77 | id: notificationCountLabel | ||
78 | property int oldTotalCount: 0 | 78 | property int oldActiveItemsCount: 0 | ||
79 | 79 | | |||
80 | // anchors.fill: parent breaks at small sizes for some reason | 80 | // anchors.fill: parent breaks at small sizes for some reason | ||
81 | anchors.centerIn: parent | 81 | anchors.centerIn: parent | ||
82 | width: parent.width - (units.smallSpacing * 2.5 * text.length) | 82 | width: parent.width - (units.smallSpacing * 2.5 * text.length) | ||
83 | height: width | 83 | height: width | ||
84 | 84 | | |||
85 | horizontalAlignment: Text.AlignHCenter | 85 | horizontalAlignment: Text.AlignHCenter | ||
86 | verticalAlignment: Text.AlignVCenter | 86 | verticalAlignment: Text.AlignVCenter | ||
87 | text: notificationsApplet.totalCount | 87 | text: notificationsApplet.activeItemsCount | ||
88 | font.pointSize: 100 | 88 | font.pointSize: 100 | ||
89 | fontSizeMode: Text.Fit | 89 | fontSizeMode: Text.Fit | ||
90 | minimumPointSize: theme.smallestFont.pointSize | 90 | minimumPointSize: theme.smallestFont.pointSize | ||
91 | visible: false | 91 | visible: false | ||
92 | 92 | | |||
93 | Connections { | 93 | Connections { | ||
94 | target: notificationsApplet | 94 | target: notificationsApplet | ||
95 | onTotalCountChanged: { | 95 | onActiveItemsCountChanged: { | ||
96 | if (notificationsApplet.totalCount > notificationCountLabel.oldTotalCount) { | 96 | if (notificationsApplet.activeItemsCount > notificationCountLabel.oldActiveItemsCount) { | ||
97 | notificationAnimation.running = true | 97 | notificationAnimation.running = true | ||
98 | } | 98 | } | ||
99 | notificationCountLabel.oldTotalCount = notificationsApplet.totalCount | 99 | notificationCountLabel.oldActiveItemsCount = notificationsApplet.activeItemsCount | ||
100 | } | 100 | } | ||
101 | 101 | | |||
102 | } | 102 | } | ||
103 | } | 103 | } | ||
104 | 104 | | |||
105 | PlasmaCore.SvgItem { | 105 | PlasmaCore.SvgItem { | ||
106 | id: notificationAnimatedItem | 106 | id: notificationAnimatedItem | ||
107 | anchors.fill: parent | 107 | anchors.fill: parent | ||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |