Skip to content

Global overlay drawing system (e.g. for drag and drop) #2307

@tznind

Description

@tznind

Is your feature request related to a problem? Please describe.

Sometimes you want to be able to paint arbitrary stuff over the top of other views. For example during drag and drop.

Use cases

The primary use case is for 'drag and drop' style effects e.g.

  • Showing a representation of a file as you drag from one box to another
  • Showing a tab as you drag around the screen to drop into another TabView

For example after dragging a tab in VisualStudio you see the title in 2 places. Its original location and wherever the cursor is.

shot-2023-01-27_19-49-19

But there are other potential use cases e.g.

  • Holding down a button to show a tutorial overlay over the UI.

Describe the solution you'd like

The drawing would need to happen last after all other views had drawn for the loop iteration.

When a new drawing/location is set (e.g. after the mouse moves) then the old contents would need to be invalidated (so that dragging didn't leave a 'trail').

Performance would have to be good so maybe have some kind of inbuilt throttling or back buffer. Especially relevant if redrawing on Mouse Move events.

Alternatives Considered
It would probably be possible to have the rendered content be a View itself but this feels hacky and would likely interfere with detecting what the mouse was released over (e.g. because the animation follows the mouse)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions