Giter Club home page Giter Club logo

Comments (3)

dreua avatar dreua commented on June 7, 2024

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.)

from pdfarranger.

dreua avatar dreua commented on June 7, 2024

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

from pdfarranger.

jeromerobert avatar jeromerobert commented on June 7, 2024

@dreua Thank you, this is just brillant.

from pdfarranger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.