Implement Drag n Drop file transfer on the plasmoid
ClosedPublic

Authored by fstpierre on Dec 15 2018, 7:38 PM.

Details

Summary

A DropArea has been added to the ListItem representing a device in the
plasmoid based on what is done in the Quickshare plasmoid. This enables
Drag n Drop of files onto a section of the plasmoid to transfer files.

The DropArea has the size of the ListItem which is a rectangle
including the title of the device down to the button to share text.
Additionally, there is a tooltip area covering the DropArea to indicate
that it is possible to drop a file to send it to the device. Multiple files
can be sent at once.

Ref T8288

Test Plan

Drag and Drop one or many files onto the widget, the files should be transferred to the connected device.

Diff Detail

Repository
R224 KDE Connect
Lint
Lint Skipped
Unit
Unit Tests Skipped
fstpierre created this revision.Dec 15 2018, 7:38 PM
Restricted Application added a project: KDE Connect. · View Herald TranscriptDec 15 2018, 7:38 PM
Restricted Application added a subscriber: kdeconnect. · View Herald Transcript
fstpierre requested review of this revision.Dec 15 2018, 7:38 PM

Here is a screenshot of the added tooltip.

This is cool! But kind of finicky:

When I drop an item into the plasmoid on my desktop, it offers to let me do things to the desktop with the file, see:

I use the plasmoid from the system tray. It offers me the tooltip, but it is not possible to drag and drop a file into the plasmoid on the system tray. The behavior I was expecting was to be able to drag the file-to-share over the KDE Connect icon in the system tray, hover for a second, and the system tray would expand so I could drop my file into the plasmoid

This is cool! But kind of finicky:

When I drop an item into the plasmoid on my desktop, it offers to let me do things to the desktop with the file, see:

I use the plasmoid from the system tray. It offers me the tooltip, but it is not possible to drag and drop a file into the plasmoid on the system tray. The behavior I was expecting was to be able to drag the file-to-share over the KDE Connect icon in the system tray, hover for a second, and the system tray would expand so I could drop my file into the plasmoid

Ah I see. I did not bother to test the plasmoid in non-windowed mode. I have a fix for the first issue concerning the file also being dropped on the desktop.

As for the second issue concerning the tray icon, I will need to do some research to find out how to open the plasmoid from the tray, which will involve creating a compact representation with the icon to replace the default one.

fstpierre updated this revision to Diff 47650.Dec 16 2018, 4:29 AM

Very cool! I can now drop onto the desktop plasmoid and have it share without the weird popup, and I can expand the toolbar plasmoid by hovering over it while dragging. Nice!

The only complaint I noticed in this round of testing is there is no tooltip if you hover in the area created by notifications from the notifications plugin. If it is too difficult to handle this case, I think it would be fine to merge without it.

Hello,

I have tested a few things but could not manage to get the tooltip to show everywhere without causing issues with the rest of the widgets. Putting the tooltip on top (with the property z greater than 0) prevents underlying widgets from receiving mouse movements, thus making them look weird. I do not have any improvement for now before merging.

sredman accepted this revision.Dec 23 2018, 11:49 PM

Hello,

I have tested a few things but could not manage to get the tooltip to show everywhere without causing issues with the rest of the widgets. Putting the tooltip on top (with the property z greater than 0) prevents underlying widgets from receiving mouse movements, thus making them look weird. I do not have any improvement for now before merging.

Sounds good! Do you have merge permissions? Otherwise I will do it for you

This revision is now accepted and ready to land.Dec 23 2018, 11:49 PM

Hello, I don't think I have merge permissions. You can merge for me. Thank you!

This revision was automatically updated to reflect the committed changes.