Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/NotificationPopup.qml
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 31 | PlasmaCore.Dialog { | |||
---|---|---|---|---|---|
102 | 102 | | |||
103 | // When notification is updated, restart hide timer | 103 | // When notification is updated, restart hide timer | ||
104 | onTimeChanged: { | 104 | onTimeChanged: { | ||
105 | if (timer.running) { | 105 | if (timer.running) { | ||
106 | timer.restart(); | 106 | timer.restart(); | ||
107 | } | 107 | } | ||
108 | } | 108 | } | ||
109 | 109 | | |||
110 | mainItem: MouseArea { | 110 | mainItem: Item { | ||
111 | id: area | | |||
112 | width: notificationPopup.popupWidth | 111 | width: notificationPopup.popupWidth | ||
113 | height: notificationItem.implicitHeight + notificationItem.y | 112 | height: notificationItem.implicitHeight + notificationItem.y | ||
113 | DraggableDelegate { | ||||
114 | id: area | ||||
115 | width: parent.width | ||||
116 | height: parent.height | ||||
114 | hoverEnabled: true | 117 | hoverEnabled: true | ||
118 | draggable: notificationItem.notificationType != NotificationManager.Notifications.JobType | ||||
119 | onDismissRequested: popupNotificationsModel.close(popupNotificationsModel.index(index, 0)) | ||||
115 | 120 | | |||
116 | cursorShape: hasDefaultAction ? Qt.PointingHandCursor : Qt.ArrowCursor | 121 | cursorShape: hasDefaultAction ? Qt.PointingHandCursor : Qt.ArrowCursor | ||
117 | acceptedButtons: hasDefaultAction ? Qt.LeftButton : Qt.NoButton | 122 | acceptedButtons: hasDefaultAction || draggable ? Qt.LeftButton : Qt.NoButton | ||
118 | 123 | | |||
119 | onClicked: notificationPopup.defaultActionInvoked() | 124 | onClicked: { | ||
125 | if (hasDefaultAction) { | ||||
126 | notificationPopup.defaultActionInvoked(); | ||||
127 | } | ||||
128 | } | ||||
120 | onEntered: notificationPopup.hoverEntered() | 129 | onEntered: notificationPopup.hoverEntered() | ||
121 | onExited: notificationPopup.hoverExited() | 130 | onExited: notificationPopup.hoverExited() | ||
122 | 131 | | |||
123 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | 132 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | ||
124 | LayoutMirroring.childrenInherit: true | 133 | LayoutMirroring.childrenInherit: true | ||
125 | 134 | | |||
126 | Timer { | 135 | Timer { | ||
127 | id: timer | 136 | id: timer | ||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 186 | NotificationItem { | |||
203 | onFileActionInvoked: notificationPopup.fileActionInvoked() | 212 | onFileActionInvoked: notificationPopup.fileActionInvoked() | ||
204 | 213 | | |||
205 | onSuspendJobClicked: notificationPopup.suspendJobClicked() | 214 | onSuspendJobClicked: notificationPopup.suspendJobClicked() | ||
206 | onResumeJobClicked: notificationPopup.resumeJobClicked() | 215 | onResumeJobClicked: notificationPopup.resumeJobClicked() | ||
207 | onKillJobClicked: notificationPopup.killJobClicked() | 216 | onKillJobClicked: notificationPopup.killJobClicked() | ||
208 | } | 217 | } | ||
209 | } | 218 | } | ||
210 | } | 219 | } | ||
220 | } |