keepassxc icon indicating copy to clipboard operation
keepassxc copied to clipboard

When moving more than two entries it creates a huge rectangule and turn the target impossible to see

Open dareducky opened this issue 4 years ago • 5 comments

Overview

Whenever I try to move more than two entries the animation of moving the entries completely block the target group, forcing me to guess the directory position.

Steps to Reproduce

  1. Select two or more entries in your main window
  2. Try dragging them to a group
  3. The animation actualy draw the full rectangles completely hidding anything behind this rectangles.

Expected Behavior

The dragging animation should be transparent so you can see the target and, ideally, it should not move the whole entry field which results in a huge rectangule.

If you need example of proper implementation you could try selecting multiple files/folders in windows 10 or probably any operating system and you can understand the proper way to do it.

Actual Behavior

Draggin multiple entries result in a huge rectangule that blocks the view and turn dropping them in groups a guessing game or use a workaround that is dragging from the beggining of the entries field.

Context

KeePassXC - 2.6.4

Operating System: Windows Desktop Env: ... Windowing System: ...

dareducky avatar Feb 07 '21 18:02 dareducky

Good point that is rather annoying.

image

droidmonkey avatar Feb 12 '21 04:02 droidmonkey

Could this be a platform-dependent Qt problem? I can't reproduce it on Mac (the transparency works well). We can try to reduce the rectangle anyway

xvallspl avatar May 04 '21 08:05 xvallspl

That might actually be the solution - enabling transparency while dragging. If Qt allows for such a thing in Windows, that is.

JohnLGalt avatar May 04 '21 20:05 JohnLGalt

It's not clear how to get a widget handle for tye dragged object. That is currently all handled internally to the QTreeView. If you had a widget pointer you could set its transparency.

droidmonkey avatar May 04 '21 21:05 droidmonkey

It's not clear how to get a widget handle for the dragged object. That is currently all handled internally to the QTreeView. If you had a widget pointer you could set its transparency.

droidmonkey avatar May 04 '21 21:05 droidmonkey

This code seems to work, I'm not a c++ guy, would appreciate if someone looked at it https://forum.qt.io/topic/60422/hide-default-drag-rendering/7

Edit: Forgot to mention that I tested it locally (and also it shouldn't use copy action)

feelingnothing avatar Jul 01 '23 00:07 feelingnothing

Interesting, will give it a try

droidmonkey avatar Jul 01 '23 02:07 droidmonkey

The only way to actually fix this is to completely overwrite the QAbstractItemView::startDrag virtual function... Qt sucks

droidmonkey avatar Jul 01 '23 12:07 droidmonkey

I was able to get this to work:

image

Still needs some love but I am thinking of going this direction.

droidmonkey avatar Jul 01 '23 21:07 droidmonkey

I settled in on this:

image

droidmonkey avatar Jul 02 '23 20:07 droidmonkey