Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/CompactRepresentation.qml
Show First 20 Lines • Show All 153 Lines • ▼ Show 20 Line(s) | 148 | State { // do not disturb | |||
---|---|---|---|---|---|
154 | } | 154 | } | ||
155 | PropertyChanges { | 155 | PropertyChanges { | ||
156 | target: notificationIcon | 156 | target: notificationIcon | ||
157 | scale: 0 | 157 | scale: 0 | ||
158 | opacity: 0 | 158 | opacity: 0 | ||
159 | } | 159 | } | ||
160 | }, | 160 | }, | ||
161 | State { // unread notifications | 161 | State { // unread notifications | ||
162 | name: "UNREAD" | ||||
162 | when: compactRoot.unreadCount > 0 | 163 | when: compactRoot.unreadCount > 0 | ||
163 | PropertyChanges { | 164 | PropertyChanges { | ||
164 | target: notificationIcon | 165 | target: notificationIcon | ||
165 | elementId: "notification-active" | 166 | elementId: "notification-active" | ||
166 | } | 167 | } | ||
167 | } | 168 | } | ||
168 | ] | 169 | ] | ||
169 | 170 | | |||
170 | transitions: [ | 171 | transitions: [ | ||
171 | Transition { | 172 | Transition { | ||
172 | to: "*" // any state | 173 | to: "*" // any state | ||
173 | NumberAnimation { | 174 | NumberAnimation { | ||
174 | targets: [notificationIcon, dndIcon] | 175 | targets: [notificationIcon, dndIcon] | ||
175 | properties: "opacity,scale" | 176 | properties: "opacity,scale" | ||
176 | duration: units.longDuration | 177 | duration: units.longDuration | ||
177 | easing.type: Easing.InOutQuad | 178 | easing.type: Easing.InOutQuad | ||
178 | } | 179 | } | ||
180 | }, | ||||
181 | Transition { | ||||
182 | from: "" | ||||
183 | to: "UNREAD" | ||||
184 | SequentialAnimation { | ||||
185 | RotationAnimation { | ||||
186 | target: notificationIcon | ||||
187 | to: 30 | ||||
188 | easing.type: Easing.InOutQuad | ||||
189 | duration: units.longDuration | ||||
190 | } | ||||
191 | RotationAnimation { | ||||
192 | target: notificationIcon | ||||
193 | to: -30 | ||||
194 | easing.type: Easing.InOutQuad | ||||
195 | duration: units.longDuration * 2 // twice the swing distance, keep speed uniform | ||||
196 | } | ||||
197 | RotationAnimation { | ||||
198 | target: notificationIcon | ||||
199 | to: 0 | ||||
200 | easing.type: Easing.InOutQuad | ||||
201 | duration: units.longDuration | ||||
202 | } | ||||
203 | } | ||||
179 | } | 204 | } | ||
180 | ] | 205 | ] | ||
181 | 206 | | |||
182 | } | 207 | } |