Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/NotificationPopup.qml
Show All 29 Lines | |||||
30 | 30 | | |||
31 | PlasmaCore.Dialog { | 31 | PlasmaCore.Dialog { | ||
32 | id: notificationPopup | 32 | id: notificationPopup | ||
33 | 33 | | |||
34 | location: PlasmaCore.Types.Floating | 34 | location: PlasmaCore.Types.Floating | ||
35 | type: PlasmaCore.Dialog.Notification | 35 | type: PlasmaCore.Dialog.Notification | ||
36 | flags: Qt.WindowDoesNotAcceptFocus | 36 | flags: Qt.WindowDoesNotAcceptFocus | ||
37 | 37 | | |||
38 | property var notificationProperties | 38 | property var notificationProperties: ({}) | ||
39 | signal notificationTimeout() | 39 | signal notificationTimeout() | ||
40 | 40 | | |||
41 | onVisibleChanged: { | 41 | onVisibleChanged: { | ||
42 | if (!visible) { | 42 | if (!visible) { | ||
43 | notificationTimer.stop(); | 43 | notificationTimer.stop(); | ||
44 | } | 44 | } | ||
45 | } | 45 | } | ||
46 | 46 | | |||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 100 | onTriggered: { | |||
103 | } | 103 | } | ||
104 | notificationPopup.notificationTimeout(); | 104 | notificationPopup.notificationTimeout(); | ||
105 | } | 105 | } | ||
106 | } | 106 | } | ||
107 | 107 | | |||
108 | NotificationItem { | 108 | NotificationItem { | ||
109 | id: notificationItem | 109 | id: notificationItem | ||
110 | 110 | | |||
111 | summary: notificationProperties ? notificationProperties.summary: "" | 111 | summary: notificationProperties.summary || "" | ||
112 | body: notificationProperties ? notificationProperties.body : "" | 112 | body: notificationProperties.body || "" | ||
113 | icon: notificationProperties ? notificationProperties.appIcon : "" | 113 | icon: notificationProperties.appIcon || "" | ||
114 | image: notificationProperties ? notificationProperties.image : undefined | 114 | image: notificationProperties.image | ||
115 | configurable: (notificationProperties ? notificationProperties.configurable : false) && !Settings.isMobile | 115 | // explicit true/false or else it complains about assigning undefined to bool | ||
116 | urls: notificationProperties ? notificationProperties.urls : [] | 116 | configurable: notificationProperties.configurable && !Settings.isMobile ? true : false | ||
117 | urls: notificationProperties.urls || [] | ||||
117 | 118 | | |||
118 | x: units.smallSpacing | 119 | x: units.smallSpacing | ||
119 | y: units.smallSpacing | 120 | y: units.smallSpacing | ||
120 | 121 | | |||
121 | width: Math.round(23 * units.gridUnit) | 122 | width: Math.round(23 * units.gridUnit) | ||
122 | maximumTextHeight: theme.mSize(theme.defaultFont).height * 10 | 123 | maximumTextHeight: theme.mSize(theme.defaultFont).height * 10 | ||
123 | 124 | | |||
124 | onClose: { | 125 | onClose: { | ||
Show All 22 Lines |