Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/global/Globals.qml
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Line(s) | 122 | case NotificationManager.Settings.BottomCenter: | |||
---|---|---|---|---|---|
123 | return Qt.AlignBottom | Qt.AlignHCenter; | 123 | return Qt.AlignBottom | Qt.AlignHCenter; | ||
124 | case NotificationManager.Settings.BottomRight: | 124 | case NotificationManager.Settings.BottomRight: | ||
125 | return Qt.AlignBottom | Qt.AlignRight; | 125 | return Qt.AlignBottom | Qt.AlignRight; | ||
126 | } | 126 | } | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | // The raw width of the popup's content item, the Dialog itself adds some margins | 129 | // The raw width of the popup's content item, the Dialog itself adds some margins | ||
130 | property int popupWidth: units.gridUnit * 18 | 130 | property int popupWidth: units.gridUnit * 18 | ||
131 | property int popupEdgeDistance: units.largeSpacing | 131 | property int popupEdgeDistance: units.largeSpacing * 2 | ||
132 | property int popupSpacing: units.largeSpacing | 132 | property int popupSpacing: units.largeSpacing | ||
133 | 133 | | |||
134 | // How much vertical screen real estate the notification popups may consume | 134 | // How much vertical screen real estate the notification popups may consume | ||
135 | readonly property real popupMaximumScreenFill: 0.75 | 135 | readonly property real popupMaximumScreenFill: 0.75 | ||
136 | 136 | | |||
137 | onPopupLocationChanged: Qt.callLater(positionPopups) | 137 | onPopupLocationChanged: Qt.callLater(positionPopups) | ||
138 | 138 | | |||
139 | Component.onCompleted: checkInhibition() | 139 | Component.onCompleted: checkInhibition() | ||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 220 | var screenRect = Qt.rect(plasmoid.screenGeometry.x + plasmoid.availableScreenRect.x, | |||
222 | plasmoid.availableScreenRect.width, | 222 | plasmoid.availableScreenRect.width, | ||
223 | plasmoid.availableScreenRect.height); | 223 | plasmoid.availableScreenRect.height); | ||
224 | if (screenRect.width <= 0 || screenRect.height <= 0) { | 224 | if (screenRect.width <= 0 || screenRect.height <= 0) { | ||
225 | return; | 225 | return; | ||
226 | } | 226 | } | ||
227 | 227 | | |||
228 | var y = screenRect.y; | 228 | var y = screenRect.y; | ||
229 | if (popupLocation & Qt.AlignBottom) { | 229 | if (popupLocation & Qt.AlignBottom) { | ||
230 | y += screenRect.height; | 230 | y += screenRect.height - popupEdgeDistance; | ||
broulik: What's this for? | |||||
Without this, popupEdgeDistance only moves popups that are in a screen corner away from one of the adjacent edges, rather than both. ngraham: Without this, popupEdgeDistance only moves popups that are in a screen corner away from one of… | |||||
231 | } else { | 231 | } else { | ||
232 | y += popupEdgeDistance; | 232 | y += popupEdgeDistance; | ||
233 | } | 233 | } | ||
234 | 234 | | |||
235 | var x = screenRect.x; | 235 | var x = screenRect.x; | ||
236 | if (popupLocation & Qt.AlignLeft) { | 236 | if (popupLocation & Qt.AlignLeft) { | ||
237 | x += popupEdgeDistance; | 237 | x += popupEdgeDistance; | ||
238 | } | 238 | } | ||
▲ Show 20 Lines • Show All 213 Lines • Show Last 20 Lines |
What's this for?