Bug 386034

Summary: Wish: Drag image from Gwenview's view mode to initiate drag and drop operation
Product: [Applications] gwenview Reporter: null <null>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: nate
Priority: NOR    
Version: 17.08.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 18.08.0

Description null 2017-10-21 17:44:19 UTC
Gwenview currently supports drag and drop of images inside the folder tree, the browse mode and in the thumbnail bar. In view mode, dragging is used for panning.

When the image is zoomed to fit the viewport (which it is by default), no panning is possible. In this situation, dragging the image should initiate a drag and drop action. Of course, the image should not be able to be dropped onto itself.

Use case from bug 370740: When Gwenview is started from another program (e.g. from Kopete or KMail, but not Dolphin) to view an image, the user might want to save the image by dragging it to a folder in Gwenview, to a Dolphin window or to the desktop.

Note: Dragging an image _to_ Gwenview is tracked in bug 169408.
Comment 1 Nate Graham 2017-10-21 19:33:35 UTC
This seems reasonable.
Comment 2 Huon 2018-06-24 01:28:16 UTC
Git commit 984b9737f0796c48ab68fe0f60bc179e26fbcf62 by Huon Imberger.
Committed on 24/06/2018 at 01:26.
Pushed by huoni into branch 'master'.

Allow dragging from View mode to external applications

Summary:
This patch adds drag functionality to {nav 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.
FIXED-IN: 18.08.0

{F5781358}

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

M  +2    -2    lib/documentview/abstractdocumentviewadapter.h
M  +6    -0    lib/documentview/abstractimageview.cpp
M  +2    -0    lib/documentview/abstractimageview.h
M  +106  -0    lib/documentview/documentview.cpp
M  +3    -0    lib/documentview/documentview.h
M  +5    -0    lib/documentview/rasterimageviewadapter.cpp
M  +1    -0    lib/documentview/rasterimageviewadapter.h
M  +5    -0    lib/documentview/svgviewadapter.cpp
M  +2    -0    lib/documentview/svgviewadapter.h

https://commits.kde.org/gwenview/984b9737f0796c48ab68fe0f60bc179e26fbcf62
Comment 3 null 2018-07-08 22:45:39 UTC
Git commit 3215716e422ef1d6dc93d83a25c655095bb0ba6d by Henrik Fehlauer.
Committed on 08/07/2018 at 22:45.
Pushed by rkflx into branch 'master'.

Do not allow to drag an image onto itself

Summary:
The combination of 131d25855e11 and 984b9737f079 led to the user being
able to drag an image in {nav View} mode and immediately drop it again.
The drag cursor implied Gwenview allowed this kind of operation, while
actually nothing would happen as the URL did not change.

To prevent confusion, we do not allow to drop the image in that
situation anymore. It is still possible to drop multiple images which
include the current image, so a future patch could implement switching
to {nav Compare} mode in that case.

As a side effect a small visual bug is fixed: When moving very slowly
while initiating a drag, the `ForbiddenCursor` would appear briefly
until you moved the mouse further along and the actual drag cursor
appeared. With the patch applied, the cursor will always keep being set
to `ForbiddenCursor`, preventing any flickering.

Test Plan:
Slowly start to drag an image in {nav View} mode. The cursor should
indicate no dropping is allowed.

Reviewers: #gwenview, huoni

Reviewed By: #gwenview, huoni

Subscribers: huoni

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

M  +9    -1    lib/documentview/documentview.cpp

https://commits.kde.org/gwenview/3215716e422ef1d6dc93d83a25c655095bb0ba6d