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

Customizing position of the drag and drop tooltip #6973

Closed
AspectUnk opened this issue Oct 31, 2023 · 1 comment
Closed

Customizing position of the drag and drop tooltip #6973

AspectUnk opened this issue Oct 31, 2023 · 1 comment
Labels

Comments

@AspectUnk
Copy link

Hello. I can customize a tooltip using BeginDragDropSource with ImGuiDragDropFlags_SourceNoPreviewTooltip, but not the position because i cannot disable the SetNextWindowPos call. Previously SetNextWindowPos was called inside BeginDragDropSource which disabled its call. Perhaps there is a reason for this. At the moment I see two fixes:

  1. Will go back to the old version. Where the tooltip position is set inside BeginDragDropSource.
  2. Add a flag ImGuiTooltipFlags_IgnoreDragDrop which should be checked here. Something like of this:
    if ((tooltip_flags & ImGuiTooltipFlags_IgnoreDragDrop) == 0 && (g.DragDropWithinSource || g.DragDropWithinTarget))
@AspectUnk AspectUnk changed the title Customizing position of the drap and drop tooltip Customizing position of the drag and drop tooltip Oct 31, 2023
@ocornut ocornut added the drag drop drag and drop label Nov 1, 2023
ocornut added a commit that referenced this issue Aug 23, 2024
…position while inside a drag and drop source or target. (#6973)
@ocornut
Copy link
Owner

ocornut commented Aug 23, 2024

Hello, this should now be solved with 1e939fc, it was a pretty simple change. You can now call SetNextWindowPos() before BeginTooltip() while in a drag and drop source or target.

I wonder if we should introduce a new ImGuiCond_NoOverrideSetExistingValue flag to formalize this idiom since it is used in various places.

@ocornut ocornut closed this as completed Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants