Changeset View
Changeset View
Standalone View
Standalone View
plasmoid/package/contents/ui/DeviceDelegate.qml
Show First 20 Lines • Show All 232 Lines • ▼ Show 20 Line(s) | 232 | model: NotificationsModel { | |||
---|---|---|---|---|---|
233 | id: notificationsModel | 233 | id: notificationsModel | ||
234 | deviceId: root.device.id() | 234 | deviceId: root.device.id() | ||
235 | } | 235 | } | ||
236 | delegate: PlasmaComponents.ListItem { | 236 | delegate: PlasmaComponents.ListItem { | ||
237 | id: listitem | 237 | id: listitem | ||
238 | enabled: true | 238 | enabled: true | ||
239 | onClicked: checked = !checked | 239 | onClicked: checked = !checked | ||
240 | 240 | | |||
241 | PlasmaCore.IconItem { | ||||
242 | id: notificationIcon | ||||
243 | source: appIcon | ||||
244 | width: (valid && appIcon.length) ? dismissButton.width : 0 | ||||
245 | height: width | ||||
246 | anchors.left: parent.left | ||||
247 | } | ||||
241 | PlasmaComponents.Label { | 248 | PlasmaComponents.Label { | ||
242 | text: appName + ": " + display | 249 | text: appName + ": " + display | ||
243 | anchors.right: dismissButton.left | 250 | anchors.right: replyButton.left | ||
244 | anchors.left: parent.left | 251 | anchors.left: notificationIcon.right | ||
245 | elide: listitem.checked ? Text.ElideNone : Text.ElideRight | 252 | elide: listitem.checked ? Text.ElideNone : Text.ElideRight | ||
246 | maximumLineCount: listitem.checked ? 0 : 1 | 253 | maximumLineCount: listitem.checked ? 0 : 1 | ||
247 | wrapMode: Text.WordWrap | 254 | wrapMode: Text.WordWrap | ||
248 | } | 255 | } | ||
249 | PlasmaComponents.ToolButton { | 256 | PlasmaComponents.ToolButton { | ||
257 | id: replyButton | ||||
258 | visible: repliable | ||||
259 | enabled: repliable | ||||
260 | anchors.right: dismissButton.left | ||||
261 | iconSource: "mail-reply-sender" | ||||
262 | onClicked: dbusInterface.reply(); | ||||
263 | } | ||||
264 | PlasmaComponents.ToolButton { | ||||
250 | id: dismissButton | 265 | id: dismissButton | ||
251 | visible: notificationsModel.isAnyDimissable; | 266 | visible: notificationsModel.isAnyDimissable; | ||
252 | enabled: dismissable | 267 | enabled: dismissable | ||
253 | anchors.right: parent.right | 268 | anchors.right: parent.right | ||
254 | iconSource: "window-close" | 269 | iconSource: "window-close" | ||
255 | onClicked: dbusInterface.dismiss(); | 270 | onClicked: dbusInterface.dismiss(); | ||
256 | } | 271 | } | ||
257 | } | 272 | } | ||
258 | } | 273 | } | ||
259 | 274 | | |||
260 | //NOTE: More information could be displayed here | 275 | //NOTE: More information could be displayed here | ||
261 | 276 | | |||
262 | } | 277 | } | ||
263 | } | 278 | } |