Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/NotificationPopup.qml
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | 70 | mainItem: KQuickControlsAddons.MouseEventListener { | |||
---|---|---|---|---|---|
80 | onClicked: { | 80 | onClicked: { | ||
81 | // the MEL would close the notification before the action button | 81 | // the MEL would close the notification before the action button | ||
82 | // onClicked handler would fire effectively breaking notification actions | 82 | // onClicked handler would fire effectively breaking notification actions | ||
83 | if (notificationItem.pressedAction()) { | 83 | if (notificationItem.pressedAction()) { | ||
84 | return | 84 | return | ||
85 | } | 85 | } | ||
86 | 86 | | |||
87 | closeNotification(notificationProperties.source) | 87 | closeNotification(notificationProperties.source) | ||
88 | notificationPopup.hide() | 88 | // the popup will be closed in response to sourceRemoved | ||
89 | } | 89 | } | ||
90 | onContainsMouseChanged: { | 90 | onContainsMouseChanged: { | ||
91 | if (containsMouse) { | 91 | if (containsMouse) { | ||
92 | notificationTimer.stop() | 92 | notificationTimer.stop() | ||
93 | } else if (!containsMouse && visible) { | 93 | } else if (!containsMouse && visible) { | ||
94 | notificationTimer.restart() | 94 | notificationTimer.restart() | ||
95 | } | 95 | } | ||
96 | } | 96 | } | ||
Show All 20 Lines | 108 | NotificationItem { | |||
117 | x: units.smallSpacing | 117 | x: units.smallSpacing | ||
118 | y: units.smallSpacing | 118 | y: units.smallSpacing | ||
119 | 119 | | |||
120 | width: Math.round(23 * units.gridUnit) | 120 | width: Math.round(23 * units.gridUnit) | ||
121 | maximumTextHeight: theme.mSize(theme.defaultFont).height * 10 | 121 | maximumTextHeight: theme.mSize(theme.defaultFont).height * 10 | ||
122 | 122 | | |||
123 | onClose: { | 123 | onClose: { | ||
124 | closeNotification(notificationProperties.source) | 124 | closeNotification(notificationProperties.source) | ||
125 | notificationPopup.hide() | 125 | // the popup will be closed in response to sourceRemoved | ||
126 | } | 126 | } | ||
127 | onConfigure: { | 127 | onConfigure: { | ||
128 | configureNotification(notificationProperties.appRealName, notificationProperties.eventId) | 128 | configureNotification(notificationProperties.appRealName, notificationProperties.eventId) | ||
129 | notificationPopup.hide() | 129 | notificationPositioner.closePopup(notificationProperties.source); | ||
130 | } | 130 | } | ||
131 | onAction: { | 131 | onAction: { | ||
132 | executeAction(notificationProperties.source, actionId) | 132 | executeAction(notificationProperties.source, actionId) | ||
133 | actions.clear() | 133 | actions.clear() | ||
134 | notificationPopup.hide() | | |||
135 | } | 134 | } | ||
136 | } | 135 | } | ||
137 | } | 136 | } | ||
138 | 137 | | |||
139 | } | 138 | } |