[Notifications] Show interactive thumbnails on notifications
ClosedPublic

Authored by broulik on Nov 29 2016, 4:47 PM.

Details

Summary

When a notification contains URLs, they will be shown as a large preview (in case of one thumbnail) or multiple in a strip (similar to what Klipper does).

The previews can be clicked to open the file and can be dragged anywhere (e.g. to a webbrowser or chat window).

Test Plan

Spectacle can take advantage of this (the cursor actually changes to the open hand cursor to indicate it's a draggable surface but this cannot be seen in the screenshot)


Regular image passed as argument (preview size was slightly reduced in 2nd patch revision)

Multiple files that fit in the notification

Too many files, overflow

Single file without thumbnail

Right-click does nothing - would be neat to have the regular KIO file context menu there.
It doesn't properly work with grouping, ie. when two notifications are grouped together, the thumbnail shown is the one from the last notification.

Needs https://git.reviewboard.kde.org/r/129586/

Diff Detail

Repository
R120 Plasma Workspace
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik updated this revision to Diff 8608.Nov 29 2016, 4:47 PM
broulik retitled this revision from to [Notifications] Show interactive thumbnails on notifications.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added reviewers: Plasma, Plasma: Design.
broulik set the repository for this revision to R120 Plasma Workspace.
Restricted Application added a project: Plasma. · View Herald TranscriptNov 29 2016, 4:47 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik edited the test plan for this revision. (Show Details)Nov 29 2016, 4:48 PM

Really nice!
The single thumbnail might be a bit too large, as having large notification windows pop up could be irritating. Maybe half the size would be big enough?

broulik updated this revision to Diff 8625.Nov 30 2016, 9:36 AM
  • Reduce preview area in height (now 1/3 of the dialog width instead of 1/2 as before – I tried 1/4 but given the aspect ratio it would make the preview hard to see imho)
  • When there is one item but a preview could not be generated show it as regular sized file instead of huge file icon
  • Use PlasmaCore.IconItem for the icon instead of having the Previewer generate a pixmap off the theme icon
broulik edited the test plan for this revision. (Show Details)Nov 30 2016, 9:36 AM
mart added a subscriber: mart.Nov 30 2016, 4:20 PM

I like the idea, but i am a bit concerned about the added complexity, that may be worked around?

applets/notifications/package/contents/ui/NotificationItem.qml
318 ↗(On Diff #8625)

the main concern i have, is the general weight of QML.
this is going to make worse both memory usage and time to instantiate the notification item, regarless if the notification has urls or not...
idea: could all of this part be in a loader that actually parses the component and instantiates the whole listview only if there is at least one url?

broulik updated this revision to Diff 8662.Dec 1 2016, 10:15 AM
broulik edited the test plan for this revision. (Show Details)
  • Put thumbnail strip behind a Loader
  • Make clicking the thumbnails actually work (horrible hack because of the MouseEventListener we have in the popup)
  • Make thumbnails in the notification history work
broulik marked an inline comment as done.Dec 1 2016, 10:15 AM
mart accepted this revision.Dec 1 2016, 10:30 AM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Dec 1 2016, 10:30 AM
broulik updated this revision to Diff 8663.Dec 1 2016, 10:31 AM
broulik edited edge metadata.
  • "Expire" notification when clicking a URL

This will cause the popup to close properly (previous patch would just hide the window but not "free" the dialog) but it will be kept in the history if it is a persistent notification

This revision was automatically updated to reflect the committed changes.