Allow dragging from View mode to external applications

Authored by huoni on Jun 23 2018, 5:13 AM.

Description

Allow dragging from View mode to external applications

Summary:
This patch adds drag functionality to View mode. A
drag operation is only initiated if dragging wouldn't
otherwise do something, e.g. when zoomed and the image is
pannable, or the crop tool is active.

In order to get a drag pixmap for all cases (videos
included), we use a ThumbnailProvider to generate a file
preview. However, if the image is modified, we generate a
new pixmap using the edited version. Using
MimeTypeUtils::selectionMimeData, this should mean the
drag pixmap always matches the image the receiving
application gets.

BUG: 386034
FIXED-IN: 18.08.0

Test Plan:
Drag from View mode, comparison mode.
Try raster, SVG, and video file types, including when the
image is modified (cropped or rotated).
Panning a zoomed image should still be possible.
Drag operation should always get a thumbnail/icon pixmap
representing the dropped image.

Reviewers: Gwenview, rkflx

Reviewed By: Gwenview, rkflx

Tags: Gwenview

Differential Revision: https://phabricator.kde.org/D11877

Details

Committed
huoniJun 24 2018, 1:26 AM
Reviewer
Gwenview
Differential Revision
D11877: Allow dragging from View mode to external applications
Parents
R260:faa19b06b14e: Add possibility to sort by rating
Branches
Unknown
Tags
Unknown