Skip to content
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

Drag should move all selected pages #17

Closed
jeromerobert opened this issue Nov 3, 2018 · 3 comments
Closed

Drag should move all selected pages #17

jeromerobert opened this issue Nov 3, 2018 · 3 comments
Labels
help needed I don't know how to do

Comments

@jeromerobert
Copy link
Member

jeromerobert commented Nov 3, 2018

Select multiple pages, drag to different position -> should drag all selected pages and not only one. (sf, savannah) (quoting @darkdragon-001)

When starting the drag one must click on one page of among those who are selected. The problem is that clicking on an already selected icon in a Gtk IconView, unselect it.

Here are the only relevant pages Google gave to me:

The first one is about TreeView and I was not able to adapt it to IconView. The second one still have no answer.

Thunar is using Gtk3 and properly handle multi-selection in IconView but they are exo IconView, not plain Gtk IconView.

I need help on that bug. If someone know a simple Gtk application (even better a pyGtk one) that properly handle multi-section in IconView that would help.

@dreua
Copy link
Member

dreua commented Nov 8, 2018

Here is my work in progress: dreua/pdfshuffler@a0a3b6a
It uses self.iconview.drag_begin_with_coordinates to initiate the drag and returns True on iv_button_press_event so the automatic deselection is prevented but the drag & drop is still possible. It is a proof of concept and already feels quite good but there is work to do, here is what I found so far:

  • Unable to deselect pages by clicking on the selection. Especially a problem if you selected all pages.
  • Simple clicking on the selection can lead to dnd being "stuck" even if mouse button is released.
  • When dragging from one window to another a + symbol is displayed even if "move" operation is performed.

I belive this is all fixable using the ideas from your first link and maybe some mouse movement detection to decide if the user wants to click or drag. (E.g. emit the drag_begin_with_coordinates only after the mouse was moved some pixels from the mouse down location.)
I wanted to share this with you as I might not have the time to continue development on theses points this month. Everyone feel free to pick this up and improve.

Disclaimer: This might not be the best and easiest solution but I'm quite sure it is a doable solution. If there is a way to prevent the automatic deselection on button_press_event but keep the built in drag and drop intact, that might be a better solution. (More similar to the one in the first link.)

@dreua
Copy link
Member

dreua commented Nov 19, 2018

Ready for testing and input: master...dreua:wip_fix_multi_dnd

@jeromerobert
Copy link
Member Author

@dreua Thank you, this is just brillant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help needed I don't know how to do
Projects
None yet
Development

No branches or pull requests

2 participants