Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Drag and Drop from ksnip to other applications #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MegaV0lt opened this issue Jul 15, 2020 · 26 comments
Closed

Drag and Drop from ksnip to other applications #377

MegaV0lt opened this issue Jul 15, 2020 · 26 comments
Assignees

Comments

@MegaV0lt
Copy link

When taking screenshot it apears in the ksnipwindow and also gets saved on disk when enabled in config.

A missing feature is that it is not possible to use mouse to drag and drop the current screenshot to browser or messenger. this feature woud be nich and i miss it because i com from shutter that is now unsuprtet by my disrto.

Please add "Drag&Drop" from ksnip window to others.

@DamirPorobic
Copy link
Member

We support already drag and drop into ksnip, this would probably complete the drag and drop logic. I'll plan that for the next major release.

@DamirPorobic DamirPorobic changed the title Enable "Drag&Drop" from aplication window to others Enable "Drag&Drop" from ksnip to other applications Jul 15, 2020
@MegaV0lt
Copy link
Author

Great! Looking forward to it

@amenk
Copy link
Contributor

amenk commented Jan 20, 2021

Just added you as a sponsored via "imidigitaldev", this issue would be super interesting for my colleagues and me :)

@DamirPorobic
Copy link
Member

@amenk thanks, much appreciated :)

I have planned this feature for the next minor release. Currently I'm finishing up some bugs for the 1.8.1 patch release, after that I'l continue working on 1.9.0.

@DamirPorobic
Copy link
Member

I've been thinking about this one today and we might have a usability problem or at least I don't know how shutter resolved it.

The image is show in the annotator and in the annotator there is always a tool select, either the Select or some Annotation tool. Left click and move with the Select tool draws a region for selecting items below it and with any other annotation tool we draw the tool. So how should we detect a drag?

@amenk
Copy link
Contributor

amenk commented Jan 20, 2021

In shutter it's a two step procedure to edit a screenshot, that's why in the viewing step you can drag.

Maybe dragging could work from the screenshot name tab or a specific icon or area for dragging could be added there?

@DamirPorobic
Copy link
Member

Yes, everywhere except the annotation area should not be a problem but what I'm afraid is that probably everyone is going to drag from the annotation area and only few would know that you can drag from the tab for example.

But yes, might be a starting point.

@amenk
Copy link
Contributor

amenk commented Jan 20, 2021

The tabs are already dragable (for reordering), so it would be easy to find out if they are also drag'n'drop-able to another application.

But somehow this can work only if autosave is on I guess? Or does it make sense save just before dropping into another application? I believe this could be surprising for users. Of course there could be a warning message when dragging-out and it's not yet saved. Maybe with the option to turn autosave one from there.

It would also be okay with me to hit save and then use the drag'n'drop.

I usually use sequential naming "testing-step-##", so I might not always want to switch on auto save.

@DamirPorobic
Copy link
Member

It doesn't have to be saved, it's basically the same as copying the image, we create a QImage from the current annotator content and copy it to the QDrag, which is basically a glorified clipboard https://doc.qt.io/qt-5/dnd.html#dragging

But that's maybe a problem with drag&drop of the tab, maybe the Tab, that are a Qt component capture the drag event for them and don't hand it over to us. We'll when we get to the implementation.

@amenk
Copy link
Contributor

amenk commented Jan 20, 2021

In shutter we drag'n'drop the files to our issue tracker's upload field, so that would be more like a file drag I guess

@DamirPorobic
Copy link
Member

You sure that your issue tracker doesn't support pasting an image from clipboard directly without the image being saved? I use it very often, Github supports it, Jira, Confluence, Outlook, MS Teams and so on. I can't remember any case where it didn't work. I usually never save images that I take with ksnip, I just take them, annotate and then copy and paste it somewhere and close ksnip.

@amenk
Copy link
Contributor

amenk commented Jan 20, 2021

We use Easyredmine... It does support It somehow, but not as well as GitHub.

Also it would be nice to benefit of the sequential naming features of ksnip in this case, i.e..filenames would get lost with the copy-paste approach.

It's all not a must, but that is our current workflow with shutter. Maybe we find a better one with ksnip.

@ljubadr
Copy link

ljubadr commented Jan 30, 2021

Monosnap has a dedicated button for drag & drop on the far right side. Maybe adding similar button next to Copy or something could work? Currently I'm using the copy option as a replacement, but it's useful to have the drag & drop option as well

image

@DamirPorobic
Copy link
Member

