Dplug icon indicating copy to clipboard operation
Dplug copied to clipboard

When a widget is dragged, should other elements be "isMouseOver"?

Open p0nce opened this issue 2 years ago • 4 comments

EDIT: independently reported by QA as an issue.

Found this: you are dragging an object, go into another UIelement while dragging, and then the new Element highlights since you could click it. However, you cannot really click it, as you are dragging.

Either

  • A. needs isDraggingAnotherElement,
  • B. or to change isMouseOver so that it's false when dragging another UIElement. (preffered)

p0nce avatar Apr 12 '22 12:04 p0nce

This is absolutely endemic, for example when you drag a knob, every other widget is mouse over.

p0nce avatar Apr 29 '22 19:04 p0nce

Current algorithm:

void receive-mouse-movement(pos):
    root.mouse-is-moving(pos)
    if (no widget was found to be "mouseover")
        "mouseover" becomes null

void mouse-is-moving(e, pos):
     recurse mouse-is-moving(highz children, pos)
     if (isDragged) onMouseDrag
     if (visible and contain mouse):
         if first in stack, become the "mouseover" widget
         onMouseMove, even if not "mouseover" (!)
     recurse mouse-is-moving(lowz children, pos)

p0nce avatar Jun 30 '22 09:06 p0nce

Changes needed:

  • [x] when a drag is stopped, find the mouseover element again
  • [x] mouse over can't become null during a drag operation
  • [x] dragged widget does receive onMouseDrag but not onMouseMove at the same time, this is redundant.
  • [x] only the mouseOver widget receive mouseMove callbacks, and not all widgets in the stack
  • [x] isDragged implies isMouseOver when true

p0nce avatar Jun 30 '22 10:06 p0nce

futureMouseDrag not very recommended for now... I don't really like the end result either. Not having mouseOver is a bit "stale" while dragging. It still gives useful "this is draggable" information.

p0nce avatar Aug 23 '22 21:08 p0nce

futureMouseDrag can be kept, eventually we can stop later forcing the dragged widget to be the mouseover one. But it doesn't really make interface worse, some developers might like it better. Remaining bug was fixed too.

p0nce avatar Oct 10 '22 16:10 p0nce