Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/global/Globals.qml
Show First 20 Lines • Show All 244 Lines • ▼ Show 20 Line(s) | 240 | for (var i = 0; i < popupInstantiator.count; ++i) { | |||
---|---|---|---|---|---|
245 | if (popupLocation & Qt.AlignHCenter) { | 245 | if (popupLocation & Qt.AlignHCenter) { | ||
246 | popup.x = x + (screenRect.width - popupEffectiveWidth) / 2; | 246 | popup.x = x + (screenRect.width - popupEffectiveWidth) / 2; | ||
247 | } else if (popupLocation & Qt.AlignRight) { | 247 | } else if (popupLocation & Qt.AlignRight) { | ||
248 | popup.x = x + screenRect.width - popupEdgeDistance - popupEffectiveWidth; | 248 | popup.x = x + screenRect.width - popupEdgeDistance - popupEffectiveWidth; | ||
249 | } else { | 249 | } else { | ||
250 | popup.x = x; | 250 | popup.x = x; | ||
251 | } | 251 | } | ||
252 | 252 | | |||
253 | // If the popup isn't ready yet, ignore its occupied space for now. | | |||
254 | // We'll reposition everything in onHeightChanged eventually. | | |||
255 | var delta = popup.height + (popup.height > 0 ? popupSpacing : 0); | | |||
256 | | ||||
257 | if (popupLocation & Qt.AlignTop) { | 253 | if (popupLocation & Qt.AlignTop) { | ||
258 | popup.y = y; | 254 | popup.y = y; | ||
259 | y += delta; | 255 | // If the popup isn't ready yet, ignore its occupied space for now. | ||
256 | // We'll reposition everything in onHeightChanged eventually. | ||||
257 | y += popup.height + (popup.height > 0 ? popupSpacing : 0); | ||||
260 | } else { | 258 | } else { | ||
261 | y -= delta; | 259 | y -= popup.height; | ||
262 | popup.y = y; | 260 | popup.y = y; | ||
261 | if (popup.height > 0) { | ||||
262 | y -= popupSpacing; | ||||
263 | } | ||||
263 | } | 264 | } | ||
264 | 265 | | |||
265 | // don't let notifications take more than popupMaximumScreenFill of the screen | 266 | // don't let notifications take more than popupMaximumScreenFill of the screen | ||
266 | var visible = true; | 267 | var visible = true; | ||
267 | if (i > 0) { // however always show at least one popup | 268 | if (i > 0) { // however always show at least one popup | ||
268 | if (popupLocation & Qt.AlignTop) { | 269 | if (popupLocation & Qt.AlignTop) { | ||
269 | visible = (popup.y + popup.height < screenRect.y + (screenRect.height * popupMaximumScreenFill)); | 270 | visible = (popup.y + popup.height < screenRect.y + (screenRect.height * popupMaximumScreenFill)); | ||
270 | } else { | 271 | } else { | ||
▲ Show 20 Lines • Show All 182 Lines • Show Last 20 Lines |