Is it a button or a region?
In the toolbar where copy is are usually buttons, it might be confusing to have it there, users might be tempted to click on it. On the other hand, we have there the delay picker where you enter something.
Another option could somewhere on the left site, below the settings, close to the zoom picker?

Yet another option could be using different mouse buttons, like mouse right click or middle click or combination of buttons (left + right).

@ljubadr
Copy link

ljubadr commented Jan 30, 2021

It's a button, only downside to having it on the right side was that you could not click on it when it's full screen πŸ˜„

Thank you for taking this feature into consideration! Most of the time copy is enough, but sometimes drag & drop is really useful.

I think that button close to the zoom would work nicely. Add a D shortcut for it and it's perfect πŸ˜ƒ

Or maybe it's possible to add small drag & drop icon in the tab maybe? For example on the left side of the file name.

@DamirPorobic
Copy link
Member

In the tab might be again confusing because you can drag the tab too. It's not an easy task to find the right solution.

We have some time to think more about this feature, I will probably not work on it before I finish 1.8.1 which has still 2-3 open issues.

@DamirPorobic
Copy link
Member

I think I will soon start working on this feature and currently my thinking about this feature is following:

  1. Dragging tabs is problematic because tabs are draggable by them self and we have a non tab mode that shows no tabs at all and even in tab mode there is a feature that hides tabs when there is only single tab.
  2. Having a specific button might not be very intuitive, users are going to try to click on it and then log bugs that it does nothing.
  3. Having a region on the side like Monosnap is problematic because we have screenshots that might cover the whole screen then this widget is not visible.
  4. Having a specific icon just for drag and drop might work but where do you put it? On the tab is problematic (see first point). Just putting a label somewhere might be ugly.

For me doable solutions are:

  1. Using a specific mouse button combination (Left+Right or Middle or Left+Middle ... something like that) to drag from anywhere on the annotation area.
  2. Adding a small region from where to drag, maybe right from the delay picker or above/below the zoom picker.
  3. Adding a widget something like Monosnap has but only on the inside of ksnip and it is hidden by default and comes up only when you hover with the mouse close to it. An even more advanced version might be it comes up wherever you hover close to the bottom or right border of ksnip. This option is in my option the most complex to implement.

I personally favor currently solution 1. because it can quickly be implemented. Solution 3. might be nice too but it is probably going to be a PITA to make it work with different screen scaling settings. What you guys think @amenk @MegaV0lt @ljubadr ?

@amenk
Copy link
Contributor

amenk commented Feb 20, 2021

I prefer, but 1. maybe left + modifier (shift) ? left + right might be a bit hard to reach and not all mice have middle buttons

@DamirPorobic
Copy link
Member

Good point, left click plus modifier might work just nice. Need to check what is free.

@DamirPorobic DamirPorobic self-assigned this Feb 20, 2021
@ljubadr
Copy link

ljubadr commented Feb 21, 2021

  1. @amenk has a valid point - for example I use Magic Trackpad 2, and it would be much easier to use it with the click + modifier combo. Maybe add config to select modifier key. I would probably prefer this approach πŸ˜„
  2. this could work too. Disable it by default and add config option to show it - anyone who needs this functionality will enable it
  3. probably too complicated...

@DamirPorobic DamirPorobic changed the title Enable "Drag&Drop" from ksnip to other applications Drag and Drop from ksnip to other applications Feb 21, 2021
@DamirPorobic
Copy link
Member

This is now implemented with Left Mouse+Shift. When the image is not saved (not saved at all or has unsaved changes) a temporary file is created in the tmp folder and that one is then uploaded. This is required in order to share files with non Qt application. I have tested this on Linux with pasting images to Libre Office Writer, with Outlook WebMail and GitHub comments, seems to be working.

@amenk
Copy link
Contributor

amenk commented Feb 21, 2021

Works well - thank you :-)

@fabianski7
Copy link
Contributor

This ended up implementing another function too: duplicate screenshots

Just drag the image to another tab and you're done.
Amazing work @DamirPorobic

@ljubadr
Copy link

ljubadr commented Feb 21, 2021

Tested 1.9.0 drag&drop update on Ubuntu 20.04 and it works well. Thanks @DamirPorobic πŸ‘

@aseques
Copy link
Contributor

aseques commented Mar 12, 2021

Just wanted to say thanks for this feature πŸ‘

@DamirPorobic
Copy link
Member

@aseques you're welcome :)

@fabianski7 you were able to do it before too, with CTRL+C then CTRL+V would have created a duplicate tab too ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